mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 05:55:15 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user