From 16b7e840d71f7e7c0ee37a3eed9aa32ae61298e0 Mon Sep 17 00:00:00 2001 From: Dobin Date: Thu, 15 Feb 2024 18:19:19 +0000 Subject: [PATCH] feature: more debug arguments --- supermega.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/supermega.py b/supermega.py index 25755cc..ab368d4 100644 --- a/supermega.py +++ b/supermega.py @@ -65,8 +65,11 @@ def main(): parser = argparse.ArgumentParser(description='SuperMega shellcode loader') parser.add_argument('--shellcode', type=str, help='The path to the file of your payload shellcode') parser.add_argument('--inject', type=str, help='The path to the file where we will inject ourselves in') + parser.add_argument('--start-injected', action='store_true', help='Dev: Start the generated infected executable at the end') + parser.add_argument('--start-loader-shellcode', action='store_true', help='Dev: Start the loader shellcode (without payload)') + parser.add_argument('--start-final-shellcode', action='store_true', help='Debug: Start the final shellcode (loader + payload)') parser.add_argument('--verify', type=str, help='Debug: Perform verification: std/iat') - parser.add_argument('--show', type=str, help='Debug: Show tool output') + parser.add_argument('--show', action='store_true', help='Debug: Show tool output') args = parser.parse_args() if args.show: @@ -78,7 +81,6 @@ def main(): project.try_start_final_infected_exe = False project.try_start_final_shellcode = False - project.try_start_final_infected_exe = False if args.verify == "peb": project.source_style = SourceStyle.peb_walk @@ -103,7 +105,9 @@ def main(): logger.info("Unknown verify option {}, use std/iat".format(args.verify)) else: - project.try_start_final_infected_exe = True + project.try_start_final_infected_exe = args.start_injected + project.try_start_final_shellcode = args.start_final_shellcode + project.try_start_loader_shellcode = args.start_loader_shellcode if args.shellcode: if not os.path.isfile(args.shellcode): @@ -171,7 +175,6 @@ def start(): if project.try_start_loader_shellcode: try_start_shellcode(main_shc_file) - # Merge shellcode/loader with payload if project.dataref_style == DataRefStyle.APPEND: phases.assembler.merge_loader_payload(main_shc_file)