rename decode methods as well, keep this working for ruby X.X

bug/bundler_fix
Brent Cook 2017-08-17 03:27:12 -04:00
parent 7a1a5d2658
commit 33e134418a
1 changed files with 8 additions and 8 deletions

View File

@ -109,20 +109,20 @@ class String
# decodes the current string as a Shellcode, with specified base address
# returns the resulting Disassembler
def decode_blocks(base_addr=0, eip=base_addr)
sc = Metasm::Shellcode.decode(self, @@cpu)
def metasm_decode_blocks(base_addr=0, eip=base_addr)
sc = Metasm::Shellcode.metasm_decode(self, @@cpu)
sc.base_addr = base_addr
sc.disassemble(eip)
sc.metasm_disassemble(eip)
end
# decodes the current string as a Shellcode, with specified base address
# returns the asm source equivallent
def decode(base_addr=0, eip=base_addr)
decode_blocks(base_addr, eip).to_s
def metasm_decode(base_addr=0, eip=base_addr)
metasm_decode_blocks(base_addr, eip).to_s
end
def disassemble(str, eip=0)
Metasm::Shellcode.disassemble(@@cpu, str, eip)
def metasm_disassemble(str, eip=0)
Metasm::Shellcode.metasm_disassemble(@@cpu, str, eip)
end
end
@ -149,7 +149,7 @@ def parse_gas_file(filename)
begin
encoded = shellcode.metasm_encode
puts Rex::Text.to_ruby(encoded)
puts encoded.disassemble(shellcode.metasm_encode)
puts encoded.metasm_disassemble(shellcode.metasm_encode)
rescue Metasm::Exception => e
puts "Error: #{e.class} #{e.message}"
end