BFEVFL: Difference between revisions
Jump to navigation
Jump to search
no edit summary
imported>Leoetlino No edit summary |
imported>Leoetlino No edit summary |
||
Line 7: | Line 7: | ||
As a direct consequence, most sections don't have any fixed order. Therefore, this article will only document the data structures and mention the order Nintendo places sections in. For more details, it is recommended to look at the [https://github.com/leoetlino/evfl <code>evfl</code> library] directly. | As a direct consequence, most sections don't have any fixed order. Therefore, this article will only document the data structures and mention the order Nintendo places sections in. For more details, it is recommended to look at the [https://github.com/leoetlino/evfl <code>evfl</code> library] directly. | ||
Another consequence is that sections must be aligned to 8-byte boundaries in most cases to avoid unaligned memory accesses (this is not as important for strings). | |||
=== Header === | === Header === | ||
Line 52: | Line 54: | ||
=== Relocation table === | === Relocation table === | ||
{{ | {|class="wikitable" | ||
! Offset !! Type !! Description | |||
|- | |||
| 0x0 || char[4] || Magic ("RELT") | |||
|- | |||
| 0x4 || u32 || Offset to relocation table start | |||
|- | |||
| 0x8 || u32 || Number of sections (almost always 1) | |||
|- | |||
| 0xc || u32 || Padding | |||
|- | |||
| 0x10 || Section[num_sections] || Sections | |||
|} | |||
==== Relocation table section ==== | |||
{|class="wikitable" | |||
! Offset !! Type !! Description | |||
|- | |||
| 0x0 || void* || Alternative base offset (unused by Nintendo) | |||
|- | |||
| 0x8 || u32 || Used to calculate the base pointer if an alternative base offset is used | |||
|- | |||
| 0xc || u32 || Data end offset (before alignment) | |||
|- | |||
| 0x10 || u32 || Number of entries to skip | |||
|- | |||
| 0x14 || u32 || Number of entries (includes skipped entries) | |||
|- | |||
| 0x18 || Entry[num_entries] || Entries | |||
|} | |||
==== Relocation table entry ==== | |||
{|class="wikitable" | |||
! Offset !! Type !! Description | |||
|- | |||
| 0x0 || u32 || Offset to pointers to relocate | |||
|- | |||
| 0x4 || u32 || Bit field that determines which pointers need to be relocated (up to 32 contiguous pointers starting from the listed offset) | |||
|} | |||
=== Dictionary === | === Dictionary === | ||
Line 58: | Line 98: | ||
=== Container === | === Container === | ||
{{empty section}} | |||
=== Flowchart === | === Flowchart === |