mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[snippets] updated
git-svn-id: https://pykd.svn.codeplex.com/svn@65717 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
9a0d80eb23
commit
da1b7b7977
@ -44,6 +44,8 @@ def getObjectInDir( dirObj, objName ):
|
||||
else:
|
||||
dirEntry = 0
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10,24 +10,24 @@ def processInfo():
|
||||
processList = typedVarList( nt.PsActiveProcessHead, "nt", "_EPROCESS", "ActiveProcessLinks" )
|
||||
|
||||
for process in processList:
|
||||
print "".join( [chr(i) for i in process.ImageFileName if i != 0] )
|
||||
print "".join( [chr(i) for i in process.ImageFileName if i != 0] )
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
if not isWindbgExt():
|
||||
if not loadDump( sys.argv[1] ):
|
||||
dprintln( sys.argv[1] + " - load failed" )
|
||||
return
|
||||
|
||||
if not isKernelDebugging():
|
||||
dprintln( "not a kernel debugging" )
|
||||
return
|
||||
|
||||
processInfo()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
while True:
|
||||
|
||||
if not isWindbgExt():
|
||||
if not loadDump( sys.argv[1] ):
|
||||
dprintln( sys.argv[1] + " - load failed" )
|
||||
break
|
||||
|
||||
if not isKernelDebugging():
|
||||
dprintln( "not a kernel debugging" )
|
||||
break
|
||||
|
||||
processInfo()
|
||||
break
|
||||
|
||||
|
@ -46,7 +46,7 @@ def iat( moduleName, mask = "*" ):
|
||||
else:
|
||||
iatEntry = ptrQWord( iatAddr + i*pSize )
|
||||
|
||||
if iatEntry != 0:
|
||||
if iatEntry != None and iatEntry != 0:
|
||||
symbolName = findSymbol( iatEntry )
|
||||
if fnmatch.fnmatch( symbolName, mask ):
|
||||
dprintln( symbolName )
|
||||
|
@ -73,7 +73,6 @@ def getObjectNameInfoFromInfoMask(p):
|
||||
# Select platform-specific function for getting name of object
|
||||
getObjectNameInfo = None
|
||||
try:
|
||||
getTypeClass("nt", "_OBJECT_HEADER").NameInfoOffset
|
||||
getObjectNameInfo = getObjectNameInfoFromHeader
|
||||
except AttributeError:
|
||||
getObjectNameInfo = getObjectNameInfoFromInfoMask
|
||||
|
Loading…
Reference in New Issue
Block a user