mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-16 05:04:22 +02:00
add helper method to AppContext to simplify getting options
This commit is contained in:
@@ -68,9 +68,7 @@ fn parse_tdi_to_modules(tdi_data: Vec<u8>) -> Result<Vec<TdiTgtInf>, Box<dyn std
|
||||
|
||||
pub fn extract_sddl_sec(app_ctx: &AppContext, _ctx: Box<dyn Any>) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut file = app_ctx.file().ok_or("Extractor expected file")?;
|
||||
let save_extra = app_ctx.options.iter().any(|e| e == "sddl_sec:save_extra");
|
||||
let split_peaks = app_ctx.options.iter().any(|e| e == "sddl_sec:split_peaks");
|
||||
let decomp_peaks = !app_ctx.options.iter().any(|e| e == "sddl_sec:no_decomp_peaks");
|
||||
let save_extra = app_ctx.has_option("sddl_sec:save_extra");
|
||||
|
||||
let mut secfile_hdr_reader = Cursor::new(decipher(&common::read_exact(&mut file, 32)?));
|
||||
let secfile_header: SecHeader = secfile_hdr_reader.read_be()?;
|
||||
@@ -162,10 +160,10 @@ pub fn extract_sddl_sec(app_ctx: &AppContext, _ctx: Box<dyn Any>) -> Result<(),
|
||||
|
||||
}
|
||||
|
||||
if split_peaks && module.module_name() == "PEAKS" {
|
||||
if app_ctx.has_option("sddl_sec:split_peaks") && module.module_name() == "PEAKS" {
|
||||
println!("\n- Splitting PEAKS");
|
||||
if let Some(ref path) = final_out_path {
|
||||
split_peaks_file(path, &app_ctx.output_dir, decomp_peaks)?;
|
||||
split_peaks_file(path, &app_ctx.output_dir, !app_ctx.has_option("sddl_sec:no_decomp_peaks"))?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user