Archived

This topic is now archived and is closed to further replies.

Reading Binary Game Data?

This topic is 4957 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

I''m interested in how a specific game reads stores the stats for game objects. It has saved them in txts, but when I open them up with Notepad, all I get are a bunch of boxes. I tried openning it up in VS.NET, but whenever I do, it opens up a notepad window and loads it there. I''m assuming this is binary data. Is there any way to read the binary data? Thanks. -Nick

Share this post


Link to post
Share on other sites
From my experiences, you have to know the format of the data. For example, if 4 integers and 2 character strings (each of length 25) were written to the file, you''d better have your "reading code" set up to read in exactly 4 integers and 2 25-character strings. Now, reading back in pure binary is something I''ve never done. I guess you''d read the data using an unsigned data buffer, but I''ve never tested that. Try searching the forums for better answers - there are quite a few posts about this topic.

Share this post


Link to post
Share on other sites

If you're wanting to read the binary data with your eyes, most programmers do this with a Hex Editor program. Visual C++ 6 has a built-in hex editor, but I'm not so sure about VS.NET, although I feel certain you could download a hex editor off the Internet somewhere. As for actually interpreting the information that you will see... if it's not a well known file format, you may be on your own.


[edited by - EvilSteve on May 19, 2004 6:23:46 PM]

Share this post


Link to post
Share on other sites
in short the only way to "read" the data in a way that you''ll be able to understand is to already know the format of the binary file. otherwise the closest you''ll be able to come is to read it in hex. it would look vaguely like this (only much longer):

0x00fe12d4 0x01f413d4 0xd0fe1ad4 0x10fe12d4 0x00fe1223

what you want is to see something like:
Character Name: Bob
Level: 24
Hitpoints: 34
....

unless you know the format of the data as mentioned before (first 4 bytes = int for length of character name, next n bytes = character name, next 4 bytes = int for level, next 4 bytes = int for hitpoints, etc, etc) you will not be able to read it. you could probably spend a few weeks/months trying to reverse engineer the data format, but, really, what''s the point?

-me

Share this post


Link to post
Share on other sites