just put the keys out there idrc

This commit is contained in:
beerpsi 2024-07-18 03:19:08 +07:00
parent fce4269fc9
commit 8ca3bc37ba
2 changed files with 5 additions and 10 deletions

View File

@ -6,8 +6,6 @@ Miscellaneous scripts that don't need their own repo.
- `segafs/makesegafs.py`: Create an `app`/`opt`/`pack` (same thing) from an unencrypted
disk image.
- Dependencies: `pip install construct PyCryptodome`
- You will need to find the BootID key/IV and the HMAC key yourself if you want to
make fake apps for whatever reason. Or just don't.
## Patchers
- `patchers/b2spatch.mjs`: Convert from BemaniPatcher to Spice2x JSON

View File

@ -63,12 +63,9 @@ BOOTID = {
# ---- Keys
# The BootID (app/opt/pack header) encryption key and IV.
BTKEY = bytes.fromhex("")
BTIV = bytes.fromhex("")
# The HMAC key that ensures the app/opt/pack created is authentic.
SIGKEY = bytes.fromhex("")
BTKEY = bytes.fromhex("09ca5efd30c9aaef3804d0a7e3fa7120")
BTIV = bytes.fromhex("b155c22c2e7f0491fa7f0fdc217aff90")
SIGKEY = bytes.fromhex("e1bdcb2d5e9ed3b5de234364dfa4d126849edff769fc6c28fba5f43bc482bd7479d676afce8188e1d3a6852f4ebce45cde46bd15e8ee5fe84d197f945a54518f")
HEADER_META_PUBKEY = RSA.import_key("""-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsRMLnJuczNpfoqPpHQ3o
5XNkjKXO6P3ToV/45Az5dNaHVL7uEu9vPI7a2KYFQnNYgD3UUHFahfTcljzLOkcH
@ -140,8 +137,8 @@ BOOTID["block_count"] = ceil(filesize / BOOTID["block_size"]) + 8
header_meta = struct.pack("<Q", time.time()) + os.path.abspath(INPUT_FILE).encode("utf-8")
header_meta += secrets.token_bytes(BOOTID["block_size"] - len(header_meta))
header_meta = PKCS1_OAEP.new(HEADER_META_PUBKEY).encrypt(header_meta)
bullshit_crc32 = zlib.crc32(header_meta)
block_crc32s = [0, bullshit_crc32, bullshit_crc32, bullshit_crc32, bullshit_crc32, bullshit_crc32, bullshit_crc32, bullshit_crc32]
header_meta_crc32 = zlib.crc32(header_meta)
block_crc32s = [0, header_meta_crc32, header_meta_crc32, header_meta_crc32, header_meta_crc32, header_meta_crc32, header_meta_crc32, header_meta_crc32]
with open(INPUT_FILE, "rb") as fin, open(OUTPUT_FILE, "w+b") as fout:
# Write the bootID.