Your first task will be to figure out the file format this dump is taking. It looks like complete jibberish to me. A quick Google search didn't reveal much to me, except that its dump format is related to that of other products, such as Etherreal; but that's still not much to go on.

When you know more, and you still want to tackle this yourself in Perl, first thing to do is enable binmode on your file handle (on Unix-alikes, it won't appear to do much).

Next step is probably to read fixed length chunks (just a guess), for which you can either use read/sysread (which are identical on the outside, but differently implemented on the inside, so I'm not sure which one will work best), or pseudo-line-like with the syntax you used, but with $/ set to a reference to an integer holding the byte count, or a scalar holding the byte count.

And third step will likely be to turn the binary chunk into Perl data, for which you can use unpack with a format string matching the structure of your records. The module Data::FixedFormat may be helpful in that task, unpacking the data into a hash.

Currently this is the program structure I envision:

open(KISMET,"/tmp/kismet_dump") or die "$!"; binmode KISMET; $/ = \64; # example: IF the record length is 64 bytes while (<KISMET>) { my @raw = unpack $packformat, $_; ... }

If the Kismet dump data format doesn't use fixed length records, but instead uses a delimiter, you can set $/ to it as a string — default is newline.

You have a long journey ahead of you. I hope this at least starts you off in the right direction.


In reply to Re: Kismet Drone by bart
in thread Kismet Drone by satanklawz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.