-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathApp.java
38 lines (30 loc) · 1.42 KB
/
App.java
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
package moe.mottomo.cgss.example;
import moe.mottomo.cgss.kawashima.HcaDecoder;
import moe.mottomo.cgss.kawashima.HcaDecoderConfig;
import moe.mottomo.cgss.takamori.FileAccess;
import moe.mottomo.cgss.takamori.FileMode;
import moe.mottomo.cgss.takamori.FileStream;
public class App {
public static void main(String[] args) throws Exception {
try (FileStream fsIn = new FileStream("C:\\Users\\MIC\\Desktop\\cv_0001\\_acb_cv_0001.acb\\external\\cue_000127.hca", FileMode.OPEN_EXISTING, FileAccess.READ)) {
try (FileStream fsOut = new FileStream("C:\\Users\\MIC\\Desktop\\tmp.wav", FileMode.CREATE, FileAccess.WRITE)) {
HcaDecoderConfig config = new HcaDecoderConfig();
config.cipherConfig.setKey1(0xC59E7114);
config.cipherConfig.setKey2(0x00000000);
config.cipherConfig.setKeyModifier((short)0);
try (HcaDecoder decoder = new HcaDecoder(fsIn, config)) {
final int bufferSize = 4096;
byte[] buffer = new byte[bufferSize];
int read;
do {
read = decoder.read(buffer, 0, bufferSize);
if (read > 0) {
fsOut.write(buffer, 0, read);
}
} while (read > 0);
}
}
}
System.out.println("Complete.");
}
}