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 |