mirror of
https://github.com/devine-dl/replayready.git
synced 2025-04-29 17:39:43 +00:00
Update zgpriv_protected_dec.py
- write zgpriv to disk instead of hex output to console - removed the last 16 bytes
This commit is contained in:
parent
24ee589e0c
commit
a5f80f536f
@ -12,7 +12,7 @@ def main() -> None:
|
|||||||
AES-Key unwrap zlpriv_protected.dat with the KEK
|
AES-Key unwrap zlpriv_protected.dat with the KEK
|
||||||
|
|
||||||
Derivation function uses the TK (given in PR3.3 source) as the AES Key for OMAC1 (CMAC)
|
Derivation function uses the TK (given in PR3.3 source) as the AES Key for OMAC1 (CMAC)
|
||||||
sign function. Data is IK + a couple of zeros.
|
sign function.
|
||||||
|
|
||||||
Oem_Aes_AES128KDFCTR_r8_L128()
|
Oem_Aes_AES128KDFCTR_r8_L128()
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ def main() -> None:
|
|||||||
Context is 16 bytes zero.
|
Context is 16 bytes zero.
|
||||||
Label = IK
|
Label = IK
|
||||||
i = 1
|
i = 1
|
||||||
L = 128 (int)
|
L = 128 (0x80)
|
||||||
'''
|
'''
|
||||||
cmac_secret = bytes.fromhex("8B222FFD1E76195659CF2703898C427F")
|
cmac_secret = bytes.fromhex("8B222FFD1E76195659CF2703898C427F")
|
||||||
cmac = CMAC.new(cmac_secret, ciphermod=AES)
|
cmac = CMAC.new(cmac_secret, ciphermod=AES)
|
||||||
@ -31,11 +31,14 @@ def main() -> None:
|
|||||||
cmac.update(cmac_data)
|
cmac.update(cmac_data)
|
||||||
|
|
||||||
KEK = cmac.hexdigest()
|
KEK = cmac.hexdigest()
|
||||||
print(KEK)
|
# KEK = "8f0618e44af40cd782525b7851c51a7c"
|
||||||
with open("zlpriv_protected.dat", "rb") as f:
|
|
||||||
zlprotec = f.read()
|
with open("zgpriv_protected.dat", "rb") as f:
|
||||||
|
zgprotec = f.read()
|
||||||
|
|
||||||
print(aes_key_unwrap(bytes.fromhex(KEK), zlprotec).hex())
|
with open("zgpriv.dat", "wb") as f:
|
||||||
|
f.write(aes_key_unwrap(bytes.fromhex(KEK), zgprotec)[:32])
|
||||||
|
print("[+] Decrypted zgpriv written to disk.")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user