Loader: Implement NSO Extent calculation (note: ASLR currently disabled due to lack of entropy source.)

This commit is contained in:
Michael Scire
2018-04-24 04:41:29 -06:00
parent 6afd59d2a2
commit b11c2fe755
3 changed files with 103 additions and 1 deletions

View File

@@ -28,6 +28,15 @@ class NsoUtils {
u8 section_hashes[3][0x20];
};
struct NsoLoadExtents {
u64 base_address;
u64 total_size;
u64 args_address;
u64 args_size;
u64 nso_addresses[NSO_NUM_MAX];
u64 nso_sizes[NSO_NUM_MAX];
};
static_assert(sizeof(NsoHeader) == 0x100, "Incorrectly defined NsoHeader!");
@@ -72,4 +81,5 @@ class NsoUtils {
static bool IsNsoPresent(unsigned int index);
static Result LoadNsoHeaders(u64 title_id);
static Result ValidateNsoLoadSet();
static Result CalculateNsoLoadExtents(u32 addspace_type, u32 args_size, NsoLoadExtents *extents);
};