mirror of
https://github.com/jakcron/nstool
synced 2024-11-15 02:06:40 +00:00
[nx] Typos
This commit is contained in:
parent
28f92b78c8
commit
b7175f7f5c
2 changed files with 5 additions and 5 deletions
|
@ -60,10 +60,10 @@ void nx::NcaHeader::toBytes()
|
||||||
switch(mFormatVersion)
|
switch(mFormatVersion)
|
||||||
{
|
{
|
||||||
case (NCA2_FORMAT):
|
case (NCA2_FORMAT):
|
||||||
hdr->st_magic = nca::kNca2StMagic;
|
hdr->st_magic = nca::kNca2StructMagic;
|
||||||
break;
|
break;
|
||||||
case (NCA3_FORMAT):
|
case (NCA3_FORMAT):
|
||||||
hdr->st_magic = nca::kNca3StMagic;
|
hdr->st_magic = nca::kNca3StructMagic;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw fnd::Exception(kModuleName, "Unsupported format version");
|
throw fnd::Exception(kModuleName, "Unsupported format version");
|
||||||
|
@ -124,10 +124,10 @@ void nx::NcaHeader::fromBytes(const byte_t * data, size_t len)
|
||||||
|
|
||||||
switch(hdr->st_magic.get())
|
switch(hdr->st_magic.get())
|
||||||
{
|
{
|
||||||
case (nca::kNca2StMagic) :
|
case (nca::kNca2StructMagic) :
|
||||||
mFormatVersion = NCA2_FORMAT;
|
mFormatVersion = NCA2_FORMAT;
|
||||||
break;
|
break;
|
||||||
case (nca::kNca3StMagic) :
|
case (nca::kNca3StructMagic) :
|
||||||
mFormatVersion = NCA3_FORMAT;
|
mFormatVersion = NCA3_FORMAT;
|
||||||
break;
|
break;
|
||||||
throw fnd::Exception(kModuleName, "NCA header corrupt");
|
throw fnd::Exception(kModuleName, "NCA header corrupt");
|
||||||
|
|
|
@ -9,7 +9,7 @@ void nx::NcaUtils::decryptNcaHeader(const byte_t* src, byte_t* dst, const crypto
|
||||||
crypto::aes::AesXtsMakeTweak(tweak, 1);
|
crypto::aes::AesXtsMakeTweak(tweak, 1);
|
||||||
crypto::aes::AesXtsDecryptSector(src + sectorToOffset(1), nx::nca::kSectorSize, key.key[0], key.key[1], tweak, raw_hdr);
|
crypto::aes::AesXtsDecryptSector(src + sectorToOffset(1), nx::nca::kSectorSize, key.key[0], key.key[1], tweak, raw_hdr);
|
||||||
|
|
||||||
bool useNca2SectorIndex = ((nx::sNcaHeader*)(raw_hdr))->st_magic.get() == nx::nca::kNca2StMagic;
|
bool useNca2SectorIndex = ((nx::sNcaHeader*)(raw_hdr))->st_magic.get() == nx::nca::kNca2StructMagic;
|
||||||
|
|
||||||
// decrypt whole header
|
// decrypt whole header
|
||||||
for (size_t i = 0; i < nx::nca::kHeaderSectorNum; i++)
|
for (size_t i = 0; i < nx::nca::kHeaderSectorNum; i++)
|
||||||
|
|
Loading…
Reference in a new issue