From 4fb7b9f88e93963b0e24aee9fb5ad78c071432ce Mon Sep 17 00:00:00 2001 From: Dobin Date: Sun, 14 Apr 2024 18:19:31 +0100 Subject: [PATCH] refactor: remove DataRefStyle --- model/defs.py | 4 ---- model/settings.py | 1 - pe/superpe.py | 2 +- supermega.py | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/model/defs.py b/model/defs.py index 9b53df6..3b72049 100644 --- a/model/defs.py +++ b/model/defs.py @@ -29,10 +29,6 @@ class DecoderStyle(Enum): XOR_1 = "xor_1" -class DataRefStyle(Enum): - APPEND = 1 - - class CarrierInvokeStyle(Enum): ChangeEntryPoint = "change AddressOfEntryPoint" BackdoorCallInstr = "hijack branching instruction in entrypoint" diff --git a/model/settings.py b/model/settings.py index 443122b..5b628aa 100644 --- a/model/settings.py +++ b/model/settings.py @@ -11,7 +11,6 @@ class Settings(): # Settings self.source_style: FunctionInvokeStyle = FunctionInvokeStyle.peb_walk self.decoder_style: DecoderStyle = DecoderStyle.XOR_1 - self.dataref_style: DataRefStyle = DataRefStyle.APPEND self.short_call_patching: bool = False self.dllfunc: str = "" # For DLL injection diff --git a/pe/superpe.py b/pe/superpe.py index 4f617d0..29b1af7 100644 --- a/pe/superpe.py +++ b/pe/superpe.py @@ -225,7 +225,7 @@ class SuperPe(): return res - def get_exports_full(self): + def get_exports_full(self) -> List[Dict]: """Return a list of exported functions (names) from the PE file""" d = [pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_EXPORT"]] self.pe.parse_data_directories(directories=d) diff --git a/supermega.py b/supermega.py index c6ffe8e..86b5809 100644 --- a/supermega.py +++ b/supermega.py @@ -160,7 +160,7 @@ def start_real(settings: Settings): shellcode_out = settings.main_shc_path) # Merge: shellcode/loader with payload (SHC + PAYLOAD -> SHC) - if settings.dataref_style == DataRefStyle.APPEND: + if True: phases.assembler.merge_loader_payload( shellcode_in = settings.main_shc_path, shellcode_out = settings.main_shc_path,