M2FixupRibbons
function · models · orchestration
- Address
0x71ef40· 708 bytes, up to0x71f203- Meaning
- Bounds-checks the 220-byte ribbon emitters and fixes up their arrays and tracks
- Confidence
- verified, proof one
- Finding
- models/shared#header-fixup
Finding: Header fixup in models: the shared model
The file starts with an MD20 header of version 0x100 or 0x101 and at least 0x154 bytes. Every
array is a count and an offset; the fixup checks that the array ends inside the file and replaces
the offset with a pointer, or with 0 for an empty array, and does the same inside the views,
colours, textures, transparencies, texture frames, texture transforms, attachments, events,
lights, cameras, ribbons and particles. Any check that fails makes the load fail.
| header | array | element |
|---|---|---|
+0x08 | name | 1 byte |
+0x14 to +0x2c | global sequences, sequences, sequence lookup, playable table | 4, 0x44, 2, 4 bytes |
+0x34, +0x3c, +0x44 | bones, key bone lookup, vertices | 0x6c, 2, 0x30 bytes |
+0x4c, +0x54, +0x5c | views, colours, textures | 0x2c, 0x38, 0x10 bytes |
+0x64, +0x6c, +0x74 | transparency, texture frames, texture transforms | 0x1c, 0x1c, 0x54 bytes |
+0x7c to +0xac | replaceable lookup, materials, then five 16-bit lookups | 2, 4, 2 bytes |
+0xec to +0xfc | collision indices, vertices, normals | 2, 12, 12 bytes |
+0x104 to +0x134 | attachments, attachment lookup, events, lights, cameras, camera lookup, ribbons | 0x30, 2, 0x2c, 0xd4, 0x7c, 2, 0xdc bytes |
+0x13c; +0x144, +0x14c | particles; two 16-bit arrays in version 0x101 | 0x1f8; 2 bytes |
The derivation is in the doc.
Callers 1
- M2FixupHeader models
Callees 6
- M2FixupArray8 models
- M2FixupArray4 models
- M2FixupArray2 models
- M2FixupArray12 models
- M2FixupArray2B models
- M2FixupArray4B models
Calls and jumps by a bare address, from tables/calls.tsv.