From 6603fd3df7da2c801b6bd936108e7815352e0e98 Mon Sep 17 00:00:00 2001 From: Dobin Date: Sat, 20 Jul 2024 23:04:13 +0100 Subject: [PATCH] fix: bug --- config.py | 3 ++- supermega.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index ed5cb20..7d3b30a 100644 --- a/config.py +++ b/config.py @@ -13,7 +13,8 @@ class Config(object): self.data = {} self.ShowCommandOutput: bool = False self.debug: bool = False - self.has_r2: bool = True + self.has_r2: bool = False + self.catch_exception: bool = True self.data_fixups = None self.data_fixup_entries = None diff --git a/supermega.py b/supermega.py index 4e962e9..c1a2a1b 100644 --- a/supermega.py +++ b/supermega.py @@ -109,7 +109,7 @@ def start(settings: Settings) -> int: prepare_project(settings.project_name, settings) # Do the thing and catch the errors - if False: + if config.catch_exception: start_real(settings) else: try: @@ -176,7 +176,10 @@ def start_real(settings: Settings): # PREPARE DataReuseEntry for usage in Compiler/AsmTextParser # So the carrier is able to find the payload - project.injectable.add_datareuse_fixup(DataReuseEntry("supermega_payload", in_code=True)) + if project.settings.payload_location == PayloadLocation.CODE: + project.injectable.add_datareuse_fixup(DataReuseEntry("supermega_payload", in_code=True)) + else: + project.injectable.add_datareuse_fixup(DataReuseEntry("supermega_payload", in_code=False)) entry = project.injectable.get_reusedata_fixup("supermega_payload") entry.data = phases.assembler.encode_payload( project.payload.payload_data, settings.decoder_style) # encrypt