From dfa8ed8c5a510fd32729ace52597d0b7b3672811 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Wed, 8 Jun 2016 12:08:08 -0700 Subject: [PATCH] Add configuration point for code emulation --- pwndbg/commands/context.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pwndbg/commands/context.py b/pwndbg/commands/context.py index 1d2c73159..439d1dc65 100644 --- a/pwndbg/commands/context.py +++ b/pwndbg/commands/context.py @@ -87,11 +87,14 @@ def get_regs(*regs): return result - +pwndbg.config.Parameter('emulate', True, ''' +Unicorn emulation of code near the current instruction +''') def context_code(): banner = [pwndbg.color.blue(pwndbg.ui.banner("code"))] - result = pwndbg.commands.nearpc.nearpc(to_string=True, emulate=True) + emulate = bool(pwndbg.config.emulate) + result = pwndbg.commands.nearpc.nearpc(to_string=True, emulate=emulate) # If we didn't disassemble backward, try to make sure # that the amount of screen space taken is roughly constant.