mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
Merge pull request #1317 from Dextroid17/fix/name-both-self-container-magics
fix(relinker): name the second SELF container magic as a SELF input
This commit is contained in:
@@ -74,7 +74,8 @@ ElfHeader ElfReader::ReadHeader() const {
|
||||
throw RelinkerException("File too small for ELF header");
|
||||
}
|
||||
|
||||
if (_fileBuffer[0] == 0x4f && _fileBuffer[1] == 0x15 && _fileBuffer[2] == 0x3d && _fileBuffer[3] == 0x1d) {
|
||||
const std::uint32_t magic = _readU32At(0);
|
||||
if (magic == 0x1d3d154f || magic == 0xeef51454) {
|
||||
throw RelinkerException("The input is a SELF container, not an ELF");
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ def main():
|
||||
assert result.returncode == 2 and error in result.stderr and not output.exists(), (name, result)
|
||||
|
||||
convert("eboot.self", b"\x4f\x15\x3d\x1d" + bytes(0x1000), "The input is a SELF container, not an ELF")
|
||||
convert("eboot.self.kernel", b"\x54\x14\xf5\xee" + bytes(0x1000), "The input is a SELF container, not an ELF")
|
||||
convert("eboot.pkg", b"\x7fCNT" + bytes(0x1000), "Invalid ELF magic number: 7f 43 4e 54")
|
||||
convert("eboot.short", b"\x7fEL", "File too small for ELF header")
|
||||
print("Input magic diagnostics tests passed")
|
||||
|
||||
Reference in New Issue
Block a user