I want to place a jumper in Win 10 x64 win32k .text (PatchGuard disabled). However it seems this no longer works (on Windows 8 x64 and before it did):
- Flaut
Code: Select all
It fails with: ATTEMPTED_WRITE_TO_READONLY_MEMORY (be) at MmMapLockedPagesSpecifyCache. I am calling the code from the context of csrss.exe (GUI process) and before get win32k via ZwQuerySystemInformation SystemModuleInfo.
PMDL Mdl = NULL;
__try
{
// Create a descriptor
Mdl = IoAllocateMdl(Address,Length,FALSE,FALSE,NULL);
// Lock pages for io modification access
MmProbeAndLockPages(Mdl,KernelMode,IoModifyAccess);
// Map physical locked page
AddrMapped = MmMapLockedPagesSpecifyCache(Mdl,KernelMode,MmNonCached,NULL,FALSE,HighPagePriority);
RtlCopyMemory(AddrMapped, Data, Length);
}
// Cleanup
__finally
{
if(AddrMapped)
MmUnmapLockedPages(AddrMapped, Mdl);
if(Mdl != NULL)
{
MmUnlockPages(Mdl);
IoFreeMdl(Mdl);
}
}
- Flaut