mtk_pkg_old (prev. mtk_upgrade_loader): implement header and content decryption, mtk_pkg: add version reading

This commit is contained in:
theubusu
2025-12-14 01:08:48 +01:00
parent 7d26859c6f
commit e7c6027598
8 changed files with 266 additions and 78 deletions
+4 -1
View File
@@ -139,9 +139,12 @@ pub fn extract_mtk_pkg(mut file: &File, output_folder: &str) -> Result<(), Box<d
out_data = data;
}
//strip iMtK thing
//strip iMtK thing and get version
let extra_header_len = if &out_data[48..52] == b"iMtK" {
let imtk_len = u32::from_le_bytes(out_data[52..56].try_into().unwrap());
let version_len = u32::from_le_bytes(out_data[56..60].try_into().unwrap());
let version = common::string_from_bytes(&out_data[60..60 + version_len as usize]);
println!("- Version: {}", version);
imtk_len + 8
} else {
0