🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How to read files that are encrypted?

Started by
5 comments, last by SBD 3 years, 4 months ago

I need help i cant read these file. i am trying to mod a game (and i am new to modding) and i am not sure if this is some kind of encryption or the file is meant to like that. Here is a small part of a script file i opened.

¾º­?Àˆ×Ó¿!@@QQÐl? ÀQZ?Ä À @ À À À ? A?ú¡"7YYQQÐl? P?T?ä ?°5ˆ XüM XüM ? ُxâȦdƒ|•_È‡äh…! ?<¤¦‡fùU g_samu scripts/ai_samu.ddf samurai Aä?¡"7YYQQÐl? °Þ2?ä ?шÝEᇎEᇎ ? ُxâë?3?zFJ&ƒRJË?EW ?<¤¦‡fùU g_comp scripts/ai_comp.ddf computron

Advertisement

Try using 7zip to open it as it might be some sort of known archival type. I don't think your snippet is the first part of the file, which is the most important part in determining what kind of file it might be.

If that doesn't work, check here…

http://multiex.xentax.com/

and if the game isn't listed there, check the forums at that url ( http://forum.xentax.com/ ) for possible help.

Maybe you can find a mod community for that game.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

Just from the snippet you posted, I suspect this file format is neither encrypted nor compressed. The fact that there are intact full, null-terminated strings indicates to me this is probably just a custom binary file format particular to the game and/or engine.

@undefined so is there a way to know what it means, a tool or anything? And is it even possible for me to mod it if it is a binary file?

@fleabay tried opening it with winrar it wasnt an archive and the is not listed in multiex and the game doesnt have a modding community. Guess i cant mod this game :( What do u think? is it possible ?

@fireblaze10 there aren't necessarily tools that will “Just Work” to decode the file, unless it's in some well-known format or someone else has already written custom tools for decoding that game's files. (We don't know what game or engine this is, so we can't tell you if those exist yet or not.)

In general though, yes it is possible to modify these files meaningfully, but you'll have to understand the general binary format. If the format isn't a well-known/documented format, you'll have to reverse engineer the format on your own. That can be a rather time-consuming process and tends to require a lot of experience and expertise in the domain. Your best hope for casual modding would be that someone else has already documented the format or written decoding tools. If the game is popular or already has some existing mods, that's probably the case.

Tools like a hex editor will certainly be invaluable in trying to being able to inspect and poke around in the file and make sense of things, but a hex editor certainly won't just magically make the binary structure known. Basically, all those funny-looking characters you're seeing are what your text editor is interpreting a bunch of numeric values as in some arbitrary 8-bit text encoding; a hex editor will let you easily just see the actual numeric values in various representations and possibly help you make sense of what they represent.

Sean Middleditch – Game Systems Engineer – Join my team!

To expand on what Sean is saying, the way one typically goes about decoding a game's custom file format is to open it in a hex editor, and start inspecting values and trying to find values that map to known values in the game. For instance, if you have a file that is the data for an entity, and you know in game that entity has a hitpoint value of 1500, then you might look for the hex value 05DC in the file (or potentially the value DC05, depending on endianness). Then you could try changing that value in the file and see if it reflects in the game. And there is lots of nuance to that as well; 16-bit versus 32-bit values, float vs. integer, signed vs. unsigned, and the aforementioned endianness.

In your particular case, it does appear that there is some human-readable string data you might be able to alter, providing the mechanisms are in place in the game to find external/new files. That, of course, presumes that those are references to external files, and not just a header for in-line file contents (think a packfile where the data for each file is preceded by its filename). That further presupposes that there aren't any absolute offset values in the file that may become invalid if the string lengths are not exactly the same. But, even in this case, there are things you can look for. Given that there appears to be some structure to the file (repeating instances of file names and entity names/types), you can add up the number of bytes between those file name entries, then look for that value somewhere near the filenames. Then voila, you've now found where they store the length of the structure/binary data for each “entry”.

As Sean alluded to, this is a painstaking process to do without any information about the file format. Without documentation, or an existing tool that can read/write those files, you may be out of luck. I would do google searches for things like “gamename .ddf”, as well as the extension of the file you're inspecting.

This topic is closed to new replies.

Advertisement