The geth disassembler seems like a really nice tool, if it can do stuff like this:

To disassemble, run echo 6005600401 | disasm, which produces:

0      PUSH1  => 05
2      PUSH1  => 04
4      ADD

However I couldn't find it, tried the solution here, and ran into this error:

enter image description here

How can we install the dev tools such as disasm?

  • 1
    Not the same but I've found this helpful github.com/Arachnid/evmdis. – Ismael Sep 18 '17 at 14:36
  • Yes, what @Ismael suggests may well be easier than what I've put in my (updated) answer. The official documentation looks a bit sketchy with regards to what's happened with the tools package... – Richard Horrocks Sep 18 '17 at 15:11

You need the "Geth & Tools 1.7.0" package from the official Downloads page. You should be able to just unzip the package and run the binaries directly.

However, it should be noted that the disasm tool no longer exists by itself - it was integrated with the main evm tool in commit #3729. Meaning you'll have to run the evm tool and pass the disasm flag as an argument.

The other option is to compile the tool yourself using the disasm.go file, and whatever other Go packages are required. This is the approach used in the previous answer you've linked to, but you'll need to understand how to pull everything together for the compilation. The main file has changed locations to the following:

  • so I found it in /Users/s.matthew.english/go/src/github.com/ethereum/go-ethereum/cmd/evm/disasm.go, but when I ran the command ./disasm.go, I got the error zsh: permission denied: ./disasm.go and then sudo: ./disasm.go: command not found – smatthewenglish Sep 18 '17 at 14:30
  • Hi there. That's just the Go source file - you'd need to compile it to get it to work. (That's what the user in the other question seems to have done.) I've had more of a poke around, and found that the disasm tool no longer exists as a standalone tool like it did before. I've updated my answer... – Richard Horrocks Sep 18 '17 at 15:09

It's been subsumed by the evm tool, but you can call it like this (for example):

echo "6005600401" >> tst && evm disasm tst   
000000: PUSH1 0x05
000002: PUSH1 0x04
000004: ADD

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.