PyCriCodecsEx 0.0.5__cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CriCodecsEx.cpython-312-x86_64-linux-gnu.so +0 -0
- PyCriCodecsEx/__init__.py +1 -0
- PyCriCodecsEx/acb.py +306 -0
- PyCriCodecsEx/adx.py +158 -0
- PyCriCodecsEx/awb.py +165 -0
- PyCriCodecsEx/chunk.py +92 -0
- PyCriCodecsEx/cpk.py +743 -0
- PyCriCodecsEx/hca.py +454 -0
- PyCriCodecsEx/usm.py +1001 -0
- PyCriCodecsEx/utf.py +692 -0
- pycricodecsex-0.0.5.dist-info/METADATA +35 -0
- pycricodecsex-0.0.5.dist-info/RECORD +15 -0
- pycricodecsex-0.0.5.dist-info/WHEEL +6 -0
- pycricodecsex-0.0.5.dist-info/licenses/LICENSE +21 -0
- pycricodecsex-0.0.5.dist-info/top_level.txt +2 -0
PyCriCodecsEx/chunk.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from struct import Struct
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
UTFChunkHeader = Struct(">4sIIIIIHHI")
|
|
5
|
+
USMChunkHeader = Struct(">4sIBBHBBBBIIII")
|
|
6
|
+
CPKChunkHeader = Struct("<4sIII")
|
|
7
|
+
AWBChunkHeader = Struct("<4sBBHIHH")
|
|
8
|
+
SBTChunkHeader = Struct("<IIIII")
|
|
9
|
+
WavHeaderStruct = Struct("<4sI4s4sIHHIIHH") # This is wrong, FMT Struct should be on its own, away from RIFF.
|
|
10
|
+
WavSmplHeaderStruct = Struct("<4sIIIIIIIIIIIIIIII") # Supports only 1 looping point.
|
|
11
|
+
WavNoteHeaderStruct = Struct("<4sII")
|
|
12
|
+
WavDataHeaderStruct = Struct("<4sI")
|
|
13
|
+
AdxHeaderStruct = Struct(">HHBBBBIIHBB")
|
|
14
|
+
AdxLoopHeaderStruct = Struct(">HHHHIIII")
|
|
15
|
+
AcbSynthReferenceStruct = Struct(">HH")
|
|
16
|
+
AcbTrackCommandNoteOnStruct = Struct(">HH")
|
|
17
|
+
class USMChunckHeaderType(Enum):
|
|
18
|
+
CRID = b"CRID" # Header.
|
|
19
|
+
SFSH = b"SFSH" # SofDec1 Header?
|
|
20
|
+
SFV = b"@SFV" # Video (VP9/H264/MPEG).
|
|
21
|
+
SFA = b"@SFA" # Audio (HCA/ADX).
|
|
22
|
+
ALP = b"@ALP" # Rare. (Alpha video information).
|
|
23
|
+
CUE = b"@CUE" # Rare. (Cue points).
|
|
24
|
+
SBT = b"@SBT" # Rare. (Subtitle information).
|
|
25
|
+
AHX = b"@AHX" # Rare. (Ahx audio file? Used for SofDec1 only?)
|
|
26
|
+
USR = b"@USR" # Rare. (User data?)
|
|
27
|
+
PST = b"@PST" # Rare. (Unknown).
|
|
28
|
+
|
|
29
|
+
class CPKChunkHeaderType(Enum):
|
|
30
|
+
CPK = b"CPK " # Header.
|
|
31
|
+
TOC = b"TOC " # Cpkmode 1, 2, 3.
|
|
32
|
+
ITOC = b"ITOC" # Cpkmode 0, 2.
|
|
33
|
+
GTOC = b"GTOC" # Cpkmode 3.
|
|
34
|
+
ETOC = b"ETOC" # Any CpkMode. Not important.
|
|
35
|
+
HTOC = b"HTOC" # Unknown.
|
|
36
|
+
HGTOC = b"HGTOC"# Unknown.
|
|
37
|
+
|
|
38
|
+
class UTFType(Enum):
|
|
39
|
+
UTF = b"@UTF" # Header.
|
|
40
|
+
EUTF = b"\x1F\x9E\xF3\xF5" # Encrypted @UTF Header. Very likely exclusive to CPK's @UTF only.
|
|
41
|
+
|
|
42
|
+
class AWBType(Enum):
|
|
43
|
+
AFS2 = b"AFS2" # Header.
|
|
44
|
+
|
|
45
|
+
class HCAType(Enum):
|
|
46
|
+
HCA = b"HCA\x00" # Header.
|
|
47
|
+
EHCA = b"\xC8\xC3\xC1\x00" # Encrypted HCA header.
|
|
48
|
+
|
|
49
|
+
# I saw some devs swap the unsigned/signed indexes. So I am not sure what's correct or not.
|
|
50
|
+
# In my own experience, swapping those results in an incorrect signed values (should be unsigned) in ACB's/CPK's.
|
|
51
|
+
# If someone were to change this, they must change 'stringtypes' function in UTF/UTFBuilder classes.
|
|
52
|
+
class UTFTypeValues(Enum):
|
|
53
|
+
uchar = 0
|
|
54
|
+
char = 1
|
|
55
|
+
ushort = 2
|
|
56
|
+
short = 3
|
|
57
|
+
uint = 4
|
|
58
|
+
int = 5
|
|
59
|
+
ullong = 6
|
|
60
|
+
llong = 7
|
|
61
|
+
float = 8
|
|
62
|
+
double = 9 # Does not seem to exist.
|
|
63
|
+
string = 10
|
|
64
|
+
bytes = 11
|
|
65
|
+
|
|
66
|
+
class CriHcaQuality(Enum):
|
|
67
|
+
Highest = 0
|
|
68
|
+
High = 1
|
|
69
|
+
Middle = 2
|
|
70
|
+
Low = 3
|
|
71
|
+
Lowest = 5
|
|
72
|
+
|
|
73
|
+
class AcbEncodeTypes(Enum):
|
|
74
|
+
ADX = 0
|
|
75
|
+
PCM = 1
|
|
76
|
+
HCA = 2
|
|
77
|
+
ADX_ALT = 3
|
|
78
|
+
WiiDSP = 4
|
|
79
|
+
NDSDSP = 5
|
|
80
|
+
HCAMX = 6
|
|
81
|
+
VAG = 7
|
|
82
|
+
ATRAC3 = 8
|
|
83
|
+
CWAV = 9
|
|
84
|
+
HEVAG = 10
|
|
85
|
+
ATRAC9 = 11
|
|
86
|
+
X360XMA = 12
|
|
87
|
+
DSP = 13
|
|
88
|
+
CWACDSP = 14
|
|
89
|
+
PS4HEVAG = 15
|
|
90
|
+
PS4ATRAC9 = 16
|
|
91
|
+
AACM4A = 17
|
|
92
|
+
SwitchOpus = 18
|