add funai_mstar extractor, mstar: fix BUG from previous commit (not increment j counter when skipping by unknown dest), auto delete decrypted file in mstar_secure_old (new option to not do so)

This commit is contained in:
theubusu
2026-05-11 19:55:01 +02:00
parent 30fafbd3fc
commit c29bbe1bdc
6 changed files with 155 additions and 10 deletions
+42
View File
@@ -0,0 +1,42 @@
use std::collections::HashMap;
#[derive(Debug)]
pub struct InfoStruct {
pub file_code: String,
pub brand_name: String,
pub model_name: String,
pub soc_version: String,
pub frc_version: String,
pub soc_size: usize,
pub frc60_size: usize,
pub frc120_size: usize,
}
impl InfoStruct {
pub fn from_str(str: String) -> Option<Self> {
let lines: Vec<&str> = str.lines().map(|l| l.trim()).collect();
let mut map = HashMap::new();
for line in lines {
//skip markers
if line == "#@INFO" || line == "#@END" {
continue;
}
//split KEY=VALUE
let (key, value) = line.split_once('=')?;
map.insert(key, value);
}
Some(Self {
file_code: map.get("FileCode")?.to_string(),
brand_name: map.get("BrandName")?.to_string(),
model_name: map.get("ModelName")?.to_string(),
soc_version: map.get("SoC_Version")?.to_string(),
frc_version: map.get("FRC_Version")?.to_string(),
soc_size: map.get("SoC_Size")?.parse().ok()?,
frc60_size: map.get("FRC60_Size")?.parse().ok()?,
frc120_size: map.get("FRC120_Size")?.parse().ok()?,
})
}
}