mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
Store program ID and expose it in Lua (#414)
This commit is contained in:
parent
7b580ac80e
commit
6279ed699a
8 changed files with 66 additions and 22 deletions
|
@ -32,7 +32,7 @@ bool NCCH::loadFromHeader(Crypto::AESEngine &aesEngine, IOFile& file, const FSIn
|
|||
size = u64(*(u32*)&header[0x104]) * mediaUnit; // TODO: Maybe don't type pun because big endian will break
|
||||
exheaderSize = *(u32*)&header[0x180];
|
||||
|
||||
const u64 programID = *(u64*)&header[0x118];
|
||||
programID = *(u64*)&header[0x118];
|
||||
|
||||
// Read NCCH flags
|
||||
secondaryKeySlot = header[0x188 + 3];
|
||||
|
|
|
@ -524,4 +524,14 @@ void Memory::copySharedFont(u8* pointer) {
|
|||
auto fonts = cmrc::ConsoleFonts::get_filesystem();
|
||||
auto font = fonts.open("CitraSharedFontUSRelocated.bin");
|
||||
std::memcpy(pointer, font.begin(), font.size());
|
||||
}
|
||||
|
||||
std::optional<u64> Memory::getProgramID() {
|
||||
auto cxi = getCXI();
|
||||
|
||||
if (cxi) {
|
||||
return cxi->programID;
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue