feat: track official versions and import resources

Persist official version-state, extend CAS/ResourceRepository import classification, and add offline catalog and failure regression fixtures.

Fixes #13

Fixes #12

Fixes #8
This commit is contained in:
2026-07-15 19:53:10 +08:00
parent 4192d7ee4c
commit 90307a3243
30 changed files with 1269 additions and 157 deletions
+3 -3
View File
@@ -114,7 +114,7 @@ fn parse_obfuscated_game_main_config(bytes: &[u8]) -> Result<YostarJpGameMainCon
}
fn decrypt_inferred_ascii_json(bytes: &[u8]) -> Result<String, String> {
if bytes.len() % 2 != 0 {
if !bytes.len().is_multiple_of(2) {
return Err("Obfuscated GameMainConfig byte length is not UTF-16LE aligned".to_string());
}
@@ -288,7 +288,7 @@ fn xor_bytes(bytes: &mut [u8], key: &[u8]) {
}
fn utf16le_to_string(bytes: &[u8]) -> Result<String, String> {
if bytes.len() % 2 != 0 {
if !bytes.len().is_multiple_of(2) {
return Err("GameMainConfig decrypted byte length is not UTF-16LE aligned".into());
}
@@ -454,7 +454,7 @@ mod tests {
fn encrypt_utf16le_xor(value: &str, key: &[u8]) -> Vec<u8> {
let mut utf16 = utf16le_bytes(value);
xor_bytes(&mut utf16, &key);
xor_bytes(&mut utf16, key);
utf16
}