feature: datareuse now supports multiple references -> fix change_ carriers

This commit is contained in:
Dobin Rutishauser
2024-06-22 12:59:21 +02:00
parent ae3567847c
commit de77f50f06
7 changed files with 156 additions and 191 deletions
+17 -8
View File
@@ -15,14 +15,24 @@ class IatRequest():
self.placeholder: bytes = placeholder # Random bytes as placeholder
class DataReuseEntry():
def __init__(self, string_ref: str):
self.string_ref: str = string_ref # "$SG72513"
class DataReuseReference():
def __init__(self, randbytes: bytes, register: str):
self.randbytes: bytes = randbytes
self.register: str = register
self.register: str = "" # "rcx"
self.randbytes: bytes = b"" # placeholder
self.data: bytes = b''
self.addr: int = 0
class DataReuseEntry():
def __init__(self, string_ref: str, in_code: bool = False):
self.string_ref: str = string_ref # "$SG72513"
self.data: bytes = b'' # the content/data
self.addr: int = 0 # where content/data is stored
self.in_code: bool = in_code # is the data in code section
self.references: List[DataReuseReference] = []
def add_reference(self, randbytes, register):
self.references.append(DataReuseReference(randbytes, register))
class Carrier():
@@ -32,7 +42,6 @@ class Carrier():
self.exe_filepath: str = exe_file
self.superpe: SuperPe = None
def init(self):
self.superpe = SuperPe(self.exe_filepath)