franck44 / evm-dis

An EVM bytecode disassembler/assembler
Apache License 2.0
29 stars 6 forks source link

Add addresses of instructions. #1

Closed franck44 closed 10 months ago

franck44 commented 10 months ago

At the moment we only generate the sequence of instructions like so:

PUSH1 0x0a
PUSH1 0x08
PUSH1 0x03
SWAP1
PUSH1 0x0f
JUMP

There are references to address in the code (e.g. 0x0f is a target of a JUMP) and to identify the target we need to generate the addresses the instructions are stored at. Ideally we would like to get something like:

00000000: PUSH1 0x0a
00000002: PUSH1 0x08
00000004: PUSH1 0x03
00000006: SWAP1
00000007: PUSH1 0x0f
00000009: JUMP