Commit Graph
6 Commits
Author SHA1 Message Date
Adrià af7db81e6e Merge pull request #6065 from MiniRML/fix/unwrap-elf-metadata-bounds
fix(tools): validate inner ELF metadata before unwrapping SELF
2026-10-16 23:51:42 +02:00
Adrià 8ac10e7a09 Merge pull request #6050 from MiniRML/fix/unwrap-program-header-space
fix(tools): reserve program header space when unwrapping SELF
2026-10-16 23:25:13 +02:00
MiniRML 2df4c76f5b fix(tools): validate inner ELF metadata before unwrapping SELF 2026-10-14 14:07:38 -07:00
MiniRML 9936b8b9ee fix(tools): reserve program header space when unwrapping SELF 2026-10-14 13:53:31 -07:00
kjhq 019285d46f fix(tools): place an empty segment that ends a load segment in unwrap_self
unwrap_self refused a container when a non-load segment with no file data
sat exactly at the end of a PT_LOAD, as an empty PT_TLS does in Sifu
(PPSA03001): "segment 6 vaddr 0x88cb7a0 is in no PT_LOAD". The eboot and
36 of its 37 bundled modules carry such a segment. A segment of size zero
now matches the load segment it ends, so it is placed at that segment's end.
2026-10-14 15:24:14 +00:00
ryyReid 2a01e9eb18 feat(tools): unwrap decrypted SELF containers into clean ELF
The relinker reads a plain ELF executable and skips SELF containers with a
warning, so an eboot.bin or a *.prx taken from a title cannot be relinked
before it is unwrapped, and the repository has no tool for that.

The inner ELF program headers of a container carry stale offsets: a SELF
inserts its own metadata blocks between the segments, so the data sits at the
offsets of the SELF segment-record table at file offset 0x40. The segments are
also packed without honouring p_align, while ELF requires p_offset % p_align
== p_vaddr % p_align, which the relinker enforces on guest modules. The tool
places the segments from the records, falls back to the vaddr to file mapping
of the containing PT_LOAD for segments the table does not cover, copies every
region to an offset satisfying the alignment, and refuses a container whose
load segments all look encrypted.
2026-10-13 19:23:51 -05:00