MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / is_exe

Method is_exe

pythonmemorymodule/pefile.py:7212–7229  ·  view source on GitHub ↗

Check whether the file is a standard executable. This will return true only if the file has the IMAGE_FILE_EXECUTABLE_IMAGE flag set and the IMAGE_FILE_DLL not set and the file does not appear to be a driver either.

(self)

Source from the content-addressed store, hash-verified

7210 return checksum + len(self.__data__)
7211
7212 def is_exe(self):
7213 """Check whether the file is a standard executable.
7214
7215 This will return true only if the file has the IMAGE_FILE_EXECUTABLE_IMAGE flag
7216 set and the IMAGE_FILE_DLL not set and the file does not appear to be a driver
7217 either.
7218 """
7219
7220 EXE_flag = IMAGE_CHARACTERISTICS["IMAGE_FILE_EXECUTABLE_IMAGE"]
7221
7222 if (
7223 (not self.is_dll())
7224 and (not self.is_driver())
7225 and (EXE_flag & self.FILE_HEADER.Characteristics) == EXE_flag
7226 ):
7227 return True
7228
7229 return False
7230
7231 def is_dll(self):
7232 """Check whether the file is a standard DLL.

Callers 2

execPEMethod · 0.80
load_moduleMethod · 0.80

Calls 2

is_dllMethod · 0.95
is_driverMethod · 0.95

Tested by

no test coverage detected