Comments (3)
Hey, thanks for the positive feedback.
I've known people who have successfully implemented this, though I don't know too much of the specifics of what they did. I believe what they did was set the vm controls to exit on cr3, and when the target cr3 they cared for was swapped in, they would apply the EPT hook, and if the target cr3 was swapping out, it would remove the hook. The problem they dealt with was the Meltdown patch, which means that now there are two cr3 pointers per process now, so you have to watch out for either of those pointers during the cr3 exit. The EPT violation will happen for the process's usermode cr3 (probably, though a syscall could make the exit come from the kernel cr3), but as part of the exit the VMCS_HOST_CR3
control dictates that the System DTB will be loaded in, so you won't actually see the user process's memory by default in the exit handler. You'll need to set your cr3 value to the value from the cr3 exit or read the guest's cr3 value.
Hopefully that provides some insight.
from gbhv.
Note that usermode pages are always tradable. That means that, at any time, the memory manager can choose to copy the page to a different physical page in order to defragment the physical memory layout. This happens to free up larger contiguous physical ranges for things like network buffers when the system is under memory pressure or has been running for a very long time. It's probably unlikely to happen, but still definitely possible. So, be aware of this, because that means that the kernel might cause an EPT violation on your page when you're not expecting it.
from gbhv.
Thank you for the invaluable insight. I'll keep working on it.
from gbhv.
Related Issues (20)
- How to add more then one api hook? HOT 1
- syscall hook
- Build process fails on latest VS2019 with latest WDK
- Windows > 1809 support
- HvEptAddPageHook failing HOT 38
- WHEA_UNCORRECTABLE_ERROR (124) HOT 10
- AMD-V support HOT 1
- Wrong loop logic when using LDE HOT 3
- Exit Handler issues HOT 2
- VMLaunch hangs when enabling rdtsc exiting HOT 6
- win7 x64 sp1 BSOD HOT 1
- BSOD - SYSTEM THREAD EXCEPTION NOT HANDLED HOT 2
- BUG HvEptHookWriteAbsoluteJump HOT 3
- How to hook cpuid ? HOT 2
- can fix unload drv?
- Any way is a manualmap?
- Guest freezed on Virtualbox after successful vmlaunch HOT 1
- project still active? HOT 4
- Release version not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gbhv.