On 23 November 2014 at 00:26, Gareth France <[email protected]> wrote:
> I have already been peeking in hex editors. I have picked out 80% of the > data and been able to read it into perl (since posting this). However I > have noticed some characters which appear to act as boundries between > certain fields which are not in the standard ascii set, so I'll have > trouble evaluating those in my code, I know how to do it in Quick Basic, > I've never tried in perl. > You should be able to treat each byte as a number or use the hexadecimal character representation (e.g. \x00 for a null character). The details in the SO question below may help [1]. > The next big problem is that the most important data appears as gibberish. > I think I will need to experiment with several data files and look for > similarities and differences. I'm getting there though. > Numerical values will likely be stored as their internal binary representations over several bytes. You may even have more complex structures encoded in there. The Perl unpack method can probably help [2]. As you suggest, what you can do is experiment with multiple files. Change one value at a time in the file and see where the difference is. Once you've found the bytes that change, try to read those bytes in a way that returns the value you expect. You will gradually start to see patterns emerge in the file. [1] http://stackoverflow.com/questions/8920215/how-to-read-binary-file-in-perl [2] http://perldoc.perl.org/perlpacktut.html Bruno
-- [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
