I just can't figure out how to disassemble an .exe file using metasm. As far as I know the command should look something like:

ruby disassemble.rb [path-to-my-exe-file] > [path-to-output.asm]

But, that's not quite the thing.

  • How exactly not? An otherwise uninformed Google search suggests ruby ~/tools/metasploit/lib/metasm/samples/disassemble.rb raw_binary > asm_code.asm, which contains the full path to disassembly.rb.
    – Jongware
    Commented Apr 26, 2015 at 13:07
  • The disassemble.rb has in line 13 "require 'metasm'" and the error I get says "cannot load such file -- metasm (LoadError)" Commented Apr 26, 2015 at 13:18
  • @SiltCrawler Do you have metasm installed? That's what that error says to me; Ruby can't find it. Commented May 2, 2015 at 2:45

1 Answer 1


The solution is quite easy.

ruby disassemble.rb [path-to-my-exe-file] > [path-to-output.asm]

Is totally fine. I didn't copy metasm.rb and the metasm subfolder to the [ruby_dir]/lib/ruby/[version_number]/ directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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