From 8414ed09dd20652d3dea7ced2ba5c454d11aa2f7 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Mon, 14 Mar 2011 13:33:11 +0000 Subject: [PATCH] [+] added: ndis6.py ( code snippet printing all NDIS6 objects ) git-svn-id: https://pykd.svn.codeplex.com/svn@62641 9b283d60-5439-405e-af05-b73fd8c4d996 --- snippets/ndis6.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 snippets/ndis6.py diff --git a/snippets/ndis6.py b/snippets/ndis6.py new file mode 100644 index 0000000..d7d4da8 --- /dev/null +++ b/snippets/ndis6.py @@ -0,0 +1,78 @@ +# +# +# + +import sys +from pykd import * + + +def printBreakLine(): + + dprintln( "\n=====================================================================================\n" ) + + +def printNdisObj(): + + ndis=loadModule("ndis") + + nextMP = ptrPtr( ndis.ndisMiniportList ) + + mpList = [] + + while nextMP != 0: + + mp = typedVar( "ndis", "_NDIS_MINIPORT_BLOCK", nextMP ) + mpList.append( mp ) + nextMP = mp.NextGlobalMiniport + + printBreakLine() + + for m in mpList: + + dprintln( "Adapter:", True ) + + dprintln( "%s\tNDIS_MINIPORT_BLOCK( %x )" % ( loadUnicodeString(m.pAdapterInstanceName), m.getAddress(), m.getAddress() ), True ) + + + lwf = m.LowestFilter + + if lwf != 0: + dprintln( "\nLight-Weight Filters:", True ) + + while lwf != 0: + + filt = typedVar( "ndis", "_NDIS_FILTER_BLOCK", lwf ) + + dprintln( "%s\tNDIS_FILTER_BLOCK( %x )" % ( loadUnicodeString(filt.FilterFriendlyName), filt.getAddress(), filt.getAddress() ), True ) + + lwf = filt.HigherFilter + + + opn = m.OpenQueue + + if opn != 0: + dprintln( "\nBound protocols:", True ) + + while opn != 0: + + openBlock = typedVar( "ndis", "_NDIS_OPEN_BLOCK", opn ) + + proto = typedVar( "ndis", "_NDIS_PROTOCOL_BLOCK", openBlock.ProtocolHandle ) + + dprint( "%s \tNDIS_OPEN_BLOCK( %x )" % ( loadUnicodeString( proto.Name.getAddress() ), openBlock.getAddress(), openBlock.getAddress() ), True ) + dprintln( "\tNDIS_PROTOCOL_BLOCK( %x )" % ( proto.getAddress(), proto.getAddress() ), True ) + + opn = openBlock.MiniportNextOpen + + printBreakLine() + +if __name__ == "__main__": + printNdisObj() + + + + + + + +