meyer9 / ethdasm Goto Github PK
View Code? Open in Web Editor NEWTool for auditing Ethereum contracts
Tool for auditing Ethereum contracts
Bytecode to reproduce:
600160025b5b01
Disassembled bytecode:
; Procedure 0x0
[ 0x0] | PUSH1 | [1]
[ 0x2] | PUSH1 | [2]
; Procedure 0x4
[ 0x4] | JUMPDEST | None
; Procedure 0x5
[ 0x5] | JUMPDEST | None
[ 0x6] | ADD | None
Error:
Traceback (most recent call last):
File "ethdasm.py", line 18, in <module>
blocks = contract.parse()
File "/Users/jmeyer2k/development/ethdasm/ethdasm/contract.py", line 328, in parse
self.__add_final_functions()
File "/Users/jmeyer2k/development/ethdasm/ethdasm/contract.py", line 272, in __add_final_functions
arguments.append(block.return_vals[i])
IndexError: list index out of range
The problem here is that the ending function for the second block actually requires arguments to be passed through. It might need to add arguments to the previous function if the next function requires more values than the block puts on the stack.
Also, a problem arises when now we need to update the previous block to take in a certain number of parameters.
This bug will require some serious thinking.
Should use integers until printing the values where it should convert the values to hex.
I tried to run the disassembler, and got the following error.
[16:20] yh@sri: ~/src/ethdasm$ python --version
Python 2.7.13
[16:20] yh@sri: ~/src/ethdasm$ cat test.hex
0x60606040
[16:20] yh@sri: ~/src/ethdasm$ python ethdasm.py test.hex
Traceback (most recent call last):
File "ethdasm.py", line 2, in <module>
from contract import Contract
File "/home/yh/src/ethdasm/contract.py", line 28
address: int
^
SyntaxError: invalid syntax
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.