Closed nveloso closed 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
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.
Thanks!
Try to make rattle compatible with all versions of solc and update the list of signatures.