-
Notifications
You must be signed in to change notification settings - Fork 2
reg
aspadm edited this page Oct 11, 2018
·
2 revisions
Packed INI file
File contain small header:
uint magic; // FB 3E AB 45
ushort sections_count;
After that lay array of sections offsets:
typedef struct
{
ushort unknown;
uint offset;
} section_offset;
section_offset offsets[sections_count];
Now we can read each section's content by it's offset:
ushort keys_count;
ushort section_name_len;
char section_name[section_name_len];
Section include some keys, so we can read it:
ushort unknown;
uint key_offset; // local section's offset
seek(file, section_offset + key_offset);
byte key_type;
ushort key_name_len;
char key_name[key_name_len];
if key_type > 127, there are array of data, ushort elements_count
, key_type -= 128
.
Now we can also read key data:
0 - int value;
1 - float value;
2 - ushort len; char value[len];