BIG FAT CLEANUP PART ONE

This commit is contained in:
SpikeHD
2022-07-13 18:10:41 -07:00
parent a703843eed
commit b903c27a22
4 changed files with 237 additions and 144 deletions

View File

@@ -67,24 +67,27 @@ fn decrypt_metadata(file_path: &str) -> Vec<u8> {
}
};
let mut data = Vec::new();
// Read metadata file
match file.read_to_end(&mut data) {
Ok(_) => {
match dll_decrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
Ok(_) => {
println!("Successfully decrypted global-metadata");
return data;
}
Err(e) => {
println!("Failed to decrypt global-metadata: {}", e);
return Vec::new();
}
};
}
Ok(_) => (),
Err(e) => {
println!("Failed to read global-metadata: {}", e);
return Vec::new();
}
}
// Decrypt metadata file
match dll_decrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
Ok(_) => {
println!("Successfully decrypted global-metadata");
return data;
}
Err(e) => {
println!("Failed to decrypt global-metadata: {}", e);
return Vec::new();
}
};
}
fn replace_keys(data: &Vec<u8>) -> Vec<u8> {