refactor: remove recursion from DerBackdoorer

This commit is contained in:
Dobin
2024-04-27 14:14:23 +01:00
parent a81c0c4d1a
commit aca1ed46bc
6 changed files with 99 additions and 96 deletions
+8 -2
View File
@@ -276,11 +276,17 @@ class SuperPe():
entry["size"] = next_entry["addr"] - entry["addr"]
return res
def get_size_of_exported_function(self, dllfunc):
exports = self.get_exports_full()
for exp in exports:
if exp["name"] == dllfunc:
return exp["size"]
return None
## Helpers
def get_physical_address(self, virtual_address) -> int:
def get_offset_from_rva(self, virtual_address) -> int:
"""Convert a virtual address to a physical address in the PE file"""
# Iterate through the section headers to find which section contains the VA
for section in self.pe.sections: