Simplify change (#2789)

pull/2798/head
OBarronCS 9 months ago committed by GitHub
parent 876482a2bb
commit 461ac6214a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -281,7 +281,7 @@ class DisassemblyAssistant(pwndbg.aglib.disasm.arch.DisassemblyAssistant):
def _handle_adrp(self, instruction: PwndbgInstruction, emu: Emulator) -> None:
result_operand, right = instruction.operands
if result_operand.str and right.before_value is not None:
address = right.before_value
address = right.before_value & pwndbg.aglib.arch.ptrmask
TELESCOPE_DEPTH = max(0, int(pwndbg.config.disasm_telescope_depth))
@ -348,7 +348,9 @@ class DisassemblyAssistant(pwndbg.aglib.disasm.arch.DisassemblyAssistant):
if len(instruction.operands) > 0:
# For all AArch64 branches, the target is either an immediate or a register and is the last operand
return instruction.operands[-1].before_value
if (val := instruction.operands[-1].before_value) is not None:
return val & pwndbg.aglib.arch.ptrmask
return None
elif instruction.id == ARM64_INS_RET:
# If this is a ret WITHOUT an operand, it means we should read from the LR/x30 register
return super()._read_register_name(instruction, "lr", emu)

@ -691,7 +691,7 @@ class DisassemblyAssistant:
if instruction.target is None:
instruction.target = instruction.next
if instruction.has_jump_target:
if instruction.has_jump_target and instruction.target >= 0:
# Only bother doing the symbol lookup if this is a jump
instruction.target_string = MemoryColor.get_address_or_symbol(instruction.target)

@ -190,6 +190,7 @@ BANNED_INSTRUCTIONS = {
"mips": {C.mips.MIPS_INS_RDHWR},
"arm": ARM_BANNED_INSTRUCTIONS,
"armcm": ARM_BANNED_INSTRUCTIONS,
"aarch64": {C.arm64.ARM64_INS_MRS},
}
# https://github.com/unicorn-engine/unicorn/issues/550

Loading…
Cancel
Save