mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 00:24:45 +01:00
fix decryption
This commit is contained in:
@@ -82,15 +82,13 @@ fn decrypt_metadata(file_path: &str) -> Vec<u8> {
|
|||||||
match dll_decrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
|
match dll_decrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
println!("Successfully decrypted global-metadata");
|
println!("Successfully decrypted global-metadata");
|
||||||
data
|
return data;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to decrypt global-metadata: {}", e);
|
println!("Failed to decrypt global-metadata: {}", e);
|
||||||
Vec::new()
|
return Vec::new();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Vec::new()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn replace_keys(data: &[u8]) -> Vec<u8> {
|
fn replace_keys(data: &[u8]) -> Vec<u8> {
|
||||||
@@ -145,15 +143,13 @@ fn encrypt_metadata(old_data: &[u8]) -> Vec<u8> {
|
|||||||
match dll_encrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
|
match dll_encrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
println!("Successfully encrypted global-metadata");
|
println!("Successfully encrypted global-metadata");
|
||||||
data
|
return data;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to encrypt global-metadata: {}", e);
|
println!("Failed to encrypt global-metadata: {}", e);
|
||||||
Vec::new()
|
return Vec::new();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Vec::new()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_vecs_match<T: PartialEq>(a: &Vec<T>, b: &Vec<T>) -> bool {
|
fn do_vecs_match<T: PartialEq>(a: &Vec<T>, b: &Vec<T>) -> bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user