mirror of
https://gitea.tendokyu.moe/beerpsi/x.git
synced 2025-02-17 11:08:35 +01:00
Update segafs/makesegafs.py
This commit is contained in:
parent
f8a759c3a4
commit
fc8b5dc3d8
@ -25,8 +25,13 @@ ENCRYPTION_KEY = bytes.fromhex("")
|
||||
INPUT_FILE = "" # Should not be encrypted.
|
||||
OUTPUT_FILE = ""
|
||||
BOOTID = {
|
||||
"type": 0x0201, # 0x0201: Option, 0x0000: Pack, 0x0101: App
|
||||
"sequence_number": 0x0000, # Set to 256 (0x0100) for options.
|
||||
"unk1": 0x01, # Ocassionally you'll see this be 0.
|
||||
"type": 0x01, # 0: OS, 1: App, 2: Option
|
||||
"sequence_number": 0, # Only applies to app patches.
|
||||
|
||||
# If this is enabled, the container should be decrypted with a derived IV. The derivation algorithm is unknown.
|
||||
"derive_iv": 0,
|
||||
|
||||
"game_id": b"SDGS",
|
||||
"game_timestamp": {
|
||||
"year": 2023,
|
||||
@ -40,7 +45,7 @@ BOOTID = {
|
||||
"game_version": b"A041",
|
||||
"block_size": 0x40000,
|
||||
"header_block_count": 8,
|
||||
"unk1": 0,
|
||||
"unk2": 0,
|
||||
"hw_family": b"ACA",
|
||||
"hw_generation": 0,
|
||||
"org_timestamp": {
|
||||
@ -62,8 +67,9 @@ BOOTID = {
|
||||
"minor": 54,
|
||||
"major": 80,
|
||||
},
|
||||
"strings": b"\x00"
|
||||
* 0x27AC, # Depending on the app/opt/pack, this might have some text in it.
|
||||
|
||||
# Depending on the app/opt/pack, this might have some text in it.
|
||||
"strings": b"\x00" * 0x27AC,
|
||||
}
|
||||
# ----
|
||||
|
||||
@ -71,9 +77,15 @@ BOOTID = {
|
||||
# The BootID (app/opt/pack header) encryption key and IV.
|
||||
BTKEY = bytes.fromhex("09ca5efd30c9aaef3804d0a7e3fa7120")
|
||||
BTIV = bytes.fromhex("b155c22c2e7f0491fa7f0fdc217aff90")
|
||||
|
||||
# The HMAC key used to "verify" the array of block CRCs.
|
||||
SIGKEY = bytes.fromhex(
|
||||
"e1bdcb2d5e9ed3b5de234364dfa4d126849edff769fc6c28fba5f43bc482bd7479d676afce8188e1d3a6852f4ebce45cde46bd15e8ee5fe84d197f945a54518f"
|
||||
)
|
||||
|
||||
# The header metadata contains the timestamp when the container is
|
||||
# created, and the path to the original file, then just a bunch of random
|
||||
# bytes. The private key used to decrypt the header metadata is unknown.
|
||||
HEADER_META_PUBKEY = RSA.import_key("""-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsRMLnJuczNpfoqPpHQ3o
|
||||
5XNkjKXO6P3ToV/45Az5dNaHVL7uEu9vPI7a2KYFQnNYgD3UUHFahfTcljzLOkcH
|
||||
@ -111,15 +123,17 @@ Version = Struct(
|
||||
BootID = Struct(
|
||||
"length" / Const(0x2800, Int32ul),
|
||||
"magic" / Const(b"BTID", Bytes(4)),
|
||||
"type" / Int16ul,
|
||||
"sequence_number" / Int16ul,
|
||||
"unk1" / Int8ul,
|
||||
"type" / Int8ul,
|
||||
"sequence_number" / Int8ul,
|
||||
"derive_iv" / Int8ul,
|
||||
"game_id" / Bytes(4),
|
||||
"game_timestamp" / Timestamp,
|
||||
"game_version" / IfThenElse(lambda ctx: ctx.type == 0x0201, Bytes(4), Version),
|
||||
"block_count" / Int64ul,
|
||||
"block_size" / Int64ul,
|
||||
"header_block_count" / Int64ul,
|
||||
"unk1" / Int64ul,
|
||||
"unk2" / Int64ul,
|
||||
"hw_family" / Bytes(3),
|
||||
"hw_generation" / Int8ul,
|
||||
"org_timestamp" / Timestamp,
|
||||
|
Loading…
x
Reference in New Issue
Block a user