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

runtime bytecode ignored #5

Open
offlinemark opened this issue Dec 8, 2017 · 4 comments
Open

runtime bytecode ignored #5

offlinemark opened this issue Dec 8, 2017 · 4 comments
Projects

Comments

@offlinemark
Copy link
Contributor

It is a common use case to analyze a file that contains contract init and runtime (rt) bytecode. If you give this to ethersplay, it only analyzes the init bytecode, which is not very useful. if it is possible, ethersplay should detect runtime bytecode and disassemble it also.

at the very least, ethersplay should allow the use to click "create function here" at the location of the rt bytecode. currently, this seems broken.

here is an example bytecode file with both init and rt code

x.bytecode.zip

@offlinemark
Copy link
Contributor Author

example of "create function here" bug. it should have disassembled all the code at the bottom, but it just got 1 basic block and 1 invalid.
image

@feliam
Copy link

feliam commented Dec 8, 2017

Look out. There is only 1 function in evm. And it starts at 0. The create_func should then assert you are creating it at address zero.

Also there is no guarantee that the init bytecode will contain the runtime bytecode in the clear.
I think you need to copy what you think is the runtime bytecode and take it to a new tab.

@offlinemark
Copy link
Contributor Author

The create_func should then assert you are creating it at address zero.

i'm not sure about this. while yes, technically there is strictly 1 function, beginning at 0x0 in EVM bytecode, it would still be useful to manually disassemble at an arbitrary offset

@joshwatson
Copy link
Contributor

So looking at that particular example, the sub_1e is doing what it's supposed to do, but the jump destination is invalid. That's why you're not seeing anything more. Creating an arbitrary function should work correctly otherwise

@joshwatson joshwatson added this to To do in Ethersplay Oct 2, 2018
@joshwatson joshwatson moved this from To do to Next Up in Ethersplay Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Ethersplay
  
Next Up
Development

No branches or pull requests

3 participants