prdrill.vbs
' -----------------
' Declare variables
' -----------------
Set Sout = WScript.Stdout
 
' -----------------------
' Check usage & arguments
' -----------------------
if WScript.Arguments.Count <> 2 then
	Sout.Writeline   "Usage: prdrill <filename> <pktid>"
	WScript.Quit
end if
 
ArgFile  = WScript.Arguments.Item(0)
PktIdx   = WScript.Arguments.Item(1)
 
 
Set UnsniffDB = CreateObject("Unsniff.Database")
UnsniffDB.Open(ArgFile)
 
Sout.Writeline   "Number of packets = " & UnsniffDB.PacketCount
 
Set PacketStore    = UnsniffDB.PacketIndex
Set Packet         = PacketStore(PktIdx)
Set ProtocolLayers = Packet.Layers
 
For Each  Layer In ProtocolLayers
	Sout.Writeline  "Layer="  & Layer.Name
 
	Set Fields = Layer.Fields
	For Each Field In Fields
		PrintField 2, Field
	Next
Next
 
UnsniffDB.Close()
 
Sub PrintField (Indent , Field)
	For I = 1 to Indent
		Sout.Write " "
	Next
	Dim NewIndent
	NewIndent = Indent + 3
 
	Sout.Write     Field.Name & _
		       " ( " & Field.Value & " )" & _
		       " [  s: " & Field.SizeBits & _
		       "    o: " & Field.OffsetBits & " ]" & vbCrLf
 
	If Field.SubFieldCount > 0 Then
		For Each SubField in Field.SubFields
			PrintField NewIndent , SubField
		Next
	End If
End Sub				
unsniff/samples/prdrill/vbs.txt · Last modified: 2014/09/11 23:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki