Skip to content

Instantly share code, notes, and snippets.

@ZeroSkill1
ZeroSkill1 / verify_ncch_extheader_signature.py
Created June 29, 2022 19:44
useful for assisting with achieving the recreation of a signed NCCH header, requires dumped ARM9 ITCM (obtainable via gm9 in M:/itcm.mem), extheader.bin and ncch.bin in the current working directory
from cryptography.hazmat.primitives.asymmetric.padding import PKCS1v15 as pd
from cryptography.hazmat.primitives.hashes import SHA256 as sha256
from cryptography.hazmat.primitives.asymmetric import rsa
import cryptography.hazmat.backends
with open("ncch.bin", "rb") as f:
ncch_sig = f.read(0x100)
ncch_header_data = f.read(0x100)
with open("extheader.bin", "rb") as f: