-
-
[求助]驱动内读取进程中DLL代码段问题
-
发表于:
2022-1-12 23:58
5713
-
在驱动中想要读取进程内的代码段,但是当lpParameter指向的地址位于进程中DLL的代码段时,MmProbeAndLockPages触发C000005
PMDL pmdl = IoAllocateMdl(lpParameter, dwCodesize, FALSE, FALSE, NULL);
if (pmdl)
{
kprintf("IoAllocateMdl STATUS_SUCCESS\n");
__try
{
MmProbeAndLockPages(pmdl, UserMode, IoReadAccess);
PVOID psafebuf = MmGetSystemAddressForMdlSafe(pmdl, NormalPagePriority);
if (psafebuf)
{
kprintf("[+]MmGetSystemAddressForMdlSafe STATUS_SUCCESS\n");
.....
}
else
{
kprintf("[+]MmGetSystemAddressForMdlSafe STATUS_UNSUCCESS:\n");
}
MmUnlockPages(pmdl);
IoFreeMdl(pmdl);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
kprintf("[+]MmProbeAndLockPages:%X\n",GetExceptionCode());
I IoFreeMdl(pmdl);
}
}
用MmCopyMemory去copy代码段则是错误C0000018(STATUS_CONFLICTING_ADDRESSES)。
用MmCopyVirtualMemory去copy代码段则是错误8000000D(STATUS_PARTIAL_COPY),NumberOfBytesCopied=0。
请各位大佬赐教
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课