feature: show all exports on DLLs

This commit is contained in:
Dobin
2024-04-13 10:28:05 +01:00
parent a95203e2b5
commit f40d527783
2 changed files with 16 additions and 5 deletions
+13 -2
View File
@@ -48,7 +48,7 @@ class SuperPe():
self.ptrSize = 8
def is_dll(self):
def is_dll(self) -> bool:
return self.filepath.endswith(".dll")
@@ -57,7 +57,6 @@ class SuperPe():
def is_dotnet(self) -> bool:
# DotNet or not
# https://stackoverflow.com/questions/45574925/is-there-a-way-to-check-if-an-exe-is-dot-net-with-python-pefile
entry = self.pe.OPTIONAL_HEADER.DATA_DIRECTORY[14]
if entry.VirtualAddress != 0 and entry.Size != 0:
@@ -235,6 +234,18 @@ class SuperPe():
i += 1
def get_exports(self) -> List[str]:
"""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)
if self.pe.DIRECTORY_ENTRY_EXPORT.symbols == 0:
return []
res = []
for e in self.pe.DIRECTORY_ENTRY_EXPORT.symbols:
res.append(e.name.decode())
return res
## Helpers
def get_entrypoint(self) -> int: