ionescu007/SimpleVisor

crash on debug code

sidyhe opened this issue · 2 comments

When use the option "/Od", Windows must be BSOD, in my VMWare
I found that it is caused by ShvOsCaptureContext
Via IDA, the function is jmp RtlCaptureContext with "/Ox"
and is sub rsp, xxx; ...; call RtlCaptureContext; add rsp, xxx; retn; with "/Od"
so, move the implement to asm, simple to jmp, and it worked fine on debug code

Hi,

This is by design -- in order to reduce the amount of assembly, some tricks -- such as dependency on FORCEINLINE function is needed. But I'm happy you found a workaround.

I will try to see if a #pragma optimize can also be used to force this to work.

--
Best regards,
Alex Ionescu

hope fix ,ths