Preserve caller esp value

This commit is contained in:
Anthony Miles 2019-07-20 18:49:24 +12:00
parent f62030a548
commit 5e1851fcad
1 changed files with 9 additions and 6 deletions

View File

@ -364,7 +364,7 @@ __declspec(naked) void EmuFS_MovzxEaxBytePtrFs24()
movzx eax, byte ptr[eax + 24h]
call UnlockFS
ret
}
}
UnlockFS();
}
@ -420,14 +420,17 @@ __declspec(naked) void EmuFS_MovFs00Esp()
{
// Note : eax must be preserved here, hence the push/pop
__asm
{
{
pushfd
call LockFS
call EmuFS_RefreshKPCR
push eax
mov eax, fs : [TIB_ArbitraryDataSlot]
mov [eax], esp
push eax
mov eax, fs : [TIB_ArbitraryDataSlot]
mov [eax], esp
add [eax], 12 // account for esp changes from pushed registers and return address
pop eax
call UnlockFS
call UnlockFS
popfd
ret
}
}