Hi!
I've been looking for a disassembler with a call graph view, for analysing EVM (Ethereum VM) contracts.
I see there's some initial implementation here, but it looks like it's fairly outdated.
I'm more than happy to try and bring it up to date, if you are interested.
-
I saw some issue about the internal data structures of capstone only supporting 16 byte instructions, where EVM has a PUSH32 which is a byte for the instruction itself and then 32 data bytes. Is this still a blocker? Or can the instruction be parsed as one and the data as another?
-
Is it possible to implement "dynamic linking"? Ethereum has instructions for calling out to other contracts dynamically through the CALL, DELEGATECALL and STATICCALL instructions. It also supports "creating" new programs through CREATE and CREATE2 instructions.
-
Furthermore it has some "magic" instructions, which I guess are kinda I/O, for interacting with "remote" data such as BLOCKHASH, NUMBER, EXTCODEHASH etc.
-
While not explicitly marked, the IR for the solidity compiler also splits code into 3 sections, "constructor" code, "runtime" code and "data", which all loose their semantic labels once compiled, but can approximately be inferred. I'm not sure if this can be handled?
-
Finally there's one thing I'm a bit unsure of how to handle here. EVM has an instruction assigned as INVALID and a whole lot of instructions that don't mean anything yet as they're unassigned.
Hi!
I've been looking for a disassembler with a call graph view, for analysing EVM (Ethereum VM) contracts.
I see there's some initial implementation here, but it looks like it's fairly outdated.
I'm more than happy to try and bring it up to date, if you are interested.
I saw some issue about the internal data structures of capstone only supporting 16 byte instructions, where EVM has a
PUSH32which is a byte for the instruction itself and then 32 data bytes. Is this still a blocker? Or can the instruction be parsed as one and the data as another?Is it possible to implement "dynamic linking"? Ethereum has instructions for calling out to other contracts dynamically through the
CALL,DELEGATECALLandSTATICCALLinstructions. It also supports "creating" new programs throughCREATEandCREATE2instructions.Furthermore it has some "magic" instructions, which I guess are kinda I/O, for interacting with "remote" data such as
BLOCKHASH,NUMBER,EXTCODEHASHetc.While not explicitly marked, the IR for the solidity compiler also splits code into 3 sections, "constructor" code, "runtime" code and "data", which all loose their semantic labels once compiled, but can approximately be inferred. I'm not sure if this can be handled?
Finally there's one thing I'm a bit unsure of how to handle here. EVM has an instruction assigned as
INVALIDand a whole lot of instructions that don't mean anything yet as they're unassigned.