fix: tester.py, and add testcases for DLL

This commit is contained in:
Dobin
2024-04-13 12:23:36 +01:00
parent b9d3a5a97e
commit 368b14934d
4 changed files with 93 additions and 15 deletions
+6 -7
View File
@@ -79,8 +79,9 @@ def inject_exe(
logger.info("---( Rewire: DLL function: {} ".format(settings.dllfunc))
if carrier_invoke_style == CarrierInvokeStyle.ChangeEntryPoint:
raise Exception("--( Inject DLL: Change Entry Point unsupported when set ".format(
settings.dllfunc))
#raise Exception("--( Inject DLL: Change Entry Point unsupported when set ".format(
# settings.dllfunc))
pass
elif carrier_invoke_style == CarrierInvokeStyle.BackdoorCallInstr:
addr = pe_backdoorer.getExportEntryPoint(settings.dllfunc)
@@ -103,11 +104,9 @@ def inject_exe(
addr))
pe_backdoorer.backdoor_function(addr, shellcode_rva)
if False:
if source_style == FunctionInvokeStyle.iat_reuse:
injected_fix_iat(superpe, project.carrier, project.exe_host)
if True:
injected_fix_data(superpe, project.carrier, project.exe_host)
if source_style == FunctionInvokeStyle.iat_reuse:
injected_fix_iat(superpe, project.carrier, project.exe_host)
injected_fix_data(superpe, project.carrier, project.exe_host)
# We done
superpe.write_pe_to_file(exe_out)