15,471
社区成员
发帖
与我相关
我的任务
分享
typedef int (* returnInt)();
int return0()
{
return 0;
}
//////////////////////////////////////////////////////
union
{
returnInt lpfun;
char * lpchar;
};
lpfun=return0;
DWORD oldProtect;
if(VirtualProtectEx(AfxGetInstanceHandle(),lpfun,10,PAGE_READWRITE,&oldProtect))
AfxMessageBox("DDD");
CString str;
str.Format("%d",lpchar[0]);
AfxMessageBox(str);
lpchar[0]=4;
str.Format("%d",lpchar[0]);
AfxMessageBox(str);
一直不成功,VirtualProtectEx执行失败,求指点,请问还有其他什么注意点么?