in reply to 'parsing' a binary file?


Here is what the binary information in your file looks like:
00: 04 00 FF FF 0D 55 6E 74 69 74 6C 65 64 20 44 65 ..ÿÿ.Untitled De 10: 63 6B 6C 8A 76 3D DF 16 04 00 00 00 00 00 00 00 cklŠv=ß......... 20: A8 07 27 01 00 00 00 00 00 00 00 00 15 00 02 00 ¨.'............. 30: 04 00 14 3C 6A 66 45 59 6F 3F 56 51 5F 52 57 56 ...<jfEYo?VQ_RWV 40: 4F 43 43 4C 3E 72 5A 00 00 00 00 00 00 00 A8 07 OCCL>rZ.......¨. 50: 27 01 00 00 00 00 00 00 00 00 15 00 '...........

Apart from NAME it is hard to see any correlation with the input text.

If you can get some documentation about the binary file format then you will be able to read and write similar files using unpack and pack.

Otherwise, you will spend long lonely nights, like me, staring into a hex editor, wondering what this has to do with programming in Perl. ;-)

--
John.

Replies are listed 'Best First'.
Re: Re: 'parsing' a binary file?
by BUU (Prior) on May 30, 2002 at 23:55 UTC
    So basically, give up before i go insane?
      No, close :)

      Your best bet is probably to try to contact the author of the original program, explain to them what you're trying to do, and ask for their data structure.

      Failing that, I remember seeing an article on cracking Turbo Pascal data structures years ago. The jist of it was to know how the data structures were stored. Different variables had different byte representations.

      So, what I'd do if all else failed would be to run the hex editor on the original program, see what language it's written in, and then go from there and see if that gets you anywhere.

      Hope that helps!

      Couple of links from a google search that may help as well:

      REC Decompiler Home Page
      <a href="http://tsehp.cjb.net/>Last Fravia's mirror of Reverse code engineering

      Some people fall from grace. I prefer a running start...


      In short, yes. :-)

      Seriously, it is possible to reverse engineering a binary file format but it is a long slow process.

      On the other hand, if there is documentation available then dealing with binary files can be quite easy thanks to the venerable pack and unpack.

      --
      John.

      A reply falls below the community's threshold of quality. You may see it by logging in.