refactor: make inject mode configurable

This commit is contained in:
Dobin
2024-02-08 10:55:14 +00:00
parent 75c329c152
commit 865cfb5247
3 changed files with 14 additions and 4 deletions
+11 -2
View File
@@ -35,6 +35,12 @@ options_default = {
"copy_style": CopyStyle.SIMPLE,
"dataref_style": DataRefStyle.APPEND,
# injecting into exe
"inject_exe": True,
"inject_mode": "1,1",
"inject_exe_in": "exes/procexp64.exe",
"inject_exe_out": "out/procexp64-a.exe",
"try_start_loader_shellcode": False, # without payload (Debugging)
"try_start_final_shellcode": False, # with payload (should work)
"try_start_final_infected_exe": True, # with payload (should work)
@@ -75,6 +81,7 @@ options_verify = {
# injecting into exe
"inject_exe": True,
"inject_mode": "1,1",
"inject_exe_in": "exes/procexp64.exe",
"inject_exe_out": "out/procexp64-a.exe",
@@ -84,13 +91,15 @@ options_verify = {
# cleanup
"cleanup_files_on_start": True,
"cleanup_files_on_exit": False, # all is just in out/
"cleanup_files_on_exit": True, # all is just in out/
# doesnt work
"obfuscate_shc_loader": False,
"test_obfuscated_shc": False,
}
options = None
main_c_file = os.path.join(build_dir, "main.c")
@@ -201,7 +210,7 @@ def main():
if options["inject_exe"]:
debug_data["original_exe"] = file_readall_binary(options["inject_exe_in"])
inject_exe(main_shc_file, options["inject_exe_in"], options["inject_exe_out"])
inject_exe(main_shc_file, options["inject_exe_in"], options["inject_exe_out"], options["inject_mode"])
if options["verify"]:
print("--[ Verify final exe ]")
if verify_injected_exe(options["inject_exe_out"]):