Commit dd6e011c authored by SND\ussrhero_cp's avatar SND\ussrhero_cp Committed by Mikhail I. Izmestev

fixed bug #14138 ( failed to create module object if it's header is paged out )

git-svn-id: https://kdlibcpp.svn.codeplex.com/svn@91262 9b283d60-5439-405e-af05-b73fd8c4d996
parent 106edbba
......@@ -225,29 +225,38 @@ bool isModuleUserMode( MEMOFFSET_64 baseOffset )
bool isModuleManaged( MEMOFFSET_64 baseOffset )
{
try
{
ULONG machineType;
HRESULT hres = g_dbgMgr->control->GetEffectiveProcessorType(&machineType);
ULONG machineType;
HRESULT hres = g_dbgMgr->control->GetEffectiveProcessorType(&machineType);
ULONG64 ntHeaderOffset = baseOffset + ptrDWord( baseOffset + 0x3c );
if ( machineType == IMAGE_FILE_MACHINE_I386 )
{
IMAGE_NT_HEADERS32 ntHeader;
readMemory( ntHeaderOffset, &ntHeader, sizeof(ntHeader) );
ULONG64 ntHeaderOffset = baseOffset + ptrDWord( baseOffset + 0x3c );
return ntHeader.OptionalHeader.DataDirectory[14].Size != 0;
}
if ( machineType == IMAGE_FILE_MACHINE_I386 )
{
IMAGE_NT_HEADERS32 ntHeader;
readMemory( ntHeaderOffset, &ntHeader, sizeof(ntHeader) );
return ntHeader.OptionalHeader.DataDirectory[14].Size != 0;
}
if ( machineType == IMAGE_FILE_MACHINE_AMD64 )
{
IMAGE_NT_HEADERS64 ntHeader;
readMemory( ntHeaderOffset, &ntHeader, sizeof(ntHeader) );
if ( machineType == IMAGE_FILE_MACHINE_AMD64 )
{
IMAGE_NT_HEADERS64 ntHeader;
readMemory( ntHeaderOffset, &ntHeader, sizeof(ntHeader) );
return ntHeader.OptionalHeader.DataDirectory[14].Size != 0;
}
throw DbgException("Unknown CPU type");
return ntHeader.OptionalHeader.DataDirectory[14].Size != 0;
}
catch(MemoryException& )
{}
throw DbgException("Unknown CPU type");
return false;
}
///////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment