|
|
|
|
|
|
|
|
|
|
|
[求助]WriteProcessMemory,c++内联汇编
/////////// __declspec(naked) void myfunc(){ _asm { push ecx push ebx mov ecx,0x27A606A4 mov ebx,5000 mov [ecx],ebx pop ebx pop ecx } } /////////// ////// DWORD add=0x27A606A4,是目标进程的一个地址 DWORD oldprot; BOOL ret =::VirtualProtectEx( prochandle,(LPVOID)add, 4, PAGE_READWRITE, &oldprot); if(ret == FALSE) { MessageBox("无法修改内存读写性质"); return ; } if(!::WriteProcessMemory(prochandle,baseaddr,myfunc,1024*4,NULL)) { MessageBox("将函数写内存出错"); return ; } HANDLE tid; DWORD id2; tid=CreateRemoteThread(prochandle,NULL,0,(LPTHREAD_START_ROUTINE)baseaddr,0,0,&id2);//远程调用函数 WaitForSingleObject(tid,INFINITE);//等待线程结束 //恢复原来的保护方式 ret=::VirtualProtectEx(prochandle, (LPVOID)add, 4, oldprot, NULL); if(ret == FALSE) { MessageBox("无法恢复内存读写性质"); return ; } ////////// 按楼上的提示,修改了一下,还是提示 "无法恢复内存读写性质",读出来的值,2次MessageBox值是一样的。 我觉得,是不是r0中,对CreateRemoteThread进行挂钩了? 但是,我od是可以附加的 |
|
[求助]WriteProcessMemory,c++内联汇编
/////////// __declspec(naked) void myfunc(){ _asm { push ecx push ebx mov ecx,0x27A606A4 mov ebx,5000 mov [ecx],ebx pop ebx pop ecx } } /////////// ////// DWORD add=0x27A606A4,是目标进程的一个地址 DWORD oldprot; BOOL ret =::VirtualProtectEx( prochandle,(LPVOID)add, 4, PAGE_READWRITE, &oldprot); if(ret == FALSE) { MessageBox("无法修改内存读写性质"); return ; } if(!::WriteProcessMemory(prochandle,baseaddr,myfunc,1024*4,NULL)) { MessageBox("将函数写内存出错"); return ; } //恢复原来的保护方式 ret=::VirtualProtectEx(prochandle, (LPVOID)add, 4, oldprot, NULL); if(ret == FALSE) { MessageBox("无法恢复内存读写性质"); return ; } ////////// |
|
[求助]WriteProcessMemory,c++内联汇编
DWORD add=0x27A606A4,是目标进程的一个地址 ///////// 刚刚从你的个人资料里面看到QQ,我加了你好友,您通过一下 我以前一直都是win32程序开发,刚自学了一个月驱动开发,希望以后可以互相学习 |
|
[求助]WriteProcessMemory,c++内联汇编
///////////////// //改变页面属性为读写 DWORD oldprot; BOOL ret =::VirtualProtectEx( prochandle,(LPVOID)add, 4, PAGE_READWRITE, &oldprot); if(ret == FALSE) { MessageBox("无法修改内存读写性质"); return ; } if(!::WriteProcessMemory(prochandle,baseaddr,myfunc,1024*4,NULL)) { MessageBox("将函数写内存出错"); return ; } //恢复原来的保护方式 ret=::VirtualProtectEx(prochandle, (LPVOID)add, 4, oldprot, NULL); if(ret == FALSE) { MessageBox("无法恢复内存读写性质"); return ; } //////////////////// 执行后,提示 无法恢复内存读写性质, 查不出原因 |
|
[求助]WriteProcessMemory,c++内联汇编
刚自己做了一个小程序,用自己的代码读写内存,可以 ////// hwnd =::FindWindow(NULL ,"Form2") ; ::ReadProcessMemory(prochandle, (LPCVOID)0x012C9DC8, &m_test, 4, &byread); ..... if(!::WriteProcessMemory(prochandle,baseaddr,myfunc,1024*4,NULL)) ....... ::ReadProcessMemory(prochandle, (LPCVOID)0x012C9DC8, &m_test, 4, &byread);// ////////// 读写自己的Form2,,能达到我要的效果,也就是说, 刚才不行,是因为内存保护等问题,不知道哪位大牛有这方面资料可以参考?? |
|
|
|
[求助]WriteProcessMemory,c++内联汇编
///////////////////// ::ReadProcessMemory(prochandle, (LPCVOID)0x19B32214, &m_test, 4, &byread);// if(m_test==NULL) { MessageBox("读取内存出错"); return ; }else{ CString aa; aa.Format("%d",m_test); MessageBox(aa); } if(!::WriteProcessMemory(prochandle,baseaddr,myfunc,1024*4,NULL)) { MessageBox("将函数写内存出错"); return ; } HANDLE tid; DWORD id2; tid=CreateRemoteThread(prochandle,NULL,0,(LPTHREAD_START_ROUTINE)baseaddr,0,0,&id2);//远程调用函数 WaitForSingleObject(tid,INFINITE);//等待线程结束 VirtualFreeEx(prochandle,baseaddr,1024*4,MEM_RELEASE); ::ReadProcessMemory(prochandle, (LPCVOID)0x19B32214, &m_test, 4, &byread);// if(m_test==NULL) { MessageBox("读取内存出错"); return ; }else{ CString aa; aa.Format("%d",m_test); MessageBox(aa); } /////////////////// 感谢楼上回答,改成这样,效果是一样的,2次 MessageBox 都是7 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值