[snippets] updated

git-svn-id: https://pykd.svn.codeplex.com/svn@65717 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-05-23 07:51:26 +00:00
parent 9a0d80eb23
commit da1b7b7977
4 changed files with 18 additions and 17 deletions

View File

@ -44,6 +44,8 @@ def getObjectInDir( dirObj, objName ):
else:
dirEntry = 0
return None

View File

@ -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

View File

@ -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 )

View File

@ -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