Archived

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

Nevar

reading .dat files?

Recommended Posts

is it possible to view the contents of a .dat file? I''m attempting to learn how to program and I have no idea how dat files are set up. All I know is they hold graphics, sound and stuff, but I have no idea exactly how it works, or what they use to make them with, and if I make one, can I edit it once it''s made?

Share this post


Link to post
Share on other sites
Actually, there is o real .dat standard, they can hold whatever you want em to hold. No real way to load em unless you know whats in them.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

Share this post


Link to post
Share on other sites
I know what''s in them. I have a list of all the titles of the stuff in there. sounds, graphics and such. I''m just wondering if I could extract something out of there if I know the title and what would do that? Also, is there anyway to add something to a dat file or replace something already in there?

I guess my big question is what makes them and how?

Share this post


Link to post
Share on other sites
As ImmaGNUman said there is no real standard so its hard to actually find the stuff in them. Some are encrypted which makes it very difficult and usually impossible to get anything meaning ful from them. Some are encoded, and are relativly easy to decode (you would be amazed how many people think negating a byte is a good form of encoding).

But from experience of hex editing a whole lot of save files I can give you an idea of 2 common formats. If the game was written in C+-+- then the files probably use persistence or serialization (Big OOP topics). If the program was written in C or in C+-+- and the programmer didn''t know about persistence or serialization then it probably has an index. In the index it will say the size of the index, and all the items in the, and their offsets. After that it could be in any format. Text is usually stored in ascii or ansi form, and numbers are usually longs (especially for win32 programs) and in little endian format. The best way to start finding out whats in them is to try to read them as graphics in raw form, play it as sound, and use a hex editor. If you play the game, and find a number you want to try to find just convert it to little endian, and search for it. When you find it change it to something else and find out what happens (make sure you backup first)

Share this post


Link to post
Share on other sites
sheesh...PCs make it too difficult...on a Mac you can just open up ResEdit and get an entire graphical folder of all the objects, double click on one and it''s opened. Much easier. Of course, that is IF they made it as that sort of resource. Commercial companies rarely do.

Share this post


Link to post
Share on other sites
If all you''re looking for are resources than get a resource editer and look in the exe''s and dll''s. That''s where the standard resources go on an IBM.

The problem is that game developers don''t like to do it the standard way because they like to get away from the windows GUI.

Share this post


Link to post
Share on other sites