Initial commit
This commit is contained in:
25
ackit/known_setups.py
Normal file
25
ackit/known_setups.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Database of Vorbis setups used by the game's own WEMs (from all shipped WADs).
|
||||
|
||||
Each entry: stripped Wwise setup (hex), its codebook hash, decode alloc sizes, and
|
||||
formats seen. Reusing a known setup guarantees hash/alloc values the game accepts.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
|
||||
PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", "known_setups.json")
|
||||
_DB = None
|
||||
|
||||
|
||||
def db():
|
||||
global _DB
|
||||
if _DB is None:
|
||||
_DB = json.load(open(PATH))
|
||||
return _DB
|
||||
|
||||
|
||||
def lookup_setup(ww_setup: bytes):
|
||||
h = ww_setup.hex()
|
||||
for e in db():
|
||||
if e["setup"] == h:
|
||||
return e
|
||||
return None
|
||||
Reference in New Issue
Block a user