Change the way disassemble works so it works on FreeBSD.

It did not work previously because FreeBSD does not support echo -ne


git-svn-id: file:///home/svn/incoming/trunk@3285 4d416f70-5f16-0410-b530-b9f4589650da
unstable
vlad902 2005-12-30 21:15:32 +00:00
parent e9b4f0d9f1
commit f3252ec6f8
1 changed files with 3 additions and 1 deletions

View File

@ -63,9 +63,11 @@ class Nasm
def self.disassemble(raw)
check
# Race condition?! You bet!
tmp = Tempfile.new('nasmout').path
File.open(tmp, "wb") { |f| f.write(raw) }
p = ::IO.popen("echo -ne \"" + Rex::Text.to_hex(raw) + "\" > #{tmp} && ndisasm -u #{tmp}")
p = ::IO.popen("ndisasm -u #{tmp}")
o = ''
begin