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

Function names are not recovered from bytecode for solidity 0.5.4 #47

Open
wTendera opened this issue Mar 15, 2019 · 2 comments
Open

Function names are not recovered from bytecode for solidity 0.5.4 #47

wTendera opened this issue Mar 15, 2019 · 2 comments

Comments

@wTendera
Copy link

As in issue title I could not recover the function names of smart contracts written in Solidity 0.5.4
First I tried with my own complex smart contracts, but in all cases only one 'function' - 0x40 was recognised even if smart contract had multiple functions.

I went for a simpler contract

contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public view returns (uint) {
    return value;
  }
  uint value;
}

Bytecode:

608060405234801561001057600080fd5b5060da8061001f6000396000f3fe6080604052348015600f57600080fd5b5060043610604f576000357c01000000000000000000000000000000000000000000000000000000009004806360fe47b11460545780636d4ce63c14607f575b600080fd5b607d60048036036020811015606857600080fd5b8101908080359060200190929190505050609b565b005b608560a5565b6040518082815260200191505060405180910390f35b8060008190555050565b6000805490509056fea165627a7a72305820f8a3447634c2d8fdcd7d04231ce39c3b2399b50b0f60889ca4c53d57fb0cf2b40029

And the result was the same - functions set and get were not recognised.

Screenshot 2019-03-15 at 14 58 44
Screenshot 2019-03-15 at 14 58 36

I'm operating on OSX version of binary ninja.

@montyly
Copy link
Member

montyly commented Mar 19, 2019

Thank you for reporting the issue! We are going to look at it

@joshwatson
Copy link
Contributor

First issue is that you are providing the constructor to Ethersplay, so that's what you're seeing as the function named 0x40. Per the README, you should run solc --bin-runtime file.sol to output just the runtime bytecode if that's what you want to look at in Ethersplay.

The second issue is actually an issue with evm_cfg_builder, which Ethersplay gets its CFG info from, so we should probably open a ticket on that repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants