注册 登录
编程论坛 汇编论坛

调用VirtualProtect返回0,调用GetLastError函数返回值是03E6,请问怎么解决?

chinasmu 发布于 2011-10-16 15:06, 1397 次点击
想hool掉Wsock32.dll的send函数的前5个字节,要改一直内存属性,但是失败!

之前我没有提权,需要提权吗?
求解!
3 回复
#2
Cbp2011-10-26 13:11
用Error Lookup看下就知道了
内存分配访问无效。
#3
Cbp2011-10-26 13:14
BOOL VirtualProtect(
LPVOID lpAddress,
DWORD dwSize,
DWORD flNewProtect,
PDWORD lpflOldProtect );
lpAddress
Pointer to the base address of the region of pages whose access protection attributes are to be changed.
All pages in the specified region must have been allocated in a single call to the VirtualAlloc function. The pages cannot span adjacent regions that were allocated by separate calls to VirtualAlloc.

这里的问题
#4
zaixuexi2011-11-18 10:32
VirtualProtect可以
还可以#pragma comment(linker,"/section:.text,RW")
1