pykd/samples/goLoad.py
SND\EreTIk_cp 6e2d161966 [+] add callback for load/unload modules
git-svn-id: https://pykd.svn.codeplex.com/svn@65709 9b283d60-5439-405e-af05-b73fd8c4d996
2011-05-22 23:55:20 +00:00

27 lines
690 B
Python

"""
Wait (execute) for load target module
"""
from pykd import *
import fnmatch
import sys
class modLoad(modEvents):
def __init__(self, mask):
modEvents.__init__(self)
self.mask = mask
def onLoad(self, module):
if fnmatch.fnmatch( module.name(), self.mask ):
return DEBUG_STATUS_BREAK
return DEBUG_STATUS_NO_CHANGE
if __name__ == "__main__":
if len(sys.argv) == 2:
loadHandler = modLoad( sys.argv[1] )
go()
else:
dprintln( "Wait (execute) for load target module\nInvalid command line" )
dprintln( "Using" + sys.argv[0] + " <MOD_FILE_NAME>" )
dprintln( "\tMOD_FILE_NAME - name of target module with wildcard" )