1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-12-23 09:02:06 +00:00

Support for the "boot" partition in Terra gamecards.

This commit is contained in:
Pablo Curiel 2020-07-15 19:43:58 -04:00
parent eba26a59a5
commit 88d3e0de8d
3 changed files with 8 additions and 5 deletions

View file

@ -144,7 +144,7 @@ static GameCardHashFileSystemHeader *gamecardGetHashFileSystemPartitionHeader(u8
NX_INLINE GameCardHashFileSystemEntry *gamecardGetHashFileSystemEntryByIndex(void *header, u32 idx);
NX_INLINE char *gamecardGetHashFileSystemNameTable(void *header);
NX_INLINE char *gamecardGetHashFileSystemEntryNameByIndex(void *header, u32 idx);
NX_INLINE bool gamecardGetHashFileSystemEntryIndexByName(void *header, const char *name, u32 *out_idx);
static bool gamecardGetHashFileSystemEntryIndexByName(void *header, const char *name, u32 *out_idx);
bool gamecardInitialize(void)
{
@ -410,7 +410,7 @@ bool gamecardGetEntryInfoFromHashFileSystemPartitionByIndex(u8 hfs_partition_typ
{
if (hfs_partition_type == GameCardHashFileSystemPartitionType_Root)
{
*out_offset = g_gameCardHfsPartitions[idx].offset; /* No need to recalculate what we already have */
*out_offset = g_gameCardHfsPartitions[idx].offset; /* No need to recalculate what we already have. */
} else {
*out_offset = (g_gameCardHfsPartitions[hfs_partition_idx].offset + g_gameCardHfsPartitions[hfs_partition_idx].header_size + fs_entry->offset);
}
@ -1108,7 +1108,7 @@ NX_INLINE char *gamecardGetHashFileSystemEntryNameByIndex(void *header, u32 idx)
return (name_table + fs_entry->name_offset);
}
NX_INLINE bool gamecardGetHashFileSystemEntryIndexByName(void *header, const char *name, u32 *out_idx)
static bool gamecardGetHashFileSystemEntryIndexByName(void *header, const char *name, u32 *out_idx)
{
size_t name_len = 0;
GameCardHashFileSystemEntry *fs_entry = NULL;

View file

@ -34,7 +34,7 @@
#define GAMECARD_HFS_PARTITION_NAME(x) ((x) == GameCardHashFileSystemPartitionType_Root ? "root" : ((x) == GameCardHashFileSystemPartitionType_Update ? "update" : \
((x) == GameCardHashFileSystemPartitionType_Logo ? "logo" : ((x) == GameCardHashFileSystemPartitionType_Normal ? "normal" : \
((x) == GameCardHashFileSystemPartitionType_Secure ? "secure" : "unknown")))))
((x) == GameCardHashFileSystemPartitionType_Secure ? "secure" : ((x) == GameCardHashFileSystemPartitionType_Boot ? "boot" : "unknown"))))))
/// Plaintext area. Dumped from FS program memory.
typedef struct {
@ -182,7 +182,8 @@ typedef enum {
GameCardHashFileSystemPartitionType_Update = 1,
GameCardHashFileSystemPartitionType_Logo = 2, ///< Only available in GameCardFwVersion_Since400NUP gamecards.
GameCardHashFileSystemPartitionType_Normal = 3,
GameCardHashFileSystemPartitionType_Secure = 4
GameCardHashFileSystemPartitionType_Secure = 4,
GameCardHashFileSystemPartitionType_Boot = 5 ///< Only available in Terra (Tencent) gamecards.
} GameCardHashFileSystemPartitionType;
/// Initializes data needed to access raw gamecard storage areas.

View file

@ -484,6 +484,8 @@ out2:
bktrFreeContext(&bktr_ctx);
if (serviceIsActive(&(resolver.s))) serviceClose(&(resolver.s));
lrExit();
if (serviceIsActive(&(ncm_storage_emmc.s))) ncmContentStorageClose(&ncm_storage_emmc);