Skip to content

Commit b9b40ed

Browse files
author
HD Moore
committed
Major speedup, especially for large shellcode (stageless)
1 parent fd45d92 commit b9b40ed

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/msf/core/exe/segment_injector.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,11 @@ def create_thread_stub
5959
EOS
6060
end
6161

62-
def payload_as_asm
63-
asm = ''
64-
@payload.each_byte do |byte|
65-
asm << "db " + sprintf("0x%02x", byte) + "\n"
66-
end
67-
return asm
68-
end
69-
7062
def payload_stub(prefix)
7163
asm = "hook_entrypoint:\n#{prefix}\n"
7264
asm << create_thread_stub
73-
asm << payload_as_asm
7465
shellcode = Metasm::Shellcode.assemble(processor, asm)
75-
shellcode.encoded
66+
shellcode.encoded + @payload
7667
end
7768

7869
def generate_pe

0 commit comments

Comments
 (0)