pdudrill.vbs
' -----------------
' Declare variables
' -----------------
Set Sout = WScript.Stdout
 
' -----------------------
' Check usage & arguments
' -----------------------
if WScript.Arguments.Count <> 2 then
	Sout.Writeline   "Usage: pdudrill <filename> <pduid>"
	WScript.Quit
end if
 
ArgFile  = WScript.Arguments.Item(0)
PduIdx   = WScript.Arguments.Item(1)
 
 
Set UnsniffDB = CreateObject("Unsniff.Database")
UnsniffDB.Open(ArgFile)
 
Set PDUStore    = UnsniffDB.PDUIndex
Set PDU         = PDUStore(PduIdx)
Set Fields 	= PDU.Fields
 
For Each Field In Fields
	PrintField 2, Field
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/pdudrill/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