From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:RPX and RPL" |
|---|
| claim | "A section with flag 0x08000000 (SHF_DEFLATED / SHF_RPL_COMPRESSED) stores a big-endian u32 inflated size followed by a zlib stream (Cemu inflates it with Z_FULL_FLUSH and requires all input consumed and exactly the inflated size produced); the section header's size is the stored (compressed) size including the 4 size bytes. The flag is set per section: elf2rpl (wut-tools) deflates a section (zlib level 6, writes the inflated size into the first four bytes, sets the flag) only if it is at least 0x18 bytes and is not an RPL CRC section (SHT_RPL_CRCS) or file-info section (SHT_RPL_FILEINFO), so those two types and small sections stay uncompressed." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:RPX and RPL" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "section flags & 0x08000000" |
|---|
| effect | "data = be32 inflatedSize + zlib stream" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "DeflatedHeader { u32 inflatedSize }; relocation sections read their size from the first word when SHF_DEFLATED" |
|---|
| repo | "https://github.com/decaf-emu/decaf-emu" |
|---|
| commit | "e6c528a20a41c34e0f9eb91dd3da40f119db2dee" |
|---|
| path | "src/libdecaf/src/cafe/loader/cafe_loader_reloc.cpp" |
|---|
| lines | "418-420" |
|---|
|
| type | "source" |
|---|
| detail | "uncompressedSize read as uint32be at section file offset, then inflateInit/inflate into a buffer of that size (sections over 1 GB refused)" |
|---|
| repo | "https://github.com/cemu-project/Cemu" |
|---|
| commit | "a53cf0ece75964aa361056edab46f281dcc0bc44" |
|---|
| path | "src/Cafe/OS/RPL/rpl.cpp" |
|---|
| lines | "383-415" |
|---|
|
| type | "source" |
|---|
| detail | "elf2rpl writes the inflated size into deflated[0] and sets SHF_DEFLATED" |
|---|
| repo | "https://github.com/devkitPro/wut-tools" |
|---|
| commit | "b22de1a3c0c8950c4ad4b4df170c89c05d3196aa" |
|---|
| path | "src/elf2rpl/main.cpp" |
|---|
| lines | "690-700" |
|---|
|
| type | "source" |
|---|
| detail | "deflateSections skips sections smaller than DeflateMinSectionSize (0x18) and types SHT_RPL_CRCS / SHT_RPL_FILEINFO; deflate level 6; 4-byte be32 inflated size prepended; SHF_DEFLATED set. Read the whole function." |
|---|
| repo | "https://github.com/devkitPro/wut-tools" |
|---|
| commit | "b22de1a3c0c8950c4ad4b4df170c89c05d3196aa" |
|---|
| path | "src/elf2rpl/main.cpp" |
|---|
| lines | "648-702" |
|---|
|
| type | "source" |
|---|
| detail | "Cemu section loader: SHF_RPL_COMPRESSED branch reads be32 size, rejects >= 1 GB, inflates sectionSize - 4 bytes with Z_FULL_FLUSH and checks avail_in == 0 and avail_out == 0" |
|---|
| repo | "https://github.com/cemu-project/Cemu" |
|---|
| commit | "a53cf0ece75964aa361056edab46f281dcc0bc44" |
|---|
| path | "src/Cafe/OS/RPL/rpl.cpp" |
|---|
| lines | "381-420" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Deflated section layout" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T14:58:35.433Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:48:13.678Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read elf2rpl deflateSections in wut-tools main.cpp at b22de1a: skips data.size() < 0x18 and SHT_RPL_CRCS / SHT_RPL_FILEINFO, deflateInit level 6, be32 inflated size prepended, SHF_DEFLATED set per section. Cemu and decaf sides not re-read this round." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:03:34.644Z" |
|---|
| summary | "elf2rpl does not deflate every section: CRC sections, file-info sections and sections under 0x18 bytes are left alone; flag is per section" |
|---|
| changed | |
|---|
|
|
|---|