Skip to content

Commit

Permalink
Add subkey in acb parsing result
Browse files Browse the repository at this point in the history
  • Loading branch information
t-wy authored Sep 6, 2024
1 parent 31af8e8 commit 3d9f2f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions acb_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
def parse_binary(acb_file: open, awb_file: open=None):
with ACBFile(acb_file, extern_awb=awb_file) as acb:
return [
T("parsed_acb", ("track", "binary", "extension"))(
T("parsed_acb", ("track", "binary", "extension", "subkey"))(
track=track,
binary=io.BytesIO(acb.get_track_data(track)),
extension=wave_type_ftable.get(track.enc_type, track.enc_type)[1:]
extension=wave_type_ftable.get(track.enc_type, track.enc_type)[1:],
subkey = None if acb.embedded_awb is None else acb.embedded_awb.mix_key
)
for track in acb.track_list.tracks
]

def parse_bytes(acb_bytes: bytes, awb_bytes: bytes=None):
return parse_binary(io.BytesIO(acb_bytes), io.BytesIO(awb_bytes) if awb_bytes is not None else None)
return parse_binary(io.BytesIO(acb_bytes), io.BytesIO(awb_bytes) if awb_bytes is not None else None)

0 comments on commit 3d9f2f8

Please sign in to comment.