Repository navigation
Section 0 ‐ Section Information
This section of the MAB file consistently starts at the 16 byte offset of the file, right after the header. It contains information about the animation, as well as a list of offsets for each section of the file. This section is always 224 bytes long (it's actually 220 + 4 bytes of zero padding).
For simplification reasons, offsets described in this page are relative to this section of the file. That means that if you are reading the file from the start (the header) you need to add 16 bytes to get the correct offsets described in this page.
The first 4 byte number of note is at the 0xB4 offset. These 4 bytes contain a float value, which describes how long the animation is in seconds. This value is important, I will hereby denote it as ANIMLENGTH in other sections.
The next 36 bytes of the file contain 4 byte integers representing the offsets for the 9 sections of the file. These offsets are relative to this section, thus if you are reading from the start of the file (the header), you must add 16 bytes to them in order to get the correct offsets.
The offset values are not necessarily in ascending order. However in practice this only does not hold true for the first two offsets (they are swapped, so the first offset points to section 2 while the second points to section 1), all the other offsets are in ascending order. The offset values can also be zero, meaning the section does not exist.
To calculate the size of each section, you must subtract the offset by the next largest one. This will, unfortunately, not tell you padding bytes. To calculate the size of the last section, you simply count the bytes from the start of this section and subtract by the final offset value (or if you prefer, take the size of the entire mab file, subtract 16 (the size of the header), and then subtract it by the final offset value.
The last 4 bytes of this section are always zero padding.