extensions of the files

hi guys.

i have some knowledge about extensions but i dont think i have enough.

and i would like you to give me some links of articles and such about extensions.

and yes i googled and read many articles already. i just want to learn more.
There's not a whole lot to say about them. They're particularly important for Windows, and GUI's in general use them as an identifier for the kind of program that should handle them. So it depends on what platform you're on.
Last edited on
hmm so you say it is not so important other than windows OS. than forget about it

i have one more question.

i see inside games and programs main folders. some save file and such. i wonder how they make a save file. you know they are protected you cant edit them easily. i wondered that how to make a file like that
Any file is just a sequence of bytes. A file that is not intended to store plain text is commonly referred to as "binary file".
Since a save file is intended to be used by a specific game it will be constructed in such a way that when the application reads it, it knows exactly what that data represents. For example instead of doing
lives = 1
level = 1

it is sufficient to do
which in binary is 00000001 00000001.
When the game loads a save file it reads the first byte and assigns it to the lives, then reads the second and assigns it to the level. But the char (char is 1 byte wide) 0x01 is not a printable character (character '1' is 0x49 is ASCII), so you can't see it in a text editor.
wow. thx for the info. i will try to make one
File extensions effect the file itself no way at all.
To understand binary files... get a hex editor. Write a very simple binary file in a C++ program and look at it in a hex editor. Then write a text file and look at it in a hex editor. You'll see very quickly how they work.
ok i will do it. thx
The concept of binary files really "clicked" for me when I tried creating and reading .wav files. The extension doesn't matter, it just helps some OSs to know which program to open the file with by default. The extension usually refers to the file format, but it doesn't actually contribute to the content.

However, the WAVE format specification is what defines how to use this type of binary file:

The WAVE format is open, which means anyone can see what what bytes are placed where in the file. The file contains a header which tells us that this is a WAVE file and the size. It also contains a FORMAT chunk which defines properties such as the number of channels, the size of each sample, the bit-rate, etc. Then there is a DATA chunk which contains the wave-forms that make up the file.

Other formats such as the ms office formats (example: .xlsx files) or some game save data are proprietary. This means that the specification is not open to the public. You can try to reverse engineer the file format by viewing it in a hex editor and by making small changes to the file and seeing what effect this will have on the file. This can be difficult if the file-format is very complex.

For example: If I have a file which defines a level 1 character which looks something like this:
00 1D 74 F2 01 56
Then I level the character up and I see the new file looks like this:
00 1D 74 F2 02 56
Then I might assume that the 5th byte there represents the level. If I change that file to:
00 1D 74 F2 03 56
now I can load the character into the game and see if he leveled up.
Last edited on
Topic archived. No new replies allowed.