From d470881d984a8dd4757fb821b57ea58ca851dc7d Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Thu, 4 Jan 2024 10:38:07 +0100 Subject: [PATCH] bug fix --- androscalpel_serializer/src/items/code.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/androscalpel_serializer/src/items/code.rs b/androscalpel_serializer/src/items/code.rs index df51031..3e9ffae 100644 --- a/androscalpel_serializer/src/items/code.rs +++ b/androscalpel_serializer/src/items/code.rs @@ -121,20 +121,19 @@ impl CodeItem { i += 1; } for insn in &self.insns { - addr += insn.size() as u32; + addr += insn.size() as u32 / 2; while i < addresses.len() && addresses[i] == addr { i += 1; } } if i < addresses.len() && addresses[i] < addr { - println!("{addresses:x?}"); return Err(Error::InconsistantStruct(format!( "Found an address in try block (0x{:x}) that does not align with an instruction", addresses[i] ))); } - // TODO check goto addresses? pb: op code are not parsed so goto instruction are not known + // TODO check goto and if addresses? pb: op code are not parsed so goto instruction are not known Ok(()) }