做了注释 方便大家看 mProc proc uses ebx edi esi,hWnd,uMsg,wParam,lParam ;消息处理函数
mov eax,uMsg
.if eax==WM_TIMER;消息类型=定时器 invoke FindWindow,offset szWndClass,offset szWndText ;查找窗口局柄 mov hWndZwei,eax ;hWndZwei=窗口局柄 .if hWndZwei==NULL .else ;游戏正在运行 mov eax,wParam .if eax==1 ;定时器1 invoke ReadProcessMemory,hZwei,AddrMoney2,offset nByte,1,NULL ;读取AddrMoney2地址1个字节,用于加密运算 invoke ProcWrite,nByte,nMoney ;进行加密 mov lpBuf2,eax invoke WriteProcessMemory,hZwei,AddrMoney1,offset lpBuf2,4,NULL ;AddrMoney1处写入加密后的结果 .elseif eax==2 ;定时器2 invoke ReadProcessMemory,hZwei,AddrHp2,offset nByte,1,NULL invoke ProcWrite,nByte,nHp mov lpBuf2,eax invoke WriteProcessMemory,hZwei,AddrHp1,offset lpBuf2,4,NULL invoke ReadProcessMemory,hZwei,AddrHpMax2,offset nByte,1,NULL invoke ProcWrite,nByte,nHpMax mov lpBuf2,eax invoke WriteProcessMemory,hZwei,AddrHpMax1,offset lpBuf2,4,NULL .endif .endif
.elseif eax==WM_INITDIALOG ;对话框初始化 invoke SendDlgItemMessage,hWnd,IDC_Money,EM_LIMITTEXT,10,0 invoke SetDlgItemInt,hWnd,IDC_Money,1000000,FALSE invoke SetDlgItemInt,hWnd,IDC_Bag,150,FALSE invoke SetDlgItemInt,hWnd,IDC_Exp,999999,FALSE invoke SetDlgItemInt,hWnd,IDC_Att,1500,FALSE invoke SetDlgItemInt,hWnd,IDC_Def,1500,FALSE invoke SetDlgItemInt,hWnd,IDC_Luck,50,FALSE invoke SetDlgItemInt,hWnd,IDC_Mp,1500,FALSE invoke SetDlgItemInt,hWnd,IDC_Hp,100,FALSE invoke SetDlgItemInt,hWnd,IDC_HpMax,100,FALSE invoke GetDlgItem,hWnd,IDC_Qidong invoke EnableWindow,eax,FALSE .elseif eax==WM_COMMAND ;按钮事件 mov eax,wParam .if ax==IDC_Lock ;锁定金钱 invoke FindWindow,offset szWndClass,offset szWndText ;查找游戏窗口 mov hWndZwei,eax .if hWndZwei==NULL invoke MessageBox,hWnd,offset szText,offset szCap,MB_OK ;对话框:请先运行游戏!!! .else invoke GetDlgItemInt,hWnd,IDC_Money,NULL,FALSE ;得到想要锁定的金钱数 add eax,eax ;金钱数*2(加密算法的第一步) mov nMoney,eax invoke GetWindowThreadProcessId,hWndZwei,offset pID invoke OpenProcess,PROCESS_VM_OPERATION or PROCESS_VM_READ or PROCESS_VM_WRITE,TRUE,pID ;打开进程,全部权限 .if eax mov hZwei,eax invoke SetTimer,hWnd,1,100,NULL ;创建定时器,100ms .endif .endif
.elseif ax==IDC_Liulan invoke RtlZeroMemory,offset ofn,sizeof ofn ; ;OPENFILENAME STRUCT ; lStructSize DWORD ? ; hwndOwner HWND ? ; hInstance HINSTANCE ? ; lpstrFilter LPCSTR ? ; lpstrCustomFilter LPSTR ? ; nMaxCustFilter DWORD ? ; nFilterIndex DWORD ? ; lpstrFile LPSTR ? ; nMaxFile DWORD ? ; lpstrFileTitle LPSTR ? ; nMaxFileTitle DWORD ? ; lpstrInitialDir LPCSTR ? ; lpstrTitle LPCSTR ? ; Flags DWORD ? ; nFileOffset WORD ? ; nFileExtension WORD ? ; lpstrDefExt LPCSTR ? ; lCustData LPARAM ? ; lpfnHook DWORD ? ; lpTemplateName LPCSTR ? ;OPENFILENAME ENDS
mov ofn.lStructSize,sizeof ofn push hWnd pop ofn.hwndOwner mov ofn.lpstrFilter,offset lpFilter mov ofn.lpstrFile,offset szFileName mov ofn.nMaxFile,MAX_PATH mov ofn.Flags,OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST invoke GetOpenFileName,offset ofn .if eax mov dx,ofn.nFileOffset mov nFOffset,dx invoke lstrcpy,offset szFileName2,offset szFileName xor edx,edx mov esi,offset szFileName2 mov dx,nFOffset ;dx=程序所在目录的长度 add esi,edx mov byte ptr [esi],0 invoke lstrcat,offset szFileName2,offset szSubDir ;szFileName2=程序所在目录\Plugins\arpg.dal invoke CreateFile,offset szFileName2,GENERIC_READ or GENERIC_WRITE,0,NULL,\ OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL ;打开arpg.dal mov hFile,eax .if hFile==INVALID_HANDLE_VALUE invoke MessageBox,hWnd,offset szText2,offset szCap,MB_OK ;打开失败提示请先退出游戏!!! .else invoke SetFilePointer,hFile,AddrFile1,NULL,FILE_BEGIN ;设定文件指针 invoke ReadFile,hFile,offset lpBuf,2,offset lpBuf2,NULL ;读取程序校验处代码 .if lpBuf==2f75h || lpBuf==9090h ;是否为752f或9090 mov lpBuf,00009090h invoke SetFilePointer,hFile,AddrFile1,NULL,FILE_BEGIN invoke WriteFile,hFile,offset lpBuf,2,offset lpBuf2,NULL ;jnz改为nop去除校验 invoke SetFilePointer,hFile,AddrFile2,NULL,FILE_BEGIN invoke ReadFile,hFile,offset lpBuf,2,offset lpBuf2,NULL ;读取程序校验处代码 .if lpBuf==0e75h || lpBuf==9090h mov lpBuf,00009090h invoke SetFilePointer,hFile,AddrFile2,NULL,FILE_BEGIN invoke WriteFile,hFile,offset lpBuf,2,offset lpBuf2,NULL ;jnz改为nop去除校验 .endif invoke CloseHandle,hFile ;关闭文件局柄 invoke GetDlgItem,hWnd,IDC_Qidong invoke EnableWindow,eax,TRUE ;允许启动游戏按钮 invoke GetDlgItem,hWnd,IDC_Liulan invoke EnableWindow,eax,FALSE ;禁止浏览按钮 invoke SetDlgItemText,hInst,IDC_Lujing,offset szFileName ;写上游戏路径 .endif .endif .endif
.elseif eax==IDC_Qidong invoke WinExec,offset szFileName,SW_SHOW ;调用WinExec来运行游戏 .endif
.endif
mProc endp
|