I have read this paper, Erays: Reverse Engineering Ethereum's Opaque Smart Contracts. They proposed this reverse engineering tool for Ethereum smart contracts. it will take as input a compiled EVM smart contract without modification from the blockchain, and returns high level pseudocoded suitable for manual analysis. What really is the use of this Erays? what drawback it has?

  • 1
    "What really is the use of this Erays?": Reading Solidity is far easier than reading compiled bytecode... :-) – Richard Horrocks Feb 21 '19 at 18:36

It has the same benefits as any reverse-engineering tool: you get to see what the code does. If you have a bunch of bytecode it's impossible to see what it does. So, if you don't have the actual source code but want to know what the code does, the only thing you can do is (try to) reverse-engineer it.

As compilers typically optimize code to make it smaller (or at least rearrange and perform some transformations) before the actual compiling the actual source code you can get from reverse-engineering is far from the original source code. But it gives the same results with the same inputs so it's programmatically equivalent.

So basically the use of reverse-engineering is to find out what the code does and its drawbacks are the difficult source code it provides. It won't be easy to read or try to figure out what the resulting source code does but it's possible.

  • The compiling phase can be modeled as a sort of one-way deterministic hash: it is practically impossible to go trough it back... and to find out the very original code starting from the bytecode!! But every time you compile the same code in the same environment you obtain the same bytecode. Don’t resemble any sha256 routine? 😜 – Rick Park Feb 21 '19 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.