Setting to disable inline symbols replacement in disasm (#2387)

* Add setting to disable inline symbol substitution

* lint
pull/2388/head
OBarronCS 1 year ago committed by GitHub
parent d59ae31360
commit 331e61a48e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -84,6 +84,12 @@ pwndbg.config.add_param(
"Number of characters in strings to display in disasm annotations",
)
pwndbg.config.add_param(
"disasm-inline-symbols",
True,
"Enable replacing constant operands with their symbol in the disassembly",
)
def syntax_highlight(ins):
return H.syntax_highlight(ins, filename=".asm")
@ -297,7 +303,7 @@ class DisassemblyAssistant:
op.before_value, instruction, op, emu
)
if op.symbol and op.type == CS_OP_IMM:
if op.symbol and op.type == CS_OP_IMM and pwndbg.config.disasm_inline_symbols:
# Make an inline replacement, so `jmp 0x400122` becomes `jmp function_name`
instruction.asm_string = instruction.asm_string.replace(
hex(op.before_value), op.symbol

Loading…
Cancel
Save