Basically the program takes a file with a series of plain alphanumerics seperated by new lines and then translates it into this binary format.

Um, which program is it that does this? (Does it matter?)

i need to figure out how to translate to, and back from, the binary format

Do you mean you need to reverse-engineer whatever program it is that you're talking about?

Alas, it seems that the link to the binary data does not work as intended -- I get a blank page, and "view page source" also yields a blank page.

How about starting with a simple octal or hex dump of the file? The unix "od" command is probably best for this, since it gives you the flexibility of treating binary data as bytes, 16-bit words, etc. But of course, you want to know how to do it in Perl, so start with this quick-and-dirty method for a hex dump of byte codes:

$/=undef; open(I,"your_binary.file"); $d=<I>; $o=join("\n",map{sprintf("%x",ord)} split(//,$d))."\n"; print $o;
Using unpack is fun too, but you really want to try that out for yourself -- experimentation is the best teacher...

update: removed pointless, stupid remark


In reply to Re: 'parsing' a binary file? by graff
in thread 'parsing' a binary file? by BUU

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.