diff --git a/app/templates/project.html b/app/templates/project.html index e826ea3..2c47ea9 100644 --- a/app/templates/project.html +++ b/app/templates/project.html @@ -74,7 +74,11 @@ > {{exe}} {% endfor %} + + + Is x64: {{ is_64}}
+ Is Dotnet: {{ is_dotnet}} diff --git a/app/views_project.py b/app/views_project.py index 2e98155..5113cbf 100644 --- a/app/views_project.py +++ b/app/views_project.py @@ -20,6 +20,7 @@ from sender import scannerDetectsBytes from phases.injector import verify_injected_exe from helper import run_process_checkret from model.project import prepare_project +from pe.superpe import SuperPe logger = logging.getLogger("ViewsProjects") @@ -47,9 +48,11 @@ def project(name): if os.path.exists(exe_path): is_built = True + superpe = SuperPe(project.settings.inject_exe_in) + is_64 = superpe.is_64() + is_dotnet = superpe.is_dotnet() + project_dir = os.path.dirname(os.path.abspath(project.settings.inject_exe_out)) - - log_files = get_logfiles(project.settings.main_dir) exes = [] @@ -83,6 +86,8 @@ def project(name): injectstyles=injectstyles, log_files=log_files, + is_64=is_64, + is_dotnet=is_dotnet, ) diff --git a/pe/superpe.py b/pe/superpe.py index dcc65b6..fe5ca4f 100644 --- a/pe/superpe.py +++ b/pe/superpe.py @@ -45,6 +45,19 @@ class SuperPe(): self.arch = self.getFileArch() if self.arch == 'x64': self.ptrSize = 8 + + + def is_64(self) -> bool: + return self.arch == 'x64' + + + 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: + return True + return False def get_physical_address(self, virtual_address):