Jump to content
  • Advertisement
Sign in to follow this  
simon10k

What datatype?

This topic is 4750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
Quote:
Original post by simon10k
So doing the trial and error method I could work out the format?
Always begin by googling for the file format's specification (wotsit is a great source hosted right here on gamedev).
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!