11
dprintln( "\n" + "="*80 + "\n" )
18
ndisMajorVersion = ptrByte( ndis.NdisGetVersion + 1 )
19
ndisMinorVersion = ptrByte( ndis.NdisGetVersion + 3 )
21
mpList = ndis.typedVarList( ndis.ndisMiniportList, "_NDIS_MINIPORT_BLOCK", "NextGlobalMiniport" )
27
dprintln( "<u>Adapter:</u>", True )
29
dprintln( "%s\t<link cmd=\"dt ndis!_NDIS_MINIPORT_BLOCK %x\">NDIS_MINIPORT_BLOCK( %x )</link>" % ( loadUnicodeString(m.pAdapterInstanceName), m.getAddress(), m.getAddress() ), True )
31
if ndisMajorVersion >= 6:
36
dprintln( "\n<u>Light-Weight Filters:</u>", True )
40
filt = typedVar( "ndis!_NDIS_FILTER_BLOCK", lwf )
42
dprintln( "%s\t<link cmd=\"dt ndis!_NDIS_FILTER_BLOCK %x\">NDIS_FILTER_BLOCK( %x )</link>" % ( loadUnicodeString(filt.FilterFriendlyName), filt.getAddress(), filt.getAddress() ), True )
44
lwf = filt.HigherFilter
50
dprintln( "\n<u>Bound protocols:</u>", True )
54
openBlock = typedVar( "ndis!_NDIS_OPEN_BLOCK", opn )
56
proto = typedVar( "ndis!_NDIS_PROTOCOL_BLOCK", openBlock.ProtocolHandle )
58
dprint( "%s \t<link cmd=\"dt ndis!_NDIS_OPEN_BLOCK %x\">NDIS_OPEN_BLOCK( %x )</link>" % ( loadUnicodeString( proto.Name.getAddress() ), openBlock.getAddress(), openBlock.getAddress() ), True )
59
dprintln( "\t<link cmd=\"dt ndis!_NDIS_PROTOCOL_BLOCK %x\">NDIS_PROTOCOL_BLOCK( %x )</link>" % ( proto.getAddress(), proto.getAddress() ), True )
61
opn = openBlock.MiniportNextOpen
67
dprintln( "\n<u>Bound protocols:</u>", True )
71
openBlock = typedVar( "ndis!_NDIS_OPEN_BLOCK", opn )
73
proto = typedVar( "ndis!_NDIS_PROTOCOL_BLOCK", openBlock.ProtocolHandle )
75
dprint( "%s \t<link cmd=\"dt ndis!_NDIS_OPEN_BLOCK %x\">NDIS_OPEN_BLOCK( %x )</link>" % ( loadUnicodeString( proto.ProtocolCharacteristics.Name.getAddress() ), openBlock.getAddress(), openBlock.getAddress() ), True )
76
dprintln( "\t<link cmd=\"dt ndis!_NDIS_PROTOCOL_BLOCK %x\">NDIS_PROTOCOL_BLOCK( %x )</link>" % ( proto.getAddress(), proto.getAddress() ), True )
78
opn = openBlock.MiniportNextOpen
85
dprintln( "script is launch out of windbg" )
88
if not isKernelDebugging():
89
dprintln( "script for kernel mode only" )
94
if __name__ == "__main__":