Joined: 14 Feb 2009 Posts: 27 Location: Planet 3 Solar System Orion Arm Spiral Galaxy Milky Way
Posted: Fri Oct 30, 2015 6:09 am Post subject: Effect of KeStackAttachProcess
The documented effect of KeStackAttachProcess is to attach the current thread to the address space of the target process. But how does Windows achieve this behind the scene? Does it mean the CR3 of the current process (stored in the KPROCESS->DirectoryTableBase member) is changed to that of the target process.
If that is true, and if I'm issuing the API call in a system thread, does it cause any issue since that would modify the system process's CR3 ?
Joined: 09 May 2003 Posts: 25817 Location: The netherlands
Posted: Tue Nov 03, 2015 3:14 pm Post subject:
CR3 is changed yes, and probably some other internal structures are changed as well to deal with exceptions (like a timer interrupt signailing a task switch event)
If you're manually going to change CR3 then I recommend disabling interrupts for the current cpu, and don't trigger exceptions. (or capture them yourself by changing the local cpu's IDT to your own while external interrupts are disabled) _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum