unicorn-engine / unicorn

Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86)
http://www.unicorn-engine.org
GNU General Public License v2.0
7.68k stars 1.35k forks source link

x86 xchg dword ptr [esp], eax invalid semantics... #1859

Closed CR3Swapper closed 1 year ago

CR3Swapper commented 1 year ago

small test case:

PUSH RAX
PUSHFQ
MOV RAX, AbsoluteAddress (or a constant for your test)
POPFQ
XCHG [RSP],RAX
RET

same issue for x86.

rax wont be the same as the constant/address in the mov rax...

CR3Swapper commented 1 year ago

(i feel retarded creating an issue related to qemu semantic inaccuracies because its highly unlikely that its really an issue on your guys end but ive debugged this for 3 days now)

wtdcode commented 1 year ago

It's a bit hard to believe this can't be emulated correctly... Could you give a full script?

CR3Swapper commented 1 year ago

😵‍💫

CR3Swapper commented 1 year ago

the issue was i was starting the emulation for 30 seconds and then after that time elapsed i read RAX and it wasnt finished emulating.

lmao my bad.

emu_start does not return an error if the time runs out...

image