mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
refactor: make address type more clear
This commit is contained in:
+3
-3
@@ -124,15 +124,15 @@ class ExeHost():
|
|||||||
self.iat[dll_name].append({
|
self.iat[dll_name].append({
|
||||||
"dll_name": dll_name,
|
"dll_name": dll_name,
|
||||||
"func_name": imp_name,
|
"func_name": imp_name,
|
||||||
"func_addr": imp_addr
|
"iat_vaddr": imp_addr
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def get_addr_of_iat_function(self, func_name: str) -> int:
|
def get_vaddr_of_iatentry(self, func_name: str) -> int:
|
||||||
for dll_name in self.iat:
|
for dll_name in self.iat:
|
||||||
for entry in self.iat[dll_name]:
|
for entry in self.iat[dll_name]:
|
||||||
if entry["func_name"] == func_name:
|
if entry["func_name"] == func_name:
|
||||||
return entry["func_addr"]
|
return entry["iat_vaddr"]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ def injected_fix_iat(exe_out: FilePath, carrier: Carrier, exe_host: ExeHost):
|
|||||||
for iatRequest in carrier.get_all_iat_requests():
|
for iatRequest in carrier.get_all_iat_requests():
|
||||||
if not iatRequest.placeholder in code:
|
if not iatRequest.placeholder in code:
|
||||||
raise Exception("IatResolve ID {} not found, abort".format(iatRequest.placeholder))
|
raise Exception("IatResolve ID {} not found, abort".format(iatRequest.placeholder))
|
||||||
destination_virtual_address = exe_host.get_addr_of_iat_function(iatRequest.name)
|
destination_virtual_address = exe_host.get_vaddr_of_iatentry(iatRequest.name)
|
||||||
if destination_virtual_address == None:
|
if destination_virtual_address == None:
|
||||||
raise Exception("IatResolve: Function {} not found".format(iatRequest.name))
|
raise Exception("IatResolve: Function {} not found".format(iatRequest.name))
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -303,7 +303,7 @@ def start(settings: Settings):
|
|||||||
def exehost_has_all_carrier_functions(carrier: Carrier, exe_host: ExeHost):
|
def exehost_has_all_carrier_functions(carrier: Carrier, exe_host: ExeHost):
|
||||||
is_ok = True
|
is_ok = True
|
||||||
for iat_entry in carrier.iat_requests:
|
for iat_entry in carrier.iat_requests:
|
||||||
addr = exe_host.get_addr_of_iat_function(iat_entry.name)
|
addr = exe_host.get_vaddr_of_iatentry(iat_entry.name)
|
||||||
if addr == 0:
|
if addr == 0:
|
||||||
logging.info("---( Function not available as import: {}".format(iat_entry.name))
|
logging.info("---( Function not available as import: {}".format(iat_entry.name))
|
||||||
is_ok = False
|
is_ok = False
|
||||||
|
|||||||
Reference in New Issue
Block a user