Handle ImportError exception of pwndbg.emu.emulator in disasm

pull/81/head
MengHuan Yu 10 years ago committed by Zach Riggle
parent 0c60dda07b
commit ded18e02ee

@ -2,9 +2,10 @@ from __future__ import print_function
from __future__ import unicode_literals
import functools
import six
import re
import six
import gdb
import pwndbg.config
import pwndbg.enhance

@ -20,7 +20,6 @@ import pwndbg.symbol
import pwndbg.ui
import pwndbg.vmmap
pwndbg.config.Parameter('highlight-pc', True, 'whether to highlight the current instruction')
@pwndbg.commands.ParsedCommand

@ -22,6 +22,11 @@ import pwndbg.memoize
import pwndbg.memory
import pwndbg.symbol
try:
import pwndbg.emu.emulator
except:
pwndbg.emu = None
disassembler = None
last_arch = None
@ -144,7 +149,7 @@ def near(address, instructions=1, emulate=False):
emu = None
# If we hit the current instruction, we can do emulation going forward from there.
if address == pc and emulate:
if address == pc and pwndbg.emu and emulate:
emu = pwndbg.emu.emulator.Emulator()
# For whatever reason, the first instruction is emulated twice.

Loading…
Cancel
Save