diff options
| -rw-r--r-- | arch/arm64/arch_arm64.cpp | 6 | ||||
| -rw-r--r-- | arch/arm64/il.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm64/arch_arm64.cpp b/arch/arm64/arch_arm64.cpp index b0dee144..1032c15c 100644 --- a/arch/arm64/arch_arm64.cpp +++ b/arch/arm64/arch_arm64.cpp @@ -348,6 +348,7 @@ class Arm64Architecture : public Architecture result.AddBranch(CallDestination, instr.operands[0].immediate); break; + case ARM64_B_AL: case ARM64_B: if (instr.operands[0].operandClass == LABEL) result.AddBranch(UnconditionalBranch, instr.operands[0].immediate); @@ -369,9 +370,8 @@ class Arm64Architecture : public Architecture case ARM64_B_LT: case ARM64_B_GT: case ARM64_B_LE: - case ARM64_B_AL: - case ARM64_B_NV: result.AddBranch(TrueBranch, instr.operands[0].immediate); + case ARM64_B_NV: result.AddBranch(FalseBranch, addr + 4); break; case ARM64_TBZ: @@ -1232,7 +1232,7 @@ class Arm64Architecture : public Architecture uint32_t* value = (uint32_t*)data; // Combine the immediate in the first operand with the unconditional branch opcode to form // an unconditional branch instruction - *value = (5 << 26) | (uint32_t)((instr.operands[0].immediate - addr) >> 2); + *value = (5 << 26) | (((uint32_t)((instr.operands[0].immediate - addr) >> 2)) & 0x03ffffff); return true; } diff --git a/arch/arm64/il.cpp b/arch/arm64/il.cpp index 31c7f094..6dd1afe1 100644 --- a/arch/arm64/il.cpp +++ b/arch/arm64/il.cpp @@ -1422,6 +1422,10 @@ bool GetLowLevelILForInstruction( case ARM64_BTI: il.AddInstruction(il.Intrinsic({}, ARM64_INTRIN_HINT_BTI, {})); break; + + case ARM64_B_NV: + il.AddInstruction(DirectJump(arch, il, addr + 4, addrSize)); + break; case ARM64_B: case ARM64_B_AL: il.AddInstruction(DirectJump(arch, il, IMM_O(operand1), addrSize)); |
