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

Porosity wont read from my input #43

Open
samholmes opened this issue Dec 1, 2017 · 2 comments
Open

Porosity wont read from my input #43

samholmes opened this issue Dec 1, 2017 · 2 comments

Comments

@samholmes
Copy link

Looks like no matter if I use the --code or --code-file arguments, it always outputs the same output:

ϟ porosity --code-file code --debug
Porosity v0.1 (https://www.comae.io)
Matt Suiche, Comae Technologies <[email protected]>
The Ethereum bytecode commandline decompiler.
Decompiles the given Ethereum input bytecode and outputs the Solidity code.

Attempting to parse ABI definition...
Success.
function mint(address,uint256) {
      if (msg.sender == store_0) {
         store[arg_4] = arg_24 + store[arg_4];
      }
      return;
}


LOC: 6
function send(address,uint256) {
      if (store[msg.sender] >= arg_24) {
         store[msg.sender] = store[msg.sender] - arg_24;
         store[arg_4] = arg_24 + store[arg_4];
      }
      return;
}


LOC: 7
function balances(address) {
      return store[memory[0x20]];
}


LOC: 3
function minter() {
      store_0 = 0x10000000000000000000000000000000000000000 - 0x1;
      return store_0;
}


LOC: 4
Attempting to parse ABI definition...
Success.
function double(uint256) {
      memory[0x60] = 0x2 * arg_4;
      return memory[0x60];
}


LOC: 4
------------
function triple(uint256) {
      memory[0x60] = 0x3 * arg_4;
      return memory[0x60];
}


LOC: 4
After execution.
digraph porosity {
rankdir = TB;
size = "12"
graph[fontname = Courier, fontsize = 10.0, labeljust = l, nojustify = true];node[shape = record];
    "0x00000000"[label = "loc_0x00000000"];
    "0x00000000" -> "0x00000018" [color="red"];
    "0x00000000" -> "0x00000024" [color="green"];
    "0x00000018"[label = "loc_0x00000018"];
    "0x00000018" -> "0x00000022" [color="red"];
    "0x00000018" -> "0x00000035" [color="green"];
    "0x00000022"[label = "loc_0x00000022"];
    "0x00000024"[label = "double(uint256)"];
    "0x00000024" -> "0x00000031" [color="black"];
    "0x00000031"[label = "loc_0x00000031"];
    "0x00000031" -> "0x0000004f" [color="black"];
    "0x00000035"[label = "triple(uint256)"];
    "0x00000035" -> "0x00000031" [color="black"];
    "0x00000045"[label = "loc_0x00000045"];
    "0x0000004f"[label = "loc_0x0000004f"];
    "0x0000004f" -> "0x00000045" [color="black"];
}

Attempting to parse ABI definition...
Success.
function withdrawBalance() {
      if (msg.sender.call.gas(1410031344).value()()) {
         store[msg.sender] = 0x0;
      }
}


L3 (D8193): Potential reentrant vulnerability found.

LOC: 5
function getBalance(address) {
      return store[arg_4];
}


LOC: 3
function addToBalance() {
      store[msg.sender] = store[msg.sender] + msg.value;
      return;
}


LOC: 4

I even did chmod 000 code on my code file in order to test if it's even reading from my file, and nothing changes.

I'm on MacOS.

@ming08108
Copy link

Don't use the debug flag.

@samholmes
Copy link
Author

So when I try porosity --code $code --decompile it just hangs. How long do I wait in order to get the results?

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