Mitigate metasm relocation error by disabling ASLR
Deal with import error by actually using the GetProcAddress code.bug/bundler_fix
parent
8d33138489
commit
77e9996501
|
@ -37,7 +37,6 @@ module Exe
|
||||||
push hook_funcname
|
push hook_funcname
|
||||||
push eax
|
push eax
|
||||||
call [iat_GetProcAddress]
|
call [iat_GetProcAddress]
|
||||||
mov eax, [iat_CreateThread]
|
|
||||||
lea edx, [thread_hook]
|
lea edx, [thread_hook]
|
||||||
push 0
|
push 0
|
||||||
push 0
|
push 0
|
||||||
|
@ -85,6 +84,9 @@ module Exe
|
||||||
pe.mz.encoded.export = pe_orig.encoded[0, 512].export.dup
|
pe.mz.encoded.export = pe_orig.encoded[0, 512].export.dup
|
||||||
pe.header.time = pe_orig.header.time
|
pe.header.time = pe_orig.header.time
|
||||||
|
|
||||||
|
# Don't rebase if we can help it since Metasm doesn't do relocations well
|
||||||
|
pe.optheader.dll_characts.delete("DYNAMIC_BASE")
|
||||||
|
|
||||||
prefix = ''
|
prefix = ''
|
||||||
if pe.header.characteristics.include? "DLL"
|
if pe.header.characteristics.include? "DLL"
|
||||||
# if there is no entry point, just return after we bail or spawn shellcode
|
# if there is no entry point, just return after we bail or spawn shellcode
|
||||||
|
|
Loading…
Reference in New Issue