rename decode methods as well, keep this working for ruby X.X
parent
7a1a5d2658
commit
33e134418a
|
@ -109,20 +109,20 @@ class String
|
||||||
|
|
||||||
# decodes the current string as a Shellcode, with specified base address
|
# decodes the current string as a Shellcode, with specified base address
|
||||||
# returns the resulting Disassembler
|
# returns the resulting Disassembler
|
||||||
def decode_blocks(base_addr=0, eip=base_addr)
|
def metasm_decode_blocks(base_addr=0, eip=base_addr)
|
||||||
sc = Metasm::Shellcode.decode(self, @@cpu)
|
sc = Metasm::Shellcode.metasm_decode(self, @@cpu)
|
||||||
sc.base_addr = base_addr
|
sc.base_addr = base_addr
|
||||||
sc.disassemble(eip)
|
sc.metasm_disassemble(eip)
|
||||||
end
|
end
|
||||||
|
|
||||||
# decodes the current string as a Shellcode, with specified base address
|
# decodes the current string as a Shellcode, with specified base address
|
||||||
# returns the asm source equivallent
|
# returns the asm source equivallent
|
||||||
def decode(base_addr=0, eip=base_addr)
|
def metasm_decode(base_addr=0, eip=base_addr)
|
||||||
decode_blocks(base_addr, eip).to_s
|
metasm_decode_blocks(base_addr, eip).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def disassemble(str, eip=0)
|
def metasm_disassemble(str, eip=0)
|
||||||
Metasm::Shellcode.disassemble(@@cpu, str, eip)
|
Metasm::Shellcode.metasm_disassemble(@@cpu, str, eip)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -149,7 +149,7 @@ def parse_gas_file(filename)
|
||||||
begin
|
begin
|
||||||
encoded = shellcode.metasm_encode
|
encoded = shellcode.metasm_encode
|
||||||
puts Rex::Text.to_ruby(encoded)
|
puts Rex::Text.to_ruby(encoded)
|
||||||
puts encoded.disassemble(shellcode.metasm_encode)
|
puts encoded.metasm_disassemble(shellcode.metasm_encode)
|
||||||
rescue Metasm::Exception => e
|
rescue Metasm::Exception => e
|
||||||
puts "Error: #{e.class} #{e.message}"
|
puts "Error: #{e.class} #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue