Major speedup, especially for large shellcode (stageless)
parent
fd45d92cb7
commit
b9b40edde9
|
@ -59,20 +59,11 @@ module Exe
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def payload_as_asm
|
|
||||||
asm = ''
|
|
||||||
@payload.each_byte do |byte|
|
|
||||||
asm << "db " + sprintf("0x%02x", byte) + "\n"
|
|
||||||
end
|
|
||||||
return asm
|
|
||||||
end
|
|
||||||
|
|
||||||
def payload_stub(prefix)
|
def payload_stub(prefix)
|
||||||
asm = "hook_entrypoint:\n#{prefix}\n"
|
asm = "hook_entrypoint:\n#{prefix}\n"
|
||||||
asm << create_thread_stub
|
asm << create_thread_stub
|
||||||
asm << payload_as_asm
|
|
||||||
shellcode = Metasm::Shellcode.assemble(processor, asm)
|
shellcode = Metasm::Shellcode.assemble(processor, asm)
|
||||||
shellcode.encoded
|
shellcode.encoded + @payload
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_pe
|
def generate_pe
|
||||||
|
|
Loading…
Reference in New Issue