DriverLoader: Windows 7: Add alternative module names

This commit is contained in:
Nodir Temirkhodjaev 2021-12-19 21:18:38 +03:00
parent ad8470eea5
commit f8e233c13f

View File

@ -29,12 +29,26 @@ static NTSTATUS GetModuleInfo(PLOADEDMODULE pModule, LPCSTR name,
const PAUX_MODULE_EXTENDED_INFO modules, DWORD modulesCount)
{
PAUX_MODULE_EXTENDED_INFO module = modules;
for (DWORD i = 0; i < modulesCount; ++i, ++module) {
if (_stricmp(name, &module->FullPathName[module->FileNameOffset]) == 0) {
pModule->codeBase = module->BasicInfo.ImageBase;
return STATUS_SUCCESS;
}
}
#if defined(FORT_WIN7_COMPAT)
if (_stricmp(name, "ntoskrnl.exe") == 0) {
return GetModuleInfo(pModule, "ntkrnlpa.exe", modules, modulesCount);
}
if (_stricmp(name, "hal.dll") == 0) {
return GetModuleInfo(pModule, "halmacpi.dll", modules, modulesCount);
}
if (_stricmp(name, "halmacpi.dll") == 0) {
return GetModuleInfo(pModule, "halacpi.dll", modules, modulesCount);
}
#endif
return STATUS_DRIVER_ORDINAL_NOT_FOUND;
}