Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-08

Understanding the .bin format

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco van de Voort
to SirStorm25

In our previous episode, SirStorm25 said:

Does anyone have the specification for the .bin (binary) file type?

Depends. If you mean in an executable format, then it is usually already relocated code, to be loaded on some OS dependant address.

Some variants also have hints for load address and/or entry point.

In the general case: the file equivalent of "array of byte".

Johann Glaser
to SirStorm25: Hi all! Does anyone have the specification for the .bin (binary) file type? Regards…

Hi!

Does anyone have the specification for the .bin (binary) file type?

No. Because there is no such ".bin format".

File name extensions (e.g. ".bin") are NOT the file format[1] (e.g. JPEG image)!

Unfortunately Windows strives to let people assume that, but it is wrong. The extension is an arbitrary part of the file name. Not more, not less. Foolishly Windows uses this as specification of the file format (e.g. when associating programs to start when double-clicking a file in the Explorer). It even tries to assure this by warning you when you modify the extension. All this lets user assume that the extension says something about the content. Again, this assumption is generally wrong (despite often it is by accident right).

So, if you have a file with a certain extension, you can not rely on its format. This is especially true for files with such generic extensions like ".bin" (short for "binary") or ".dat" (short for "data"). This extensions are used by hundreds of different programs, each with a totally different formats.

Bye
Hansi

[1] File Format: specifies the meaning of the individual bits and bytes at certain locations in a file