From 9848a55e492bae0c5d7e5ecff082bfdc88af7e93 Mon Sep 17 00:00:00 2001 From: Matt Hornung Date: Sat, 28 Nov 2026 22:33:07 -0600 Subject: [PATCH] arm: account for PC bias when resolving branch relocs inside a function scan_instructions converts a relocation whose target (symbol address + addend) lies within [function_start, function_end) into an internal branch destination. For ARM/Thumb PC-relative branch relocations, the addend includes the pipeline's PC bias (-4 for Thumb, -8 for ARM) rather than an offset into the target, so the computed address is 4 or 8 bytes before the real target. A call to a function starting immediately after the caller in the same section then lands inside the caller's trailing bytes and becomes a BranchDest, while the other side (with per-function sections) keeps it as a Reloc, causing a false mismatch. Add Arch::reloc_branch_pc_bias (default 0) returning the bias to add to reloc.addend to cancel out the pipeline offset (+4 for Thumb branch relocs, +8 for ARM branch relocs), and use checked_add in scan_instructions. Also add R_ARM_JUMP24 to reloc_name, data_reloc_size, and write_branch_target for consistency, and add unit tests covering both ARM (-8) and Thumb (-4) adjacent-function calls and intra-function branch relocations. Fixes #436 --- objdiff-core/src/arch/arm.rs | 156 ++++++++++++++++++ objdiff-core/src/arch/mod.rs | 12 +- .../tests/snapshots/arch_arm__read_arm-2.snap | 62 +++---- .../tests/snapshots/arch_arm__read_arm-3.snap | 46 +++--- 4 files changed, 214 insertions(+), 62 deletions(-) diff --git a/objdiff-core/src/arch/arm.rs b/objdiff-core/src/arch/arm.rs index ba5dd99c..f58fdfcc 100644 --- a/objdiff-core/src/arch/arm.rs +++ b/objdiff-core/src/arch/arm.rs @@ -426,6 +426,7 @@ impl Arch for ArchArm { elf::R_ARM_PC24 => Some("R_ARM_PC24"), elf::R_ARM_XPC25 => Some("R_ARM_XPC25"), elf::R_ARM_CALL => Some("R_ARM_CALL"), + elf::R_ARM_JUMP24 => Some("R_ARM_JUMP24"), elf::R_ARM_THM_PC11 => Some("R_ARM_THM_PC11"), elf::R_ARM_THM_PC9 => Some("R_ARM_THM_PC9"), elf::R_ARM_V4BX => Some("R_ARM_V4BX"), @@ -435,6 +436,21 @@ impl Arch for ArchArm { } } + fn reloc_branch_pc_bias(&self, flags: RelocationFlags) -> i64 { + match flags { + RelocationFlags::Elf( + elf::R_ARM_THM_PC22 + | elf::R_ARM_THM_XPC22 + | elf::R_ARM_THM_PC11 + | elf::R_ARM_THM_PC9, + ) => 4, + RelocationFlags::Elf( + elf::R_ARM_PC24 | elf::R_ARM_XPC25 | elf::R_ARM_CALL | elf::R_ARM_JUMP24, + ) => 8, + _ => 0, + } + } + fn data_reloc_size(&self, flags: RelocationFlags) -> usize { match flags { RelocationFlags::Elf(r_type) => match r_type { @@ -448,6 +464,7 @@ impl Arch for ArchArm { elf::R_ARM_PC24 => 4, elf::R_ARM_XPC25 => 4, elf::R_ARM_CALL => 4, + elf::R_ARM_JUMP24 => 4, elf::R_ARM_THM_PC11 => 2, elf::R_ARM_THM_PC9 => 2, _ => 1, @@ -610,6 +627,7 @@ impl unarm::FormatIns for ArgsFormatter<'_> { | RelocationFlags::Elf(elf::R_ARM_PC24) | RelocationFlags::Elf(elf::R_ARM_XPC25) | RelocationFlags::Elf(elf::R_ARM_CALL) + | RelocationFlags::Elf(elf::R_ARM_JUMP24) | RelocationFlags::Elf(elf::R_ARM_THM_PC11) | RelocationFlags::Elf(elf::R_ARM_THM_PC9) => { return self.write(InstructionPart::reloc()); @@ -674,3 +692,141 @@ impl unarm::FormatIns for ArgsFormatter<'_> { Ok(()) } } + +#[cfg(test)] +mod test { + use alloc::{boxed::Box, vec}; + + use super::*; + use crate::obj::{Object, ResolvedSymbol, SectionData}; + + fn make_arm_obj( + mode: unarm::ParseMode, + code: Vec, + caller_size: u64, + callee_size: u64, + label_addr: u64, + relocations: Vec, + ) -> Object { + let mut disasm_modes = BTreeMap::new(); + disasm_modes.insert(0, vec![DisasmMode { address: 0, mapping: mode }]); + let arch = Box::new(ArchArm { + disasm_modes, + detected_version: Some(unarm::Version::V5Te), + endianness: object::Endianness::Little, + }); + let section = Section { + name: ".text".into(), + address: 0, + size: code.len() as u64, + kind: SectionKind::Code, + data: SectionData(code), + relocations, + ..Default::default() + }; + let symbols = vec![ + Symbol { + name: "caller".into(), + address: 0, + size: caller_size, + kind: SymbolKind::Function, + section: Some(0), + ..Default::default() + }, + Symbol { + name: "callee".into(), + address: caller_size, + size: callee_size, + kind: SymbolKind::Function, + section: Some(0), + ..Default::default() + }, + Symbol { + name: "label".into(), + address: label_addr, + size: 0, + kind: SymbolKind::Unknown, + section: Some(0), + ..Default::default() + }, + ]; + Object { arch, sections: vec![section], symbols, ..Default::default() } + } + + #[test] + fn test_arm_branch_pc_bias_adjacent_callee() { + // 0x00: bl #0 (0xebfffffe) -> R_ARM_CALL to callee (0x10), addend -8 + // 0x04: b #0 (0xeafffffe) -> R_ARM_JUMP24 to label (0x0c), addend -8 + // 0x08: nop (0xe1a00000) + // 0x0c: bx lr (0xe12fff1e) <- label + // 0x10: bx lr (0xe12fff1e) <- callee (immediately after caller) + let mut code = Vec::new(); + for insn in [0xebff_fffeu32, 0xeaff_fffe, 0xe1a0_0000, 0xe12f_ff1e, 0xe12f_ff1e] { + code.extend_from_slice(&insn.to_le_bytes()); + } + let relocs = vec![ + Relocation { + flags: RelocationFlags::Elf(elf::R_ARM_CALL), + address: 0x0, + target_symbol: 1, // callee at 0x10 + addend: -8, + }, + Relocation { + flags: RelocationFlags::Elf(elf::R_ARM_JUMP24), + address: 0x4, + target_symbol: 2, // label at 0x0c + addend: -8, + }, + ]; + let obj = make_arm_obj(unarm::ParseMode::Arm, code, 0x10, 0x4, 0x0c, relocs); + let resolved = ResolvedSymbol { + obj: &obj, + symbol_index: 0, + symbol: &obj.symbols[0], + section_index: 0, + section: &obj.sections[0], + data: &obj.sections[0].data[..0x10], + }; + let insns = obj.arch.scan_instructions(resolved, &DiffObjConfig::default()).unwrap(); + assert_eq!(insns[0].branch_dest, None); + assert_eq!(insns[1].branch_dest, Some(0x0c)); + } + + #[test] + fn test_thumb_branch_pc_bias_adjacent_callee() { + // 0x00: bl #0 (0xf7ff 0xfffe) -> R_ARM_THM_PC22 to callee (0x08), addend -4 + // 0x04: b #0 (0xe7fe) -> R_ARM_THM_PC11 to label (0x06), addend -4 + // 0x06: bx lr (0x4770) <- label + // 0x08: bx lr (0x4770) <- callee (immediately after caller) + let mut code = Vec::new(); + for hw in [0xf7ffu16, 0xfffe, 0xe7fe, 0x4770, 0x4770] { + code.extend_from_slice(&hw.to_le_bytes()); + } + let relocs = vec![ + Relocation { + flags: RelocationFlags::Elf(elf::R_ARM_THM_PC22), + address: 0x0, + target_symbol: 1, // callee at 0x08 + addend: -4, + }, + Relocation { + flags: RelocationFlags::Elf(elf::R_ARM_THM_PC11), + address: 0x4, + target_symbol: 2, // label at 0x06 + addend: -4, + }, + ]; + let obj = make_arm_obj(unarm::ParseMode::Thumb, code, 0x8, 0x2, 0x6, relocs); + let resolved = ResolvedSymbol { + obj: &obj, + symbol_index: 0, + symbol: &obj.symbols[0], + section_index: 0, + section: &obj.sections[0], + data: &obj.sections[0].data[..0x8], + }; + let insns = obj.arch.scan_instructions(resolved, &DiffObjConfig::default()).unwrap(); + assert_eq!(insns[0].branch_dest, None); + assert_eq!(insns[1].branch_dest, Some(0x6)); + } +} diff --git a/objdiff-core/src/arch/mod.rs b/objdiff-core/src/arch/mod.rs index fa41a744..a76275ad 100644 --- a/objdiff-core/src/arch/mod.rs +++ b/objdiff-core/src/arch/mod.rs @@ -335,7 +335,11 @@ impl dyn Arch { if target.section != Some(resolved.section_index) { continue; } - let Some(target_address) = target.address.checked_add_signed(reloc.addend) else { + let Some(target_address) = reloc + .addend + .checked_add(self.reloc_branch_pc_bias(reloc.flags)) + .and_then(|offset| target.address.checked_add_signed(offset)) + else { continue; }; // If the target address is within the function range, set it as a branch destination @@ -456,6 +460,12 @@ pub trait Arch: Any + Debug + Send + Sync { fn data_reloc_size(&self, flags: RelocationFlags) -> usize; + /// Bias to add to `reloc.addend` to cancel out a PC-relative branch's pipeline PC offset + /// and recover the offset into the target symbol. On ARM, `bl`/`b` read PC as the + /// instruction address + 4 (Thumb) or + 8 (ARM), so the relocation addend includes -4/-8 + /// and this method returns +4/+8. + fn reloc_branch_pc_bias(&self, _flags: RelocationFlags) -> i64 { 0 } + fn symbol_address(&self, address: u64, _kind: SymbolKind) -> u64 { address } fn extra_symbol_flags(&self, _symbol: &object::Symbol) -> SymbolFlagSet { diff --git a/objdiff-core/tests/snapshots/arch_arm__read_arm-2.snap b/objdiff-core/tests/snapshots/arch_arm__read_arm-2.snap index ec50f782..369ba5e6 100644 --- a/objdiff-core/tests/snapshots/arch_arm__read_arm-2.snap +++ b/objdiff-core/tests/snapshots/arch_arm__read_arm-2.snap @@ -457,19 +457,12 @@ expression: diff.instruction_rows address: 140, size: 4, opcode: 32775, - branch_dest: Some( - 464, - ), + branch_dest: None, }, ), kind: None, branch_from: None, - branch_to: Some( - InstructionBranchTo { - ins_idx: 106, - branch_idx: 8, - }, - ), + branch_to: None, arg_diff: [], }, InstructionDiffRow { @@ -960,7 +953,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 59, - branch_idx: 9, + branch_idx: 8, }, ), arg_diff: [], @@ -1050,7 +1043,7 @@ expression: diff.instruction_rows ins_idx: [ 53, ], - branch_idx: 9, + branch_idx: 8, }, ), branch_to: None, @@ -1086,7 +1079,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 72, - branch_idx: 10, + branch_idx: 9, }, ), arg_diff: [], @@ -1107,7 +1100,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 74, - branch_idx: 11, + branch_idx: 10, }, ), arg_diff: [], @@ -1142,7 +1135,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 77, - branch_idx: 12, + branch_idx: 11, }, ), arg_diff: [], @@ -1191,7 +1184,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 77, - branch_idx: 12, + branch_idx: 11, }, ), arg_diff: [], @@ -1240,7 +1233,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 85, - branch_idx: 13, + branch_idx: 12, }, ), arg_diff: [], @@ -1261,7 +1254,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 77, - branch_idx: 12, + branch_idx: 11, }, ), arg_diff: [], @@ -1281,7 +1274,7 @@ expression: diff.instruction_rows ins_idx: [ 61, ], - branch_idx: 10, + branch_idx: 9, }, ), branch_to: None, @@ -1303,7 +1296,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 77, - branch_idx: 12, + branch_idx: 11, }, ), arg_diff: [], @@ -1323,7 +1316,7 @@ expression: diff.instruction_rows ins_idx: [ 62, ], - branch_idx: 11, + branch_idx: 10, }, ), branch_to: None, @@ -1359,7 +1352,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 85, - branch_idx: 13, + branch_idx: 12, }, ), arg_diff: [], @@ -1382,7 +1375,7 @@ expression: diff.instruction_rows 71, 73, ], - branch_idx: 12, + branch_idx: 11, }, ), branch_to: None, @@ -1446,7 +1439,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 85, - branch_idx: 13, + branch_idx: 12, }, ), arg_diff: [], @@ -1510,7 +1503,7 @@ expression: diff.instruction_rows 76, 81, ], - branch_idx: 13, + branch_idx: 12, }, ), branch_to: None, @@ -1588,7 +1581,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 96, - branch_idx: 14, + branch_idx: 13, }, ), arg_diff: [], @@ -1608,7 +1601,7 @@ expression: diff.instruction_rows ins_idx: [ 95, ], - branch_idx: 15, + branch_idx: 14, }, ), branch_to: None, @@ -1672,7 +1665,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 91, - branch_idx: 15, + branch_idx: 14, }, ), arg_diff: [], @@ -1692,7 +1685,7 @@ expression: diff.instruction_rows ins_idx: [ 90, ], - branch_idx: 14, + branch_idx: 13, }, ), branch_to: None, @@ -1756,7 +1749,7 @@ expression: diff.instruction_rows branch_to: Some( InstructionBranchTo { ins_idx: 102, - branch_idx: 16, + branch_idx: 15, }, ), arg_diff: [], @@ -1790,7 +1783,7 @@ expression: diff.instruction_rows ins_idx: [ 100, ], - branch_idx: 16, + branch_idx: 15, }, ), branch_to: None, @@ -1848,14 +1841,7 @@ expression: diff.instruction_rows }, ), kind: None, - branch_from: Some( - InstructionBranchFrom { - ins_idx: [ - 25, - ], - branch_idx: 8, - }, - ), + branch_from: None, branch_to: None, arg_diff: [], }, diff --git a/objdiff-core/tests/snapshots/arch_arm__read_arm-3.snap b/objdiff-core/tests/snapshots/arch_arm__read_arm-3.snap index 89be442c..89a0dd79 100644 --- a/objdiff-core/tests/snapshots/arch_arm__read_arm-3.snap +++ b/objdiff-core/tests/snapshots/arch_arm__read_arm-3.snap @@ -27,7 +27,7 @@ expression: output [(Address(88), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldrb", 32793), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(224)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(92), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] [(Address(96), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bne", 32772), Normal, 10), (BranchDest(108), Normal, 0), (BranchArrow(27), Rotating(7), 0), (Eol, Normal, 0)] -[(Address(100), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (BranchDest(424), Normal, 0), (BranchArrow(106), Rotating(8), 0), (Eol, Normal, 0)] +[(Address(100), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN13LinkStateItem15GetEquipBombchuEv", demangled_name: Some("LinkStateItem::GetEquipBombchu()"), normalized_name: None, address: 472, size: 16, kind: Function, section: Some(0), flags: FlagSet(Global), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] [(Address(104), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN12EquipBombchu19func_ov014_0213ec64Ev", demangled_name: Some("EquipBombchu::func_ov014_0213ec64()"), normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] [(Address(108), Dim, 5), (BranchArrow(24), Rotating(7), 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("pc")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(308)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Basic(" (->"), Normal, 0), (BranchDest(424), Normal, 0), (Basic(")"), Normal, 0), (Eol, Normal, 0)] [(Address(112), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(0)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] @@ -55,58 +55,58 @@ expression: output [(Address(200), Dim, 5), (BranchArrow(7), Rotating(0), 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(20)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(204), Dim, 5), (Spacing(4), Normal, 0), (Opcode("mvn", 32819), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] [(Address(208), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Eol, Normal, 0)] -[(Address(212), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(236), Normal, 0), (BranchArrow(59), Rotating(9), 0), (Eol, Normal, 0)] +[(Address(212), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(236), Normal, 0), (BranchArrow(59), Rotating(8), 0), (Eol, Normal, 0)] [(Address(216), Dim, 5), (Spacing(4), Normal, 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Eol, Normal, 0)] [(Address(220), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN13LinkStateBase12GetEquipItemEi", demangled_name: Some("LinkStateBase::GetEquipItem(int)"), normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] [(Address(224), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(0)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(228), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(28)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(232), Dim, 5), (Spacing(4), Normal, 0), (Opcode("blx", 32776), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Eol, Normal, 0)] -[(Address(236), Dim, 5), (BranchArrow(53), Rotating(9), 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(20)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] +[(Address(236), Dim, 5), (BranchArrow(53), Rotating(8), 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(20)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(240), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(9)), Normal, 0), (Eol, Normal, 0)] -[(Address(244), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bgt", 32772), Normal, 10), (BranchDest(288), Normal, 0), (BranchArrow(72), Rotating(10), 0), (Eol, Normal, 0)] -[(Address(248), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bge", 32772), Normal, 10), (BranchDest(296), Normal, 0), (BranchArrow(74), Rotating(11), 0), (Eol, Normal, 0)] +[(Address(244), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bgt", 32772), Normal, 10), (BranchDest(288), Normal, 0), (BranchArrow(72), Rotating(9), 0), (Eol, Normal, 0)] +[(Address(248), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bge", 32772), Normal, 10), (BranchDest(296), Normal, 0), (BranchArrow(74), Rotating(10), 0), (Eol, Normal, 0)] [(Address(252), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(1)), Normal, 0), (Eol, Normal, 0)] -[(Address(256), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bgt", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(12), 0), (Eol, Normal, 0)] +[(Address(256), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bgt", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(11), 0), (Eol, Normal, 0)] [(Address(260), Dim, 5), (Spacing(4), Normal, 0), (Opcode("mvn", 32819), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] [(Address(264), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Eol, Normal, 0)] -[(Address(268), Dim, 5), (Spacing(4), Normal, 0), (Opcode("blt", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(12), 0), (Eol, Normal, 0)] +[(Address(268), Dim, 5), (Spacing(4), Normal, 0), (Opcode("blt", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(11), 0), (Eol, Normal, 0)] [(Address(272), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmpne", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] [(Address(276), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmpne", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(1)), Normal, 0), (Eol, Normal, 0)] -[(Address(280), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(340), Normal, 0), (BranchArrow(85), Rotating(13), 0), (Eol, Normal, 0)] -[(Address(284), Dim, 5), (Spacing(4), Normal, 0), (Opcode("b", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(12), 0), (Eol, Normal, 0)] -[(Address(288), Dim, 5), (BranchArrow(61), Rotating(10), 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(10)), Normal, 0), (Eol, Normal, 0)] -[(Address(292), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bne", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(12), 0), (Eol, Normal, 0)] -[(Address(296), Dim, 5), (BranchArrow(62), Rotating(11), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Eol, Normal, 0)] +[(Address(280), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(340), Normal, 0), (BranchArrow(85), Rotating(12), 0), (Eol, Normal, 0)] +[(Address(284), Dim, 5), (Spacing(4), Normal, 0), (Opcode("b", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(11), 0), (Eol, Normal, 0)] +[(Address(288), Dim, 5), (BranchArrow(61), Rotating(9), 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(10)), Normal, 0), (Eol, Normal, 0)] +[(Address(292), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bne", 32772), Normal, 10), (BranchDest(308), Normal, 0), (BranchArrow(77), Rotating(11), 0), (Eol, Normal, 0)] +[(Address(296), Dim, 5), (BranchArrow(62), Rotating(10), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Eol, Normal, 0)] [(Address(300), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN13LinkStateBase18EquipItem_vfunc_28Ev", demangled_name: Some("LinkStateBase::EquipItem_vfunc_28()"), normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] -[(Address(304), Dim, 5), (Spacing(4), Normal, 0), (Opcode("b", 32772), Normal, 10), (BranchDest(340), Normal, 0), (BranchArrow(85), Rotating(13), 0), (Eol, Normal, 0)] -[(Address(308), Dim, 5), (BranchArrow(64), Rotating(12), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Eol, Normal, 0)] +[(Address(304), Dim, 5), (Spacing(4), Normal, 0), (Opcode("b", 32772), Normal, 10), (BranchDest(340), Normal, 0), (BranchArrow(85), Rotating(12), 0), (Eol, Normal, 0)] +[(Address(308), Dim, 5), (BranchArrow(64), Rotating(11), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Eol, Normal, 0)] [(Address(312), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN13LinkStateBase18EquipItem_vfunc_28Ev", demangled_name: Some("LinkStateBase::EquipItem_vfunc_28()"), normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] [(Address(316), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r4")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(4)), Normal, 0), (Eol, Normal, 0)] [(Address(320), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmpne", 32784), Normal, 10), (Argument(Opaque("r4")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(2)), Normal, 0), (Eol, Normal, 0)] -[(Address(324), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(340), Normal, 0), (BranchArrow(85), Rotating(13), 0), (Eol, Normal, 0)] +[(Address(324), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(340), Normal, 0), (BranchArrow(85), Rotating(12), 0), (Eol, Normal, 0)] [(Address(328), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN13LinkStateItem16GetLinkStateMoveEv", demangled_name: Some("LinkStateItem::GetLinkStateMove()"), normalized_name: None, address: 488, size: 16, kind: Function, section: Some(0), flags: FlagSet(Global), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] [(Address(332), Dim, 5), (Spacing(4), Normal, 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(1)), Normal, 0), (Eol, Normal, 0)] [(Address(336), Dim, 5), (Spacing(4), Normal, 0), (Opcode("strb", 32885), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(20)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] -[(Address(340), Dim, 5), (BranchArrow(70), Rotating(13), 0), (Opcode("mvn", 32819), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] +[(Address(340), Dim, 5), (BranchArrow(70), Rotating(12), 0), (Opcode("mvn", 32819), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] [(Address(344), Dim, 5), (Spacing(4), Normal, 0), (Opcode("add", 32769), Normal, 10), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(80)), Normal, 0), (Eol, Normal, 0)] [(Address(348), Dim, 5), (Spacing(4), Normal, 0), (Opcode("add", 32769), Normal, 10), (Argument(Opaque("r4")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(88)), Normal, 0), (Eol, Normal, 0)] [(Address(352), Dim, 5), (Spacing(4), Normal, 0), (Opcode("str", 32884), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(24)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(356), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r4")), Normal, 0), (Eol, Normal, 0)] -[(Address(360), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(384), Normal, 0), (BranchArrow(96), Rotating(14), 0), (Eol, Normal, 0)] -[(Address(364), Dim, 5), (BranchArrow(95), Rotating(15), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r6")), Normal, 0), (Eol, Normal, 0)] +[(Address(360), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(384), Normal, 0), (BranchArrow(96), Rotating(13), 0), (Eol, Normal, 0)] +[(Address(364), Dim, 5), (BranchArrow(95), Rotating(14), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r6")), Normal, 0), (Eol, Normal, 0)] [(Address(368), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_Z19func_ov000_020b7e6cPi", demangled_name: Some("func_ov000_020b7e6c(int*)"), normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] [(Address(372), Dim, 5), (Spacing(4), Normal, 0), (Opcode("add", 32769), Normal, 10), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(4)), Normal, 0), (Eol, Normal, 0)] [(Address(376), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r4")), Normal, 0), (Eol, Normal, 0)] -[(Address(380), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bne", 32772), Normal, 10), (BranchDest(364), Normal, 0), (BranchArrow(91), Rotating(15), 0), (Eol, Normal, 0)] -[(Address(384), Dim, 5), (BranchArrow(90), Rotating(14), 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("pc")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(36)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Basic(" (->"), Normal, 0), (BranchDest(428), Normal, 0), (Basic(")"), Normal, 0), (Eol, Normal, 0)] +[(Address(380), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bne", 32772), Normal, 10), (BranchDest(364), Normal, 0), (BranchArrow(91), Rotating(14), 0), (Eol, Normal, 0)] +[(Address(384), Dim, 5), (BranchArrow(90), Rotating(13), 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("pc")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(36)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Basic(" (->"), Normal, 0), (BranchDest(428), Normal, 0), (Basic(")"), Normal, 0), (Eol, Normal, 0)] [(Address(388), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldr", 32792), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(0)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(392), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldrb", 32793), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(128)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(396), Dim, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32784), Normal, 10), (Argument(Opaque("r1")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] -[(Address(400), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(408), Normal, 0), (BranchArrow(102), Rotating(16), 0), (Eol, Normal, 0)] +[(Address(400), Dim, 5), (Spacing(4), Normal, 0), (Opcode("beq", 32772), Normal, 10), (BranchDest(408), Normal, 0), (BranchArrow(102), Rotating(15), 0), (Eol, Normal, 0)] [(Address(404), Dim, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32775), Normal, 10), (Symbol(Symbol { name: "_ZN13PlayerControl13StopFollowingEv", demangled_name: Some("PlayerControl::StopFollowing()"), normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)] -[(Address(408), Dim, 5), (BranchArrow(100), Rotating(16), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] +[(Address(408), Dim, 5), (BranchArrow(100), Rotating(15), 0), (Opcode("mov", 32811), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)] [(Address(412), Dim, 5), (Spacing(4), Normal, 0), (Opcode("strb", 32885), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("[")), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(38)), Normal, 0), (Argument(Opaque("]")), Normal, 0), (Eol, Normal, 0)] [(Address(416), Dim, 5), (Spacing(4), Normal, 0), (Opcode("ldmia", 32791), Normal, 10), (Argument(Opaque("sp")), Normal, 0), (Argument(Opaque("!")), Normal, 0), (Basic(", "), Normal, 0), (Basic("{"), Normal, 0), (Argument(Opaque("r4")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("pc")), Normal, 0), (Basic("}"), Normal, 0), (Eol, Normal, 0)] [(Address(420), Dim, 5), (Spacing(4), Normal, 0), (Opcode(".word", 65534), Normal, 10), (Symbol(Symbol { name: "data_027e103c", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Eol, Normal, 0)] -[(Address(424), Dim, 5), (BranchArrow(25), Rotating(8), 0), (Opcode(".word", 65534), Normal, 10), (Symbol(Symbol { name: "data_027e1098", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Eol, Normal, 0)] +[(Address(424), Dim, 5), (Spacing(4), Normal, 0), (Opcode(".word", 65534), Normal, 10), (Symbol(Symbol { name: "data_027e1098", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Eol, Normal, 0)] [(Address(428), Dim, 5), (Spacing(4), Normal, 0), (Opcode(".word", 65534), Normal, 10), (Symbol(Symbol { name: "gPlayerControl", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Eol, Normal, 0)]