mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.2.x] added : sample um.critsec.py
git-svn-id: https://pykd.svn.codeplex.com/svn@80243 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
6c582490ee
commit
f0fc6f3f86
@ -2,7 +2,7 @@
|
|||||||
#define PYKD_VERSION_MAJOR 0
|
#define PYKD_VERSION_MAJOR 0
|
||||||
#define PYKD_VERSION_MINOR 2
|
#define PYKD_VERSION_MINOR 2
|
||||||
#define PYKD_VERSION_SUBVERSION 0
|
#define PYKD_VERSION_SUBVERSION 0
|
||||||
#define PYKD_VERSION_BUILDNO 1
|
#define PYKD_VERSION_BUILDNO 2
|
||||||
|
|
||||||
|
|
||||||
#define __VER_STR2__(x) #x
|
#define __VER_STR2__(x) #x
|
||||||
|
@ -76,9 +76,19 @@ ULONG64 TypeInfo::getSymbolSize( const std::string &fullName )
|
|||||||
|
|
||||||
std::string TypeInfo::findSymbol( ULONG64 offset )
|
std::string TypeInfo::findSymbol( ULONG64 offset )
|
||||||
{
|
{
|
||||||
ModulePtr module = Module::loadModuleByOffset( offset );
|
try {
|
||||||
|
|
||||||
return module->getName() + '!' + module->getSymbolNameByVa( offset );
|
ModulePtr module = Module::loadModuleByOffset( offset );
|
||||||
|
|
||||||
|
return module->getName() + '!' + module->getSymbolNameByVa( offset );
|
||||||
|
|
||||||
|
}
|
||||||
|
catch( DbgException& )
|
||||||
|
{
|
||||||
|
std::stringstream sstr;
|
||||||
|
sstr << std::hex << offset;
|
||||||
|
return sstr.str();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -44,10 +44,6 @@ def checkSSDT():
|
|||||||
dprintln( "[%u] " % i + findSymbol( serviceTable[i] ) )
|
dprintln( "[%u] " % i + findSymbol( serviceTable[i] ) )
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
checkSSDT()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
@ -60,6 +56,12 @@ if __name__ == "__main__":
|
|||||||
dprintln( "not a kernel debugging" )
|
dprintln( "not a kernel debugging" )
|
||||||
break
|
break
|
||||||
|
|
||||||
run()
|
checkSSDT()
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
run()
|
||||||
|
@ -6,6 +6,8 @@ from pykd import dprintln
|
|||||||
from pykd import dprint
|
from pykd import dprint
|
||||||
|
|
||||||
def printAllSamples():
|
def printAllSamples():
|
||||||
|
dprintln( "<b>User mode</b>", True)
|
||||||
|
dprintln( "Get critical sections list <link cmd=\"!py samples run um.critlist\">Run</link> <link cmd=\"!py samples source um.critlist\">Source</link>", True)
|
||||||
dprintln( "<b>Kernel mode</b>", True )
|
dprintln( "<b>Kernel mode</b>", True )
|
||||||
dprintln( "Get process list <link cmd=\"!py samples run km.proclist\">Run</link> <link cmd=\"!py samples source km.proclist\">Source</link>", True)
|
dprintln( "Get process list <link cmd=\"!py samples run km.proclist\">Run</link> <link cmd=\"!py samples source km.proclist\">Source</link>", True)
|
||||||
dprintln( "Get kernel service list <link cmd=\"!py samples run km.ssdt\">Run</link> <link cmd=\"!py samples source km.ssdt\">Source</link>", True)
|
dprintln( "Get kernel service list <link cmd=\"!py samples run km.ssdt\">Run</link> <link cmd=\"!py samples source km.ssdt\">Source</link>", True)
|
||||||
|
@ -66,6 +66,6 @@ class ModuleTest( unittest.TestCase ):
|
|||||||
self.assertTrue( re.search('targetapp\\.cpp', fileName ) )
|
self.assertTrue( re.search('targetapp\\.cpp', fileName ) )
|
||||||
self.assertEqual( 2, displacement )
|
self.assertEqual( 2, displacement )
|
||||||
fileName, lineNo, displacement = pykd.getSourceLine()
|
fileName, lineNo, displacement = pykd.getSourceLine()
|
||||||
self.assertEqual( 622, lineNo )
|
self.assertEqual( 624, lineNo )
|
||||||
|
|
||||||
|
|
||||||
|
@ -459,6 +459,8 @@ void FuncWithName1(int a)
|
|||||||
std::cout << g_arrOfPtrToFunc[1];
|
std::cout << g_arrOfPtrToFunc[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma optimize("g", off)
|
||||||
|
|
||||||
static
|
static
|
||||||
void _FuncWithName2(int a)
|
void _FuncWithName2(int a)
|
||||||
{
|
{
|
||||||
@ -466,7 +468,7 @@ void _FuncWithName2(int a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
#pragma optimize("g", off)
|
|
||||||
VOID functionCalledFromEnumWindowsProc1(DWORD dwProcessId)
|
VOID functionCalledFromEnumWindowsProc1(DWORD dwProcessId)
|
||||||
{
|
{
|
||||||
DWORD dwCurrentProcessId = GetCurrentProcessId();
|
DWORD dwCurrentProcessId = GetCurrentProcessId();
|
||||||
|
Loading…
Reference in New Issue
Block a user