mirror of
https://github.com/shijimasoft/cia-unix.git
synced 2025-06-18 22:35:41 -04:00
Merge pull request #33 from R-YaTian/seed_fix
Further fix for seed crypto things
This commit is contained in:
commit
17a0143af4
@ -49,7 +49,7 @@ class NcchHdr(Structure):
|
|||||||
("makerCode", c_uint16),
|
("makerCode", c_uint16),
|
||||||
("formatVersion", c_uint8),
|
("formatVersion", c_uint8),
|
||||||
("formatVersion2", c_uint8),
|
("formatVersion2", c_uint8),
|
||||||
("seedcheck", c_char * 4),
|
("seedcheck", c_uint8 * 4),
|
||||||
("programId", c_uint8 * 8),
|
("programId", c_uint8 * 8),
|
||||||
("padding1", c_uint8 * 16),
|
("padding1", c_uint8 * 16),
|
||||||
("logoHash", c_uint8 * 32),
|
("logoHash", c_uint8 * 32),
|
||||||
@ -349,7 +349,7 @@ def parseNCCH(fh, fsize, offs=0, idx=0, contentId=0, titleId="", standAlone=1, f
|
|||||||
fixedCrypto = 0
|
fixedCrypto = 0
|
||||||
encrypted = 1
|
encrypted = 1
|
||||||
if header.flags[7] & 1:
|
if header.flags[7] & 1:
|
||||||
fixedCrypto = 2 if header.titleId[3] & 16 else 1
|
fixedCrypto = 2 if bytearray(header.titleId[::-1])[3] & 16 else 1
|
||||||
print((tab + "Uses fixed-key crypto"))
|
print((tab + "Uses fixed-key crypto"))
|
||||||
if header.flags[7] & 4:
|
if header.flags[7] & 4:
|
||||||
encrypted = 0
|
encrypted = 0
|
||||||
@ -357,7 +357,7 @@ def parseNCCH(fh, fsize, offs=0, idx=0, contentId=0, titleId="", standAlone=1, f
|
|||||||
useSeedCrypto = header.flags[7] & 32 != 0
|
useSeedCrypto = header.flags[7] & 32 != 0
|
||||||
keyY = ncchKeyY
|
keyY = ncchKeyY
|
||||||
if useSeedCrypto:
|
if useSeedCrypto:
|
||||||
keyY = getNewkeyY(ncchKeyY, header, hexlify(titleId))
|
keyY = getNewkeyY(ncchKeyY, header, hexlify(unhexlify(titleId)))
|
||||||
print((tab + "Uses 9.6 NCCH Seed crypto with KeyY: %032X" % keyY))
|
print((tab + "Uses 9.6 NCCH Seed crypto with KeyY: %032X" % keyY))
|
||||||
print("")
|
print("")
|
||||||
base = os.path.splitext(os.path.basename(fh.name))[0]
|
base = os.path.splitext(os.path.basename(fh.name))[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user