mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53:23 +08:00
+ test for ntobj.getType and ntobj.getListByHandleTable : print objects (and type) from handle table
git-svn-id: https://pykd.svn.codeplex.com/svn@59103 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
0fdc0e1c1f
commit
0b089bbfa3
23
samples/printobjtable.py
Normal file
23
samples/printobjtable.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Print content of object table (handle table)
|
||||||
|
#
|
||||||
|
|
||||||
|
from pykd import *
|
||||||
|
import ntobj
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
if not isSessionStart():
|
||||||
|
print "Script is launch out of WinDBG"
|
||||||
|
quit(0)
|
||||||
|
|
||||||
|
if (2 != len(sys.argv)):
|
||||||
|
dprintln("Invalid command line")
|
||||||
|
dprintln("Usage: " + sys.argv[0] + " <ObjectTableAddr>")
|
||||||
|
else:
|
||||||
|
lstObejcts = ntobj.getListByHandleTable(int(sys.argv[1], 16))
|
||||||
|
dprintln("%u objects:" % len(lstObejcts))
|
||||||
|
for obj in lstObejcts:
|
||||||
|
dprintln("obj: %X" % obj + ", type:%X" % ntobj.getType(obj))
|
Loading…
Reference in New Issue
Block a user