unicorn-engine/unicorn

Unicorn Engine Crash When Emulating DR7 Register Update with 0x10005

Z4ee opened this issue · 0 comments

Z4ee commented

When attempting to emulate the following instructions:

mov rax, 0x10005
mov dr7, rax

a crash occurs in the Unicorn emulator. This is due to the cpu_x86_update_dr7_x86_64 function calling cpu_breakpoint_insert_x86_64, which then triggers tb_flush_sparc64. The latter performs a TCG region reset (via tcg_region_reset_all_x86_64), effectively wiping the emulation region.

As a result, when cpu_x86_update_dr7_x86_64 returns, it attempts to exit into a now-cleared region, causing the crash.