SinaKarvandi / Hypervisor-From-Scratch

Source code of a multiple series of tutorials about the hypervisor. Available at: https://rayanfam.com/tutorials
https://rayanfam.com/tutorials
MIT License
2.24k stars 307 forks source link

The VM loses control from windbg. #21

Open Directoree opened 1 year ago

Directoree commented 1 year ago

Hi, SinaKarvandi : Thank you very much for the tutorial, it helped me a lot. But there is a problem that has been bothering me for a long time(OS: Windows 10 x64,19044, Disabled VBS). Without enabling EPT, the GUEST_RIP was able to execute every time the VMLAUNCH instruction was executed, but when I go (g) in windbg, the VM gets stuck and loses control from windbg and cannot enter the VM-exit handler, I tried the following method to try to find the reason: Before VMLANCH execution, I promoted IRQL > =DISPATCH_LEVEL to successfully enter the VM-exit handler every time the preset conditions in the control area are triggered. But as you know, the wrong IRQL will cause BSOD, but at least it will hit the VM-exit handler. I can't find a good solution, if you know, please help me correct it, thank you very much.

SinaKarvandi commented 1 year ago

Hi, Thanks for reading it. The source code for which part behaved like this?

Directoree commented 1 year ago

Thanks for your reply, there is such a situation from part 6 code.

SinaKarvandi commented 1 year ago

Can you confirm the same problem in part 8 too? Because a lot of changes have been made to Windows (and of course hypervisor itself), so if I wanna update part 6, it will break the codes and previous explanations. But, part 8 should be fine.

Directoree commented 1 year ago

There are 2 .gif images below, the first one is compiling part 8 in VS2019; the second one is after running the driver and app the VM freezes and loses control from windbg.

https://imgloc.com/i/VZq4DV https://imgloc.com/i/VZuXMx