mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-19 09:25:08 -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
28
stratosphere/loader/source/ldr_nro.cpp
Normal file
28
stratosphere/loader/source/ldr_nro.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <switch.h>
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <picosha2.hpp>
|
||||
#include "ldr_nro.hpp"
|
||||
#include "ldr_map.hpp"
|
||||
#include "ldr_random.hpp"
|
||||
|
||||
Result NroUtils::ValidateNrrHeader(NrrHeader *header, u64 size, u64 title_id_min) {
|
||||
if (header->magic != MAGIC_NRR0) {
|
||||
return 0x6A09;
|
||||
}
|
||||
if (header->nrr_size != size) {
|
||||
return 0xA409;
|
||||
}
|
||||
|
||||
/* TODO: Check NRR signature. */
|
||||
if (false) {
|
||||
return 0x6C09;
|
||||
}
|
||||
|
||||
if (header->title_id_min != title_id_min) {
|
||||
return 0x6A09;
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue