[WINDOWS]Page Entry replacement
Posted: Sat Feb 19, 2011 5:38 am
Hello, I'm developing a driver which will hook the Page Fault Handler, wait for a specific page to be requested to be loaded,
and point his Page Entry's page frame to my own allocated page.
**It might seem like malware , but it is not.
The code is pretty much logical, the page frame is indeed replaced.
BUT, as soon as i try to IRET back to user-mode, I get a 'memory corruption' BSOD telling me that the PTE is corrupt.
My code can be viewed here: http://codepad.org/ZJgaamFa
The header file included with the file above can be viewed here: http://codepad.org/8Un7E3Kg
My question is, what could be wrong with the Page Entry?
Could it be the type of memory which is assigned to the entry is incorrect? are some fields of the entry incorrect?
Thanks in advance.
and point his Page Entry's page frame to my own allocated page.
**It might seem like malware , but it is not.
The code is pretty much logical, the page frame is indeed replaced.
BUT, as soon as i try to IRET back to user-mode, I get a 'memory corruption' BSOD telling me that the PTE is corrupt.
Code: Select all
MEMORY_MANAGEMENT (1a)
# Any other values for parameter 1 must be individually examined.
Arguments:
Arg1: 00041284, A PTE or the working set list is corrupt.
Arg2: 00401001
Arg3: 00000000
Arg4: c0883000
My code can be viewed here: http://codepad.org/ZJgaamFa
The header file included with the file above can be viewed here: http://codepad.org/8Un7E3Kg
My question is, what could be wrong with the Page Entry?
Could it be the type of memory which is assigned to the entry is incorrect? are some fields of the entry incorrect?
Thanks in advance.