Skip to main content

INI

Overview

Freelancer INI files come in two forms: plain-text and binary (BINI).

When reading INI, text or binary, few key aspects are:

  • Sections and properties within them are treated as sequence of instructions rather than serialized property lists.
  • Properties can have duplicate names in a section and multiple sections can have duplicate names.
  • Maintaining order of sections and properties is essential.
  • A section property can have up to 256 values separated by comma in text format and explicitly counted in binary.
  • Individual values are primitive types: boolean, integers, floats and strings.
  • In text format properties within a section without any values are treated as a boolean with value of true.
  • Care must be taken when dealing with values from text format - cast them into desired type when queried.

Property named "comment" can be used for comments since BINI does not contain regular INI comments.

Binary INI (BINI)

Little-endian byte order.

NameTypeDescription
singnatureuint32Must be 0x494E4942 ("BINI").
versionuint32Format version (0x1).
namesOffsetuint32Offset to dictionary block.
sectionsvarying
namesvarying
  • Dictionary is a concatenated collection of ASCIIz strings (NUL-terminated ASCII strings).
  • Best keep section and property names before string values in dictionary.
  • After header read sections until namesOffset.

Section

NameTypeDescription
nameOffsetuint16Section name offset in dictionary.
propertyCountuint16Number of properties as follow.
propertiesvarying

Property

NameTypeDescription
nameOffsetuint16Property name offset in dictionary.
valueCountuint8Number of property values.
valuesvarying

Value

NameTypeDescription
typeuint8Property type.
valuebyte[4]Property value.
  • Binary format limits number of values per property to 256 so it is best not to exceed that in text format.
  • Interpret value four bytes based on preceding type:
TypeValueDescription
Boolean0x0Most significant bit in value is boolean.
Integer0x1Value is signed 32-bit integer number.
Float0x2Value is 32-bit float point number.
String0x3Value is unsigned 32-bit integer number as offset to string in dictionary block.