forked from clowd81/rift_datamine_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenglish_lang_cds_format.txt
39 lines (35 loc) · 1.3 KB
/
english_lang_cds_format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Format
Header
=======
4 bytes - Little endian count of entries
1024 bytes - Little endian table of Huffman code frequencies, 256 symbols, 4 bytes each
?varies- Key/Value pairs.
- First 4 bytes - random number generator seed - not sure of the purpose
- Variable - LEB128 unsigned encoded value, can read with the following function, unknown purpose, perhaps offset?
-----------
public static int readUnsignedLeb128_X(final DataInputStream diss) throws IOException
{
int mungedByte = 0;
int i = 0;
int index = 0;
byte currentByte;
while (i < 35)
{
index = i;
i += 7;
currentByte = diss.readByte();
mungedByte |= (currentByte & 0x7f) << index;
if (currentByte > 0)
{
return mungedByte;
}
}
return 0;
------------
?-? varies- After reading the above entries then you have the data
- LEB128 compressed size
- LEB128 uncompressed size
- Then data
- Each data chunk is preceded by a variable number of bits, possibly Huffman code/table related, generally at least 64, havn't worked it out exactly yet.
- Then, the data is Huffman coded using the aforementioned Frequency Table.
- Can use some test code to print out the code with different bit skip amounts and pick one that sounds good.