PEPROCESS CurrentProcess;
PPEB Peb = NULL;
INT Count = 0;
+ INT Length;
CurrentProcess = PsGetCurrentProcess();
if (CurrentProcess != NULL)
current_entry != NULL)
{
current = CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
-
+ Length = min(current->BaseDllName.Length / sizeof(WCHAR), 255);
if ((Address != NULL && (Address >= (PVOID)current->DllBase &&
Address < (PVOID)((char *)current->DllBase + current->SizeOfImage))) ||
- (Name != NULL && _wcsicmp(current->BaseDllName.Buffer, Name) == 0) ||
+ (Name != NULL && _wcsnicmp(current->BaseDllName.Buffer, Name, Length) == 0) ||
(Index >= 0 && Count++ == Index))
{
- INT Length = current->BaseDllName.Length;
- if (Length > 255)
- Length = 255;
wcsncpy(pInfo->Name, current->BaseDllName.Buffer, Length);
pInfo->Name[Length] = L'\0';
pInfo->Base = (ULONG_PTR)current->DllBase;
pInfo->Size = current->SizeOfImage;
- pInfo->RosSymInfo = current->RosSymInfo;
+ pInfo->RosSymInfo = current->PatchInformation;
return TRUE;
}
current_entry = current_entry->Flink;
PLDR_DATA_TABLE_ENTRY current;
extern LIST_ENTRY ModuleListHead;
INT Count = 0;
+ INT Length;
current_entry = ModuleListHead.Flink;
{
current = CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+ Length = min(current->BaseDllName.Length / sizeof(WCHAR), 255);
if ((Address != NULL && (Address >= (PVOID)current->DllBase &&
Address < (PVOID)((ULONG_PTR)current->DllBase + current->SizeOfImage))) ||
- (Name != NULL && _wcsnicmp(current->BaseDllName.Buffer, Name,
- current->BaseDllName.Length / sizeof(WCHAR)) == 0) ||
+ (Name != NULL && _wcsnicmp(current->BaseDllName.Buffer, Name, Length) == 0) ||
(Index >= 0 && Count++ == Index))
{
- wcsncpy(pInfo->Name, current->BaseDllName.Buffer,
- min(255, current->BaseDllName.Length / sizeof(WCHAR)));
- pInfo->Name[255] = L'\0';
+ wcsncpy(pInfo->Name, current->BaseDllName.Buffer, Length);
+ pInfo->Name[Length] = L'\0';
pInfo->Base = (ULONG_PTR)current->DllBase;
pInfo->Size = current->SizeOfImage;
- pInfo->RosSymInfo = current->RosSymInfo;
+ pInfo->RosSymInfo = current->PatchInformation;
return TRUE;
}
current_entry = current_entry->Flink;
UNICODE_STRING KernelName;
DPRINT("LdrModule %p\n", LdrModule);
- LdrModule->RosSymInfo = NULL;
+ LdrModule->PatchInformation = NULL;
KernelName.MaximumLength = sizeof(Prefix) + LdrModule->FullDllName.Length;
KernelName.Length = KernelName.MaximumLength - sizeof(WCHAR);
LdrModule->FullDllName.Length);
KernelName.Buffer[KernelName.Length / sizeof(WCHAR)] = L'\0';
- KdbpSymLoadModuleSymbols(&KernelName, (PROSSYM_INFO*)&LdrModule->RosSymInfo);
+ KdbpSymLoadModuleSymbols(&KernelName, (PROSSYM_INFO*)&LdrModule->PatchInformation);
ExFreePool(KernelName.Buffer);
}
CurrentProcess = PsGetCurrentProcess();
if (CurrentProcess != Process)
{
- KeAttachProcess(EPROCESS_TO_KPROCESS(Process));
+ KeAttachProcess(&Process->Pcb);
}
Peb = Process->Peb;
ASSERT(Peb);
{
Current = CONTAINING_RECORD(CurrentEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
- KdbpSymUnloadModuleSymbols(Current->RosSymInfo);
+ KdbpSymUnloadModuleSymbols(Current->PatchInformation);
CurrentEntry = CurrentEntry->Flink;
}
IN PLDR_DATA_TABLE_ENTRY Module)
{
/* Load symbols for the image if available */
- DPRINT("Loading driver %wZ symbols (driver @ %08x)\n", Filename, Module->Base);
+ DPRINT("Loading driver %wZ symbols (driver @ %08x)\n", Filename, Module->DllBase);
- Module->RosSymInfo = NULL;
+ Module->PatchInformation = NULL;
- KdbpSymLoadModuleSymbols(Filename, (PROSSYM_INFO*)&Module->RosSymInfo);
+ KdbpSymLoadModuleSymbols(Filename, (PROSSYM_INFO*)&Module->PatchInformation);
}
/*! \brief Unloads symbol info for a driver.
KdbSymUnloadDriverSymbols(IN PLDR_DATA_TABLE_ENTRY ModuleObject)
{
/* Unload symbols for module if available */
- KdbpSymUnloadModuleSymbols(ModuleObject->RosSymInfo);
- ModuleObject->RosSymInfo = NULL;
+ KdbpSymUnloadModuleSymbols(ModuleObject->PatchInformation);
+ ModuleObject->PatchInformation = NULL;
}
/*! \brief Called when a symbol file is loaded by the loader?
{
if (! LoadSymbols)
{
- ModuleObject->RosSymInfo = NULL;
+ ModuleObject->PatchInformation = NULL;
return;
}
if (i < KeLoaderBlock.ModsCount)
{
KeLoaderModules[i].Reserved = 1;
- if (ModuleObject->RosSymInfo != NULL)
+ if (ModuleObject->PatchInformation != NULL)
{
- KdbpSymRemoveCachedFile(ModuleObject->RosSymInfo);
+ KdbpSymRemoveCachedFile(ModuleObject->PatchInformation);
}
if (IsRaw)
{
if (! RosSymCreateFromRaw((PVOID) KeLoaderModules[i].ModStart,
KeLoaderModules[i].ModEnd - KeLoaderModules[i].ModStart,
- (PROSSYM_INFO*)&ModuleObject->RosSymInfo))
+ (PROSSYM_INFO*)&ModuleObject->PatchInformation))
{
return;
}
{
if (! RosSymCreateFromMem((PVOID) KeLoaderModules[i].ModStart,
KeLoaderModules[i].ModEnd - KeLoaderModules[i].ModStart,
- (PROSSYM_INFO*)&ModuleObject->RosSymInfo))
+ (PROSSYM_INFO*)&ModuleObject->PatchInformation))
{
return;
}
/* add file to cache */
RtlInitAnsiString(&AnsiString, FileName);
RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, TRUE);
- KdbpSymAddCachedFile(&UnicodeString, ModuleObject->RosSymInfo);
+ KdbpSymAddCachedFile(&UnicodeString, ModuleObject->PatchInformation);
RtlFreeUnicodeString(&UnicodeString);
DPRINT("Installed symbols: %s@%08x-%08x %p\n",
FileName,
ModuleObject->DllBase,
- ModuleObject->SizeOfImage + ModuleObject->DllBase,
- ModuleObject->RosSymInfo);
+ ModuleObject->SizeOfImage + (ULONG)ModuleObject->DllBase,
+ ModuleObject->PatchInformation);
}
}
}
int Found;
char YesNo;
- NtoskrnlModuleObject->RosSymInfo = NULL;
- LdrHalModuleObject->RosSymInfo = NULL;
+ NtoskrnlModuleObject->PatchInformation = NULL;
+ LdrHalModuleObject->PatchInformation = NULL;
InitializeListHead(&SymbolFileListHead);
KeInitializeSpinLock(&SymbolFileListLock);