mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 19:26:55 -04:00
Loader: Implement ldr:ro->LoadNRR(). NOTE: No sigchecks, at the moment.
This commit is contained in:
parent
789afe7929
commit
8524f284fd
6 changed files with 143 additions and 25 deletions
33
stratosphere/loader/source/ldr_nro.hpp
Normal file
33
stratosphere/loader/source/ldr_nro.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <cstdio>
|
||||
|
||||
#define MAGIC_NRO0 0x304F524E
|
||||
#define MAGIC_NRR0 0x3052524E
|
||||
|
||||
class NroUtils {
|
||||
public:
|
||||
struct NrrHeader {
|
||||
u32 magic;
|
||||
u32 _0x4;
|
||||
u32 _0x8;
|
||||
u32 _0xC;
|
||||
u64 title_id_mask;
|
||||
u64 title_id_pattern;
|
||||
u64 _0x20;
|
||||
u64 _0x28;
|
||||
u8 modulus[0x100];
|
||||
u8 fixed_key_signature[0x100];
|
||||
u8 nrr_signature[0x100];
|
||||
u64 title_id_min;
|
||||
u32 nrr_size;
|
||||
u32 _0x33C;
|
||||
u32 hash_offset;
|
||||
u32 num_hashes;
|
||||
u64 _0x348;
|
||||
};
|
||||
|
||||
|
||||
static_assert(sizeof(NrrHeader) == 0x350, "Incorrectly defined NrrHeader!");
|
||||
static Result ValidateNrrHeader(NrrHeader *header, u64 size, u64 title_id_min);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue