-
-
[求助]请问:我用NtWriteVirtualMemory写内存为何总是失败?(RING 3) 谢谢!!
-
发表于:
2010-5-3 15:16
7383
-
[求助]请问:我用NtWriteVirtualMemory写内存为何总是失败?(RING 3) 谢谢!!
typedef
NTSTATUS
(NTAPI*pfnNtWriteVirtualMemory)(
HANDLE ProcessHandle,
PVOID BaseAddress,
PVOID Buffer,
ULONG BufferLength,
PULONG ReturnLength OPTIONAL
);
pfnNtWriteVirtualMemory NtWriteVirtualMemory = (pfnNtWriteVirtualMemory)GetProcAddress(GetModuleHandle ( "ntdll.dll" ),"NtWriteVirtualMemory");
int main()
{
UpTokenPrivileges(); //提权
NTSTATUS status;
HANDLE w_hopen = OpenProcess(PROCESS_ALL_ACCESS,0,632);
DWORD temp=0x74;
status = NtWriteVirtualMemory(w_hopen,(LPVOID)0x6F2A0930,&temp,1,NULL);
if(!NT_SUCCESS(status))
MessageBox(NULL,"0","0",MB_OK);
return 0;
}
NtWriteVirtualMemory函数的地址已获取到,openprocess也没问题.难道是我参数的问题吗? 总是失败,郁闷死了.
请各位指点一下,我这是第一次这样用.我这是在ring3下调用的
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课