[pykd] fixed : issue 8578 ( findModule returns None for WOW64 process )

git-svn-id: https://pykd.svn.codeplex.com/svn@63267 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-03-30 06:49:10 +00:00
parent 0fe3d77428
commit 8603390ceb

View File

@ -54,9 +54,38 @@ loadMemory( ULONG64 address, PVOID dest, ULONG length, BOOLEAN phyAddr )
ULONG64
addr64( ULONG64 addr )
{
HRESULT hres;
try {
ULONG processorMode;
hres = dbgExt->control->GetActualProcessorType( &processorMode );
if ( FAILED( hres ) )
throw DbgException( "IDebugControl::GetEffectiveProcessorType failed" );
switch( processorMode )
{
case IMAGE_FILE_MACHINE_I386:
if ( *( (ULONG*)&addr + 1 ) == 0 )
return (ULONG64)(LONG)addr;
case IMAGE_FILE_MACHINE_AMD64:
break;
default:
throw DbgException( "Unknown processor type" );
break;
}
}
catch( std::exception &e )
{
dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd error: %s\n", e.what() );
}
catch(...)
{
dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd unexpected error\n" );
}
return addr;
}