18 ModuleData(HANDLE _processHandle, HMODULE _module,
bool _isPEBConnected,
bool _useCache,
const char* _moduleName =
nullptr)
29 const size_t nameLen = strnlen(_moduleName,
MAX_PATH);
30 memcpy(this->
szModName, _moduleName, nameLen);
50 ULONGLONG
rvaToVa(DWORD rva, ULONGLONG module_base = 0)
52 if (module_base == 0) {
53 module_base =
reinterpret_cast<ULONGLONG
>(this->
moduleHandle);
55 return module_base + rva;
58 DWORD
vaToRva(ULONGLONG va, ULONGLONG module_base = 0)
60 if (module_base == 0) {
61 module_base =
reinterpret_cast<ULONGLONG
>(this->
moduleHandle);
63 if (va < module_base) {
69 ULONGLONG diff = (va - module_base);
70 return static_cast<DWORD
>(diff);
123 static std::string
getModuleName(HANDLE _processHandle, HMODULE _modBaseAddr);
124 static std::string
getMappedName(HANDLE _processHandle, LPVOID _modBaseAddr);
141 bool isSectionExecutable(
const size_t section_number,
bool allow_data,
bool allow_inaccessible);
145 if (!isHdrReady && !
init()) {
153 if (!isHdrReady)
return false;
159 if (!isHdrReady)
return 0;
160 return peconv::get_image_size((
const BYTE*)
headerBuffer);
165 if (!isHdrReady)
return 0;
166 return peconv::get_image_base((
const BYTE*)
headerBuffer);
178 return peconv::round_up_to_unit(defined_size, (
size_t)
PAGE_SIZE);
183 return peconv::MAX_HEADER_SIZE;
A scanner for detection of IAT hooking.
Loads a module from the disk, corresponding to the module in the scanned process' memory.
bool autoswichIfWow64Mapping()
ULONGLONG rvaToVa(DWORD rva, ULONGLONG module_base=0)
ModuleData(HANDLE _processHandle, HMODULE _module, bool _isPEBConnected, bool _useCache, const char *_moduleName=nullptr)
bool relocateToBase(ULONGLONG new_base)
DWORD vaToRva(ULONGLONG va, ULONGLONG module_base=0)
bool loadRelocatedFields(std::set< DWORD > &fields_rvas)
bool _loadOriginal(bool disableFSredir)
ULONGLONG getHdrImageBase()
bool loadImportsList(peconv::ImportsCollection &collection)
bool switchToMappedPath()
bool loadImportThunks(std::set< DWORD > &fields_rvas)
bool isDotNetManagedCode()
Buffers the defined PE section belonging to the module loaded in the scanned process into the local m...
Buffers the data from the module loaded in the scanned process into the local memory.
bool _loadFullImage(size_t v_size)
virtual ~RemoteModuleData()
ULONGLONG getHdrImageBase()
bool loadImportsList(peconv::ImportsCollection &collection)
static std::string getModuleName(HANDLE _processHandle, HMODULE _modBaseAddr)
BYTE headerBuffer[peconv::MAX_HEADER_SIZE]
bool hasExecutableSection(bool allow_data, bool allow_inaccessible)
bool isSectionExecutable(const size_t section_number, bool allow_data, bool allow_inaccessible)
static std::string getMappedName(HANDLE _processHandle, LPVOID _modBaseAddr)
RemoteModuleData(HANDLE _processHandle, bool _isRefl, HMODULE _modBaseAddr)
ULONGLONG getRemoteSectionVa(const size_t section_num)
bool isSectionEntry(const size_t section_number)
ULONGLONG getModuleBase()