Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last instruction does not have enough data #1

Open
0xalpharush opened this issue Nov 25, 2021 · 0 comments
Open

Last instruction does not have enough data #1

0xalpharush opened this issue Nov 25, 2021 · 0 comments

Comments

@0xalpharush
Copy link
Owner

0xalpharush commented Nov 25, 2021

After cloning the repository and changing directory into the project folder:

 python3 disassembler.py test

Output:

b'ERC20: transfer amount exceeds allowance'
7598 PUSH20 0x20616c6c6f77616e636500

There isn't 20 bytes of data left to iterate over so StopIteration is reached and prints the remaining data, and I'm not sure what's wrong.

geth's disassembler produces this, and leaves the a264 metadata? then, it has a ton of invalid instructions since it didn't discard the following bytes. py-evmasm does the same.

evm disasm test
> 01d99: PUSH20 0x20616c6c6f77616e6365a2646970667358221220

Note: this is the CBOR decoding of the data that is discarded in this example, so I believe the metadata parsing is working:

{'ipfs': b'\x12 S\x1f\xd5JK$Z\xcb\x16\xb4D*\x01\xcd\xa4\x926\x15{\x84\xea\x82\x95\xdc\x00\xbc\x8d\x88\xbc\x0c\x8a\xf0', 'solc': b'\x00\x08\x04'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant