diff --git a/androscalpel/src/dex_writer.rs b/androscalpel/src/dex_writer.rs index 822be15..2fa9509 100644 --- a/androscalpel/src/dex_writer.rs +++ b/androscalpel/src/dex_writer.rs @@ -401,6 +401,7 @@ impl DexWriter { let mut min_addr = 0; let mut max_addr = 0; let mut label_min_max_addrs: HashMap = HashMap::new(); + for ins in &code.insns { match ins { Instruction::Label(Label { name }) => { @@ -2429,7 +2430,7 @@ impl DexWriter { debug!("Link the debug_info_off entries in code_items"); for code in self.code_items.iter_mut() { if code.debug_info_off != 0 { - code.debug_info_off += self.section_manager.get_offset(Section::DebugInfoItem); + code.debug_info_off += self.section_manager.get_offset(Section::DebugInfoItem) - 1; } } }