forked from Mirror/GodMode9
CheckNcchCrypto() -> SetupNcchCrypto()
This commit is contained in:
parent
310159f0cb
commit
514e57c1f4
@ -193,8 +193,9 @@ u32 SetNcchKey(NcchHeader* ncch, u32 keyid) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 CheckNcchCrypto(NcchHeader* ncch) {
|
u32 SetupNcchCrypto(NcchHeader* ncch) {
|
||||||
return ((SetNcchKey(ncch, 0) == 0) && (SetNcchKey(ncch, 1) == 0)) ? 0 : 1;
|
return (!NCCH_ENCRYPTED(ncch) ||
|
||||||
|
((SetNcchKey(ncch, 0) == 0) && (SetNcchKey(ncch, 1) == 0))) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 DecryptNcchSection(u8* data, u32 offset_data, u32 size_data,
|
u32 DecryptNcchSection(u8* data, u32 offset_data, u32 size_data,
|
||||||
|
@ -60,5 +60,5 @@ typedef struct {
|
|||||||
} __attribute__((packed)) NcchHeader;
|
} __attribute__((packed)) NcchHeader;
|
||||||
|
|
||||||
u32 ValidateNcchHeader(NcchHeader* header);
|
u32 ValidateNcchHeader(NcchHeader* header);
|
||||||
u32 CheckNcchCrypto(NcchHeader* ncch);
|
u32 SetupNcchCrypto(NcchHeader* ncch);
|
||||||
u32 DecryptNcch(u8* data, u32 offset, u32 size, NcchHeader* ncch, ExeFsHeader* exefs);
|
u32 DecryptNcch(u8* data, u32 offset, u32 size, NcchHeader* ncch, ExeFsHeader* exefs);
|
||||||
|
@ -92,7 +92,7 @@ bool BuildVGameNcchDir(void) {
|
|||||||
u32 n = 0;
|
u32 n = 0;
|
||||||
|
|
||||||
// NCCH crypto
|
// NCCH crypto
|
||||||
bool ncch_crypto = (CheckNcchCrypto(ncch) == 0);
|
bool ncch_crypto = (NCCH_ENCRYPTED(ncch)) && (SetupNcchCrypto(ncch) == 0);
|
||||||
|
|
||||||
// header
|
// header
|
||||||
strncpy(templates[n].name, NAME_NCCH_HEADER, 32);
|
strncpy(templates[n].name, NAME_NCCH_HEADER, 32);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user