+ 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:
SND\EreTIk_cp 2010-12-23 11:11:46 +00:00
parent 0fdc0e1c1f
commit 0b089bbfa3

23
samples/printobjtable.py Normal file
View 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))