#---------------------------------------------------------- # prpuo.rb - Print all the user objects in the capture file # # usage: prpuo <capture-filename> # #--------------------------------------------------------- require 'win32ole' USAGE = "prpuo <capture-filename>" if ARGV.length != 1 puts USAGE exit 1 end UnsniffDB = WIN32OLE.new("Unsniff.Database") UnsniffDB.Open(ARGV[0]) UOIndex = UnsniffDB.UserObjectsIndex (0..UOIndex.Count-1).each do |idx| uo = UOIndex.Item(idx) if ! uo.HasError print "#{uo.ID}\t#{uo.Type}\t#{uo.SenderAddress}\t" print "#{uo.ReceiverAddress}\t#{uo.Length}\t" print "#{uo.Name}\t#{uo.Description}\n" end end print "\nTotal User Objects = #{UOIndex.Count}\n" UnsniffDB.Close