mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[+] added : sample stacks.py
git-svn-id: https://pykd.svn.codeplex.com/svn@58074 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
b6eaf03db1
commit
ea3dad282d
37
samples/stacks.py
Normal file
37
samples/stacks.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import sys
|
||||||
|
from pykd import *
|
||||||
|
|
||||||
|
|
||||||
|
#def loadSymbols():
|
||||||
|
#
|
||||||
|
# global nt
|
||||||
|
# nt = loadModule( "nt" )
|
||||||
|
# nt.PsActiveProcessHead = getOffset( "nt", "PsActiveProcessHead" )
|
||||||
|
|
||||||
|
|
||||||
|
def printStack():
|
||||||
|
|
||||||
|
threadList = getThreadList()
|
||||||
|
|
||||||
|
for threadPtr in threadList:
|
||||||
|
oldThread = 0
|
||||||
|
setImplicitThread( threadPtr )
|
||||||
|
stackFrames = getCurrentStack()
|
||||||
|
for frame in stackFrames: dprintln( findSymbol( frame.instructionOffset ) + " (%x)" % frame.instructionOffset )
|
||||||
|
dprintln("")
|
||||||
|
|
||||||
|
|
||||||
|
# stackFrames = getCurrentStack()
|
||||||
|
|
||||||
|
# [ dprintln( findSymbol( f.instructionOffset ) + " (%x)" % f.instructionOffset ) for f in stackFrames ]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
if not isSessionStart():
|
||||||
|
createSession()
|
||||||
|
loadDump( sys.argv[1] )
|
||||||
|
dprintln( sys.argv[1] + " - loaded OK" )
|
||||||
|
|
||||||
|
printStack()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user