From cf328b8707d31143394ec8dd249e7f987a50b304 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 9 Aug 2023 23:59:26 -0400 Subject: [PATCH] Only create relocations for direct branches --- src/analysis/tracker.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/analysis/tracker.rs b/src/analysis/tracker.rs index afe0859..7f4b123 100644 --- a/src/analysis/tracker.rs +++ b/src/analysis/tracker.rs @@ -266,7 +266,9 @@ impl Tracker { if is_function_addr(addr) { Ok(ExecCbResult::Jump(addr)) } else { - self.relocations.insert(ins.addr, Relocation::Rel24(addr)); + if ins.is_direct_branch() { + self.relocations.insert(ins.addr, Relocation::Rel24(addr)); + } Ok(ExecCbResult::EndBlock) } } @@ -295,7 +297,8 @@ impl Tracker { if branch.link || !is_function_addr(addr) { self.relocations.insert(ins.addr, match ins.op { Opcode::B => Relocation::Rel24(addr), - _ => Relocation::Rel14(addr), + Opcode::Bc => Relocation::Rel14(addr), + _ => continue, }); } else if is_function_addr(addr) { executor.push(addr, branch.vm, true);