crytic / rattle

evm binary static analysis
https://www.trailofbits.com/presentations/rattle/
344 stars 41 forks source link

Rattle is now compatible with all versions of solc #22

Closed nveloso closed 4 years ago

nveloso commented 4 years ago

Try to make rattle compatible with all versions of solc and update the list of signatures.

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.

withzombies commented 4 years ago

Hey, thanks for the PR. I'd like to merge it but it seems none of the example inputs work. Could you fix up the remove_metadata function so that they work?

(venv) ~/src/rattle(solc*) » python3 rattle-cli.py --input inputs/kingofether/KingOfTheEtherThrone.bin -O
Traceback (most recent call last):
  File "rattle-cli.py", line 202, in <module>
    main()
  File "rattle-cli.py", line 50, in main
    split_functions=args.no_split_functions)
  File "/Users/ryan/src/rattle/rattle/recover.py", line 751, in __init__
    self.internal = InternalRecover(filedata, edges, optimize, split_functions)
  File "/Users/ryan/src/rattle/rattle/recover.py", line 24, in __init__
    self.filedata = self.remove_metadata(filedata)
  File "/Users/ryan/src/rattle/rattle/recover.py", line 65, in remove_metadata
    bytecode = bytecode.decode().rstrip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 1: invalid start byte
nveloso commented 4 years ago

Hi. I forgot to update the example inputs. I remove the extra step of converting the result of solc --bin-runtime to bytes. That's why you got the error.

withzombies commented 4 years ago

Thanks!