Binary file header

OSHS binaries (and almost any other non-OSHS binaries) begin with a header that must be located at the very beginning of the file. The header file format varies depending of the binary file type.

The first two bytes of the binary file are used to determine the type of the file. They form a two character string. The meaning of possible characters are listed here:

- "#!"
An UNIX script file. These files have a comment saying which program the script needs to be passed to. The comment has the form "#! <command>" and the two characters mentioned are the first two characters of the comment.
- "MZ"
A MS-DOS/MS-Windows executable binary file (.EXE) or shared library (.DLL) file.
- "\x7F\x45"
Usually an ELF binary file but may be used by other binary file formats too. An ELF file continues with "\x4C\x46" bytes after these two.
- "FP" (Flat 32 bit x86 Program)
A "flat" 32 bit OSHS program for x86 CPU architecture.
- "PP" (Packed 32 bit x86 Program)
A compressed "flat" 32 bit OSHS program for x86 CPU architecture.