mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
refactor: cleanup, create unittest, fix get_physical_address
This commit is contained in:
@@ -51,8 +51,17 @@ class PeRelocEntry():
|
||||
self.type: str = type
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return "PeRelocEntry: rva: 0x{:X} base_rva: 0x{:X} offset: 0x{:X} type: {}".format(
|
||||
self.rva, self.base_rva, self.offset, self.type)
|
||||
|
||||
|
||||
class IatEntry():
|
||||
def __init__(self, dll_name: str, func_name: str, iat_vaddr: int):
|
||||
self.dll_name: str = dll_name
|
||||
self.func_name: str = func_name
|
||||
self.iat_vaddr: int = iat_vaddr
|
||||
|
||||
def __str__(self):
|
||||
return "IatEntry: dll_name: {} func_name: {} iat_vaddr: 0x{:X}".format(
|
||||
self.dll_name, self.func_name, self.iat_vaddr)
|
||||
@@ -29,9 +29,6 @@ class ExeHost():
|
||||
self.code_section = None
|
||||
self.rwx_section = None
|
||||
|
||||
self.ep = None
|
||||
self.ep_raw = None
|
||||
|
||||
|
||||
def init(self):
|
||||
logger.info("--[ Analyzing: {}".format(self.filepath))
|
||||
@@ -40,9 +37,6 @@ class ExeHost():
|
||||
if not self.superpe.is_64():
|
||||
raise Exception("Binary is not 64bit: {}".format(self.filepath))
|
||||
|
||||
self.ep = self.superpe.get_entrypoint()
|
||||
self.ep_raw = self.superpe.get_physical_address(self.ep)
|
||||
|
||||
# image base
|
||||
self.image_base = self.superpe.pe.OPTIONAL_HEADER.ImageBase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user