prlayer.rb
# ------------------------------------------------------------------
# prlayer.rb	Print all protocol layers in a given packet
#	usage : prlayer <capture-file> <pktid> 
#
#
# ------------------------------------------------------------------
require 'win32ole'
 
USAGE = "prlayer <capture-filename> <pkt-id>"
 
if ARGV.length != 2
	puts USAGE
	exit 1
end
 
InputFile = ARGV[0]
PktId     = ARGV[1]
UnsniffDB = WIN32OLE.new("Unsniff.Database")
UnsniffDB.Open(InputFile)
 
 
Packet = UnsniffDB.PacketIndex.Item(PktId)
layers = Packet.Layers
print "Number of layers in packet #{PktId} is #{layers.Count}\n"
layers.each do |lyr| 
	print "\t#{lyr.Name}\t#{lyr.Size}\t#{lyr.ProtID}\n"
end
 
UnsniffDB.Close()
unsniff/samples/prlayer/ruby.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