- UID
- 2198
注册时间2005-6-29
阅读权限255
最后登录1970-1-1
副坛主
该用户从未签到
|
华军下载:http://www.onlinedown.net/soft/67318.htm
给一段Loader的源码 Patch代码函数化了一下:
void CMyInJectDlg::OnLoader()
{
// TODO: Add your control notification handler code here
STARTUPINFO StartupInfo = {0};
StartupInfo.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION info ={0};
BOOL bcr = ::CreateProcess(_T("IM.exe"),NULL,NULL,NULL,FALSE,CREATE_SUSPENDED,
NULL,NULL,&StartupInfo,&info);
if(!bcr)
{
AfxMessageBox(_T("程序加载出错,请将本程序与IM.exe放到同一目录!"));
}
LPVOID pLoaderAddr = (void *)0x0040AF29;
CHAR PatchOldData[] = {0x0};
CHAR PatchNewData[] = {0x1};
INT dSize = 1;
PatchProcess(info.hProcess,pLoaderAddr,dSize,PatchOldData,PatchNewData);
SetRegisterInfo();
::ResumeThread(info.hThread);
::CloseHandle(info.hProcess);
::CloseHandle(info.hThread);
}
BOOL PatchProcess(HANDLE handle,LPVOID PatchAddr,INT dSize,
CHAR * PatchOldData,CHAR * PatchNewData)
{
DWORD oldProtect = 0;
DWORD dDataSize = 0;
CHAR dReadData[20] = {0};
INT dCount = 0;
::VirtualProtectEx(handle,PatchAddr,dSize,PAGE_EXECUTE_READWRITE,&oldProtect);
::ReadProcessMemory(handle,PatchAddr,&dReadData,dSize,&dDataSize);
if(StrCmp(dReadData,PatchOldData) != 0)
{
AfxMessageBox("数据修改失败,请检查程序版本是否正确。");
return FALSE;
}
::WriteProcessMemory(handle,PatchAddr,&PatchNewData,dSize,&dDataSize);
::VirtualProtectEx(handle,PatchAddr,dSize,oldProtect,&oldProtect);
return TRUE;
}
|
-
-
Fuck.rar
19.11 KB, 下载次数: 17, 下载积分: 飘云币 -2 枚
|