What datatype?
trial and error, unless you know the file format. there is no way to tell one group of ones and zeros from the next. if you find that you can in fact do this, you are probably in fact a robot.
You dont - this is the point of binary - it stops people reading your file if you dont know what to expect (though this is debatable). This is really what headers and file-layouts are for.
Sorry if this was not the answer you wanted :)
Sorry if this was not the answer you wanted :)
Quote:Original post by simon10kAlways begin by googling for the file format's specification (wotsit is a great source hosted right here on gamedev).
So doing the trial and error method I could work out the format?
Download a decent hex editor and familiarize yourself with it both it and the look of the file format. Search for strings as reference points for example.
Try to figure out what kinds of data should be stored in it (i.e. how you would have created it yourself), and study similar formats.
Save a bunch of nearly identical sets of data and study how it affects the file. A simple trick is to just change some integer counter around between byte boundaries to discover the prefered byteorder.
If all else fails you can always disassemble the application and examine its reader/writer.
Oh, and compare the header against a few common compression formats (the use of zlib is not uncommon and there's even those who use renamed zip files). And if you manage to figure out just about everything except the last few bytes then there's a good chance it's checksum.
Overall it's a tedious and time-consuming process and any non-trivial format is likely to invole quite a lot of disassembling.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement