fusee: add package3 magic

This commit is contained in:
Michael Scire 2021-09-05 22:59:54 -07:00 committed by SciresM
parent 715eacbf8e
commit 4ad300c33c
2 changed files with 8 additions and 7 deletions

View file

@ -52,8 +52,8 @@ def write_kip_meta(f, kip, ofs):
def write_header(f, all_kips, wb_size, tk_size, xf_size, ex_size, ms_size, fs_size, rb_size, git_revision, major, minor, micro, relstep, s_major, s_minor, s_micro, s_relstep): def write_header(f, all_kips, wb_size, tk_size, xf_size, ex_size, ms_size, fs_size, rb_size, git_revision, major, minor, micro, relstep, s_major, s_minor, s_micro, s_relstep):
# Unpack kips # Unpack kips
emummc, kips = all_kips emummc, kips = all_kips
# Write reserved0 (previously entrypoint) as infinite loop instruction. # Write magic as PK31 magic.
f.write(pk('<I', 0xEAFFFFFE)) f.write(b'PK31')
# Write metadata offset = 0x10 # Write metadata offset = 0x10
f.write(pk('<I', 0x20)) f.write(pk('<I', 0x20))
# Write flags # Write flags
@ -64,8 +64,8 @@ def write_header(f, all_kips, wb_size, tk_size, xf_size, ex_size, ms_size, fs_si
f.write(pk('<I', len(KIP_NAMES))) f.write(pk('<I', len(KIP_NAMES)))
# Write reserved1 # Write reserved1
f.write(b'\xCC' * 0xC) f.write(b'\xCC' * 0xC)
# Write magic # Write legacy magic
f.write('FSS0') f.write(b'FSS0')
# Write total size # Write total size
f.write(pk('<I', 0x800000)) f.write(pk('<I', 0x800000))
# Write reserved2 # Write reserved2

View file

@ -42,15 +42,16 @@ namespace ams::nxboot {
static_assert(sizeof(ExternalPackageKipMeta) == 0x30); static_assert(sizeof(ExternalPackageKipMeta) == 0x30);
struct ExternalPackageHeader { struct ExternalPackageHeader {
static constexpr u32 Magic = util::FourCC<'F','S','S','0'>::Code; static constexpr u32 Magic = util::FourCC<'P', 'K', '3', '1'>::Code;
static constexpr u32 LegacyMagic = util::FourCC<'F','S','S','0'>::Code;
u32 reserved0; /* Previously entrypoint. */ u32 magic; /* Previously entrypoint. */
u32 metadata_offset; u32 metadata_offset;
u32 flags; u32 flags;
u32 meso_size; u32 meso_size;
u32 num_kips; u32 num_kips;
u32 reserved1[3]; u32 reserved1[3];
u32 magic; u32 legacy_magic;
u32 total_size; u32 total_size;
u32 reserved2; /* Previously crt0 offset. */ u32 reserved2; /* Previously crt0 offset. */
u32 content_header_offset; u32 content_header_offset;