begin adding try/catch

This commit is contained in:
afonya 2025-06-18 12:56:54 +02:00
parent 8dee35c68f
commit 1a98959be0
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC
6 changed files with 82 additions and 17 deletions

View file

@ -7,7 +7,8 @@ pub struct DecompiledFunction {
pub body: Vec<DecompiledOperation>,
pub variables: Vec<Variable>,
pub strings: HashMap<u32, String>,
pub functions: HashMap<u32, u32>
pub functions: HashMap<u32, u32>,
pub try_catch: u32,
}
#[derive(Debug, Clone)]
pub struct DecompiledOperation {
@ -145,6 +146,8 @@ fn load_func(data: Vec<u8>, offset: &mut usize) -> DecompiledFunction {
*offset += 4;
functions.insert(func_id, func_pos);
}
let try_catch = read_be_num(&data[*offset..*offset + 4]);
*offset += 4;
let mut body: Vec<DecompiledOperation> = Vec::new();
let instr_len: usize = read_be_num(&data[*offset..*offset + 4]);
*offset += 4;
@ -170,6 +173,7 @@ fn load_func(data: Vec<u8>, offset: &mut usize) -> DecompiledFunction {
variables: variables,
strings: strings,
functions: functions,
try_catch: try_catch as u32,
};
}