Method: Rex::Assembly::Nasm.disassemble
- Defined in:
- lib/rex/assembly/nasm.rb
.disassemble(raw, bits = 32) ⇒ Object
Disassembles the supplied raw opcodes
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/rex/assembly/nasm.rb', line 73 def self.disassemble(raw, bits=32) check tmp = Tempfile.new('nasmout') tmp.binmode tfd = File.open(tmp.path, "wb") tfd.write(raw) tfd.flush() tfd.close p = ::IO.popen("\"#{@@ndisasm_path}\" -b #{bits} \"#{tmp.path}\"") o = '' begin until p.eof? o += p.read end ensure p.close end tmp.close(true) o end |