shazow / whatsabi

Extract the ABI (and resolve proxies, and get other metadata) from Ethereum bytecode, even without source code.
https://shazow.github.io/whatsabi/
MIT License
1.06k stars 74 forks source link

Improve selector detection #6

Open shazow opened 2 years ago

shazow commented 2 years ago

There are some cases where we fail to capture a selector:

One possible approach is to detect the "jump table" section of the bytecode, which is (always?) at the beginning, possibly before the first JUMPDEST (is that true?) and after the constructor section (runtime offset is near the beginning too).

At minimum this would be much more efficient at getting the initial jump table without the JUMPDEST verification.