Implement loading of exheaders from SD/CTRNAND (must be called luma/titles/TITLEID/exheader.bin), thanks to @HiddenRambler!

This commit is contained in:
Aurora Wright
2017-08-01 17:27:14 +02:00
parent 3907c46980
commit a0c2b43b34
3 changed files with 140 additions and 88 deletions

View File

@@ -1,6 +1,8 @@
#pragma once
#include <3ds/types.h>
#include "exheader.h"
#include "ifile.h"
#define MAKE_BRANCH(src,dst) (0xEA000000 | ((u32)((((u8 *)(dst) - (u8 *)(src)) >> 2) - 2) & 0xFFFFFF))
#define MAKE_BRANCH_LINK(src,dst) (0xEB000000 | ((u32)((((u8 *)(dst) - (u8 *)(src)) >> 2) - 2) & 0xFFFFFF))
@@ -35,4 +37,10 @@ enum singleOptions
DISABLEARM11EXCHANDLERS
};
extern u32 config, multiConfig, bootConfig;
extern bool isN3DS, isSafeMode, isSdMode;
void patchCode(u64 progId, u16 progVer, u8 *code, u32 size, u32 textSize, u32 roSize, u32 dataSize, u32 roAddress, u32 dataAddress);
Result fileOpen(IFile *file, FS_ArchiveID archiveId, const char *path, int flags);
bool loadTitleCodeSection(u64 progId, u8 *code, u32 size);
bool loadTitleExheader(u64 progId, exheader_header *exheader);