[~] remove addr64Ex

git-svn-id: https://pykd.svn.codeplex.com/svn@63646 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2011-04-08 09:55:30 +00:00
parent eb834c22f5
commit b9bee1c112
3 changed files with 20 additions and 32 deletions

View File

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

View File

@ -79,9 +79,6 @@ loadWStrToBuffer( ULONG64 address, PWCHAR buffer, ULONG bufferLen );
bool bool
compareMemory( ULONG64 addr1, ULONG64 addr2, ULONG length, BOOLEAN phyAddr = FALSE ); compareMemory( ULONG64 addr1, ULONG64 addr2, ULONG length, BOOLEAN phyAddr = FALSE );
ULONG64
addr64Ex( ULONG64 addr, IDebugControl *control );
ULONG64 ULONG64
addr64( ULONG64 addr ); addr64( ULONG64 addr );

View File

@ -30,17 +30,15 @@ struct ModuleInfo
{ {
} }
ModuleInfo( ModuleInfo(
const IMAGEHLP_MODULEW64 &dbgImageHelperInfo, const IMAGEHLP_MODULEW64 &dbgImageHelperInfo
IDebugControl *control = dbgExt->control
) : m_base(addr64(dbgImageHelperInfo.BaseOfImage)) ) : m_base(addr64(dbgImageHelperInfo.BaseOfImage))
, m_timeDataStamp(dbgImageHelperInfo.TimeDateStamp) , m_timeDataStamp(dbgImageHelperInfo.TimeDateStamp)
, m_checkSumm(dbgImageHelperInfo.CheckSum) , m_checkSumm(dbgImageHelperInfo.CheckSum)
{ {
} }
ModuleInfo( ModuleInfo(
const DEBUG_MODULE_PARAMETERS &dbgModuleParameters, const DEBUG_MODULE_PARAMETERS &dbgModuleParameters
IDebugControl *control = dbgExt->control ) : m_base(addr64(dbgModuleParameters.Base))
) : m_base(addr64Ex(dbgModuleParameters.Base, control))
, m_timeDataStamp(dbgModuleParameters.TimeDateStamp) , m_timeDataStamp(dbgModuleParameters.TimeDateStamp)
, m_checkSumm(dbgModuleParameters.Checksum) , m_checkSumm(dbgModuleParameters.Checksum)
{ {
@ -168,4 +166,4 @@ loadModule( const std::string &moduleName );
boost::python::object boost::python::object
findModule( ULONG64 addr ); findModule( ULONG64 addr );
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////