Skip to content

Commit

Permalink
Also ignore missing unicorn registers in the fallback emulator (#2531)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boyan-MILANOV committed Feb 11, 2022
1 parent bf2fba3 commit 793b1de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions manticore/utils/fallback_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ def _step(self, instruction):
"0x%x:\t%s\t%s" % (instruction.address, instruction.mnemonic, instruction.op_str)
)

registers = set(self._cpu.canonical_registers)
ignore_registers = {"FIP", "FOP", "FDS", "FCS", "FDP", "MXCSR_MASK"}
registers = set(self._cpu.canonical_registers) - ignore_registers

# Refer to EFLAGS instead of individual flags for x86
if self._cpu.arch == CS_ARCH_X86:
Expand Down Expand Up @@ -279,7 +280,7 @@ def _step(self, instruction):

if logger.isEnabledFor(logging.DEBUG):
logger.debug("=" * 10)
for register in self._cpu.canonical_registers:
for register in registers:
logger.debug(
f"Register {register:3s} "
f"Manticore: {self._cpu.read_register(register):08x}, "
Expand Down

0 comments on commit 793b1de

Please sign in to comment.