winmine学習ノート
7674 ワード
ゲームのコール
// ( ), ( ), ( ), (error/warning/ok)
int MessageBox{
__in HWND hWnd,
__in LPSTSTR lpText,
__in LPCTSTR lpCaption,
__in UNIT uType
}
// ( ), , ,
LRESULT CALLBACK WindowProc{
__in HWND hwnd,
__in UINT uMsg,
__in WPARAM wParam,
__in LPARAM lParam
}
// ,WindowProc ,uMsg=WM_COMMAND,wParam ID( )
ゲームのベースアドレス
ベースアドレスコンセプト:グローバル変数、文字定数などのアドレス、毎回開く
MFCコントロールメニュー
/* VS ctrl+f1 VS , SendMessage FindWindow API
SendMessage :
LRESULT WINAPI SendMessage(
_In_ HWND hWnd,
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
*/
// MFC 4 ,
void CwinmineDlg::OnBnClickedButton1(){
HWND hWnd = ::FindWindow(NULL, _T(" "));
if (NULL == hWnd) {
::MessageBox(NULL, _T(" "),_T(" "),MB_OK);
return ;
}
::SendMessage(hWnd, WM_COMMAND, 0x209, 0);
}
void CwinmineDlg::OnBnClickedButton2(){
HWND hWnd = ::FindWindow(NULL, _T(" "));
if (NULL == hWnd) {
::MessageBox(NULL, _T(" "),_T(" "), MB_OK);
return;
}
::SendMessage(hWnd, WM_COMMAND, 0x20A, 0);
}
void CwinmineDlg::OnBnClickedButton3(){
HWND hWnd = ::FindWindow(NULL, _T(" "));
if (NULL == hWnd) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
::SendMessage(hWnd, WM_COMMAND, 0x20B, 0);
}
void CwinmineDlg::OnBnClickedButton4(){
for (int i = 0; i < 3; i++) {
OnBnClickedButton1();
Sleep(1000);
OnBnClickedButton2();
Sleep(1000);
OnBnClickedButton3();
Sleep(1000);
}
}
//
MFCベースアドレス読み出し
// , , , int, m_num_mine
// , , VS
void CwinmineDlg::OnBnClickedButton5(){
DWORD pid;
HWND hWnd = ::FindWindow(NULL, _T(" "));
if (NULL == hWnd) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
GetWindowThreadProcessId(hWnd, &pid);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if (NULL == hProcess) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
ReadProcessMemory(hProcess, (LPCVOID)0x1005194, &m_num_mine, sizeof(m_num_mine), &pid);
UpdateData(FALSE);
}
CE雷域情報の検索
char a[24][32];//
Spy++検索メッセージ
MFCゲームアシスト
編集ボックスを作成し、プロパティのマルチ動作Trueを設定します.読み取り専用はTrueです.バインド変数を生成します.変数名m_strshowdata,カテゴリvalue
ボタンを作成して、文字を説明します:自動的に雷を掃いて、写実的な現代コードをダブルクリックします
BOOL PostMessage(
__in HWND hWnd,
__in UINT Msg,
__in WPARAM wParam,
__in LPARAM lParam,
)// ,SendMessage
void CwinmineDlg::OnBnClickedButton6(){
DWORD pid;
HWND hWnd = ::FindWindow(NULL, _T(" "));
if (NULL == hWnd) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
GetWindowThreadProcessId(hWnd, &pid);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if (NULL == hProcess) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
/*
0x01005361 ,0x8F
0x01005338 , 16
0x01005334 , 16
*/
unsigned char gamedata[24][32] = { 0 };
if (!ReadProcessMemory(hProcess, (LPCVOID)0x01005361, &gamedata, 24 * 32, &pid)) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
DWORD rows;
if (!ReadProcessMemory(hProcess, (LPCVOID)0x01005338, &rows, sizeof(rows), &pid)) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
DWORD columns;
if (!ReadProcessMemory(hProcess, (LPCVOID)0x01005334, &columns, sizeof(columns), &pid)) {
::MessageBox(NULL, _T(" "), _T(" "), MB_OK);
return;
}
m_strshowdata.Empty();
CString strTemp = _T("");
short gamex = 20;
short gamey = 60;
unsigned short xypos[2] = { 0 };
for (int i = 0; i < rows; i++) {
for (int j = 0; j < 32; j++) {
if (0x10 == gamedata[i][j]) {
break;
}
xypos[0] = gamex + j * 16;
xypos[1] = gamey + i * 16;
if (0x8F != gamedata[i][j]) {
::PostMessage(hWnd, WM_LBUTTONDOWN, MK_LBUTTON, *(int*)xypos);
::PostMessage(hWnd, WM_LBUTTONUP, 0, *(int*)xypos);
}
strTemp.Format(_T("%02x "), gamedata[i][j]);
m_strshowdata += strTemp;
}
m_strshowdata += _T("\r
");
}
UpdateData(FALSE);
}