ionescu007 / SimpleVisor

SimpleVisor is a simple, portable, Intel VT-x hypervisor with two specific goals: using the least amount of assembly code (10 lines), and having the smallest amount of VMX-related code to support dynamic hyperjacking and unhyperjacking (that is, virtualizing the host state from within the host). It works on Windows and UEFI.
http://ionescu007.github.io/SimpleVisor/
1.69k stars 259 forks source link

crash on debug code #27

Closed sidyhe closed 6 years ago

sidyhe commented 6 years ago

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

ionescu007 commented 6 years ago

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

DragonQuestHero commented 5 years ago

hope fix ,ths