27 typedef struct _PH_MODULE_QUERY_DATA
29 SLIST_ENTRY ListEntry;
97 moduleProvider->
RunStatus = STATUS_SUCCESS;
128 return moduleProvider;
156 entry = RtlInterlockedFlushSList(&moduleProvider->
QueryListHead);
225 _In_ PVOID BaseAddress
238 ModuleProvider->ModuleHashtable,
244 moduleItem = *moduleItemPtr;
261 ULONG enumerationKey = 0;
266 while (
PhEnumHashtable(ModuleProvider->ModuleHashtable, (PVOID *)&moduleItem, &enumerationKey))
290 data->ModuleItem->FileName,
291 PhGetString(data->ModuleProvider->PackageFullName),
292 &data->VerifySignerName,
296 RtlInterlockedPushEntrySList(&data->ModuleProvider->QueryListHead, &data->ListEntry);
300 return STATUS_SUCCESS;
315 data->ModuleProvider = ModuleProvider;
316 data->ModuleItem = ModuleItem;
323 static BOOLEAN NTAPI EnumModulesCallback(
325 _In_opt_ PVOID Context
366 ULONG enumerationKey = 0;
371 BOOLEAN found =
FALSE;
374 for (i = 0; i < modules->
Count; i++)
390 if (!modulesToRemove)
401 for (i = 0; i < modulesToRemove->
Count; i++)
419 entry = RtlInterlockedFlushSList(&moduleProvider->
QueryListHead);
426 data->ModuleItem->VerifyResult = data->VerifyResult;
427 data->ModuleItem->VerifySignerName = data->VerifySignerName;
428 data->ModuleItem->JustProcessed =
TRUE;
436 for (i = 0; i < modules->
Count; i++)
490 moduleItem->
Flags &= ~LDRP_IMAGE_NOT_AT_BASE;
497 if (remoteMappedImage.
Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
499 if ((ULONG_PTR)((PIMAGE_OPTIONAL_HEADER32)&remoteMappedImage.
NtHeaders->OptionalHeader)->ImageBase != (ULONG_PTR)moduleItem->
BaseAddress)
500 moduleItem->
Flags |= LDRP_IMAGE_NOT_AT_BASE;
504 else if (remoteMappedImage.
Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
506 if ((ULONG_PTR)((PIMAGE_OPTIONAL_HEADER64)&remoteMappedImage.
NtHeaders->OptionalHeader)->ImageBase != (ULONG_PTR)moduleItem->
BaseAddress)
507 moduleItem->
Flags |= LDRP_IMAGE_NOT_AT_BASE;
537 BOOLEAN modified =
FALSE;
553 for (i = 0; i < modules->
Count; i++)