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

Incorrect decompilation for simple contract. #10

Closed
danslo opened this issue Jul 29, 2017 · 3 comments
Closed

Incorrect decompilation for simple contract. #10

danslo opened this issue Jul 29, 2017 · 3 comments

Comments

@danslo
Copy link

danslo commented Jul 29, 2017

Given something like:

contract Paying
{
    function sendIt(uint b) {
         msg.sender.send(b);
    }
}

We get the following output on a --decompile run:


Attempting to parse ABI definition...
Success.
Hash: 0xEDA04C5E
function sendIt(uint256) {
      if (!msg.value) {
      }
      return;
      return;
}


LOC: 6

I'll probably look at this myself at some point.

@danslo
Copy link
Author

danslo commented Jul 30, 2017

It seems that Contract::decompileBlock is missing quite a lot of instruction handlers. I'll stick to the assembly for now.

@msuiche
Copy link
Owner

msuiche commented Aug 2, 2017

@danslo can you please share the bytecode and the ABI ? Thanks,

@danslo
Copy link
Author

danslo commented Aug 2, 2017

I used the following command:

$ porosity --abi '[{"constant":false,"inputs":[{"name":"b","type":"uint256"}],"name":"sendIt","outputs":[],"payable":false,"type":"function"}]' --code "60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063eda04c5e14603a575bfe5b3415604157fe5b605560048080359060200190919050506057565b005b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051809050600060405180830381858888f19350505050505b505600a165627a7a72305820ef13a7f7d1ec57a59c91050c926805239aefefbe5383c28daeb4f8e7ff0da7dd0029" --decompile

@danslo danslo closed this as completed Mar 18, 2021
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

2 participants