mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-22 18:26:39 +00:00
Support for the "boot" partition in Terra gamecards.
This commit is contained in:
parent
eba26a59a5
commit
88d3e0de8d
3 changed files with 8 additions and 5 deletions
|
@ -144,7 +144,7 @@ static GameCardHashFileSystemHeader *gamecardGetHashFileSystemPartitionHeader(u8
|
||||||
NX_INLINE GameCardHashFileSystemEntry *gamecardGetHashFileSystemEntryByIndex(void *header, u32 idx);
|
NX_INLINE GameCardHashFileSystemEntry *gamecardGetHashFileSystemEntryByIndex(void *header, u32 idx);
|
||||||
NX_INLINE char *gamecardGetHashFileSystemNameTable(void *header);
|
NX_INLINE char *gamecardGetHashFileSystemNameTable(void *header);
|
||||||
NX_INLINE char *gamecardGetHashFileSystemEntryNameByIndex(void *header, u32 idx);
|
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)
|
bool gamecardInitialize(void)
|
||||||
{
|
{
|
||||||
|
@ -410,7 +410,7 @@ bool gamecardGetEntryInfoFromHashFileSystemPartitionByIndex(u8 hfs_partition_typ
|
||||||
{
|
{
|
||||||
if (hfs_partition_type == GameCardHashFileSystemPartitionType_Root)
|
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 {
|
} else {
|
||||||
*out_offset = (g_gameCardHfsPartitions[hfs_partition_idx].offset + g_gameCardHfsPartitions[hfs_partition_idx].header_size + fs_entry->offset);
|
*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);
|
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;
|
size_t name_len = 0;
|
||||||
GameCardHashFileSystemEntry *fs_entry = NULL;
|
GameCardHashFileSystemEntry *fs_entry = NULL;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#define GAMECARD_HFS_PARTITION_NAME(x) ((x) == GameCardHashFileSystemPartitionType_Root ? "root" : ((x) == GameCardHashFileSystemPartitionType_Update ? "update" : \
|
#define GAMECARD_HFS_PARTITION_NAME(x) ((x) == GameCardHashFileSystemPartitionType_Root ? "root" : ((x) == GameCardHashFileSystemPartitionType_Update ? "update" : \
|
||||||
((x) == GameCardHashFileSystemPartitionType_Logo ? "logo" : ((x) == GameCardHashFileSystemPartitionType_Normal ? "normal" : \
|
((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.
|
/// Plaintext area. Dumped from FS program memory.
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -182,7 +182,8 @@ typedef enum {
|
||||||
GameCardHashFileSystemPartitionType_Update = 1,
|
GameCardHashFileSystemPartitionType_Update = 1,
|
||||||
GameCardHashFileSystemPartitionType_Logo = 2, ///< Only available in GameCardFwVersion_Since400NUP gamecards.
|
GameCardHashFileSystemPartitionType_Logo = 2, ///< Only available in GameCardFwVersion_Since400NUP gamecards.
|
||||||
GameCardHashFileSystemPartitionType_Normal = 3,
|
GameCardHashFileSystemPartitionType_Normal = 3,
|
||||||
GameCardHashFileSystemPartitionType_Secure = 4
|
GameCardHashFileSystemPartitionType_Secure = 4,
|
||||||
|
GameCardHashFileSystemPartitionType_Boot = 5 ///< Only available in Terra (Tencent) gamecards.
|
||||||
} GameCardHashFileSystemPartitionType;
|
} GameCardHashFileSystemPartitionType;
|
||||||
|
|
||||||
/// Initializes data needed to access raw gamecard storage areas.
|
/// Initializes data needed to access raw gamecard storage areas.
|
||||||
|
|
|
@ -484,6 +484,8 @@ out2:
|
||||||
|
|
||||||
bktrFreeContext(&bktr_ctx);
|
bktrFreeContext(&bktr_ctx);
|
||||||
|
|
||||||
|
if (serviceIsActive(&(resolver.s))) serviceClose(&(resolver.s));
|
||||||
|
|
||||||
lrExit();
|
lrExit();
|
||||||
|
|
||||||
if (serviceIsActive(&(ncm_storage_emmc.s))) ncmContentStorageClose(&ncm_storage_emmc);
|
if (serviceIsActive(&(ncm_storage_emmc.s))) ncmContentStorageClose(&ncm_storage_emmc);
|
||||||
|
|
Loading…
Reference in a new issue