如题,小菜我从C++到SDK,MFC,硬着头皮走了两年......
太多的时间花在了一些API、函数调用方法上面。
而WINDOWS领域的东西实在太多,发现随便一样就够自己吃一壶,所以迷茫.....
看着身边大牛们经常用汇编熟练的操作着内存地址,
自己还在为某些新的API函数烦恼时,心里真的不是滋味.....
^_^
大牛们常说学习汇编能更深入的了解C++原理与机制,
学好汇编就可以对电脑的硬件以及系统的工作原理方式等等有所了解
就如同游戏打怪升级一样,也想不断的追求更好的层次,但是迷茫许久不知如此下手.
曾经看到Monster & 恨·天在黑客ERM里发表的一篇文章很是佩服。
关于扫雷外挂
http://www.hackerm.com.cn/read.php/33.htm
与他同样的是在学习VC,同的是在学习API,但是他却能用这些API组织成一个扫雷外挂。
而我却不能有他那样完美的思路,特别是那些核心的代码,自己始终捉摸不透。
发现自己就连Windows自带的扫雷外挂都让我束手无策,实在是悲哀.....
自己也曾经尝试过写写脚本之类的外挂,但是单纯的用API,
用些虚拟按键、SendMessage等函数发现真的太麻烦,效率也很低.
自己曾经很喜欢玩泡泡堂,看到挂机刷分、不死等外挂一出让人很是佩服。
曾经想去实现其中一小小部分功能,但韩国NP自己没头绪太深了。
而虚拟键鼠按键吧,始终为下下之策。。。。。
用SendMessage吧,自己也不熟悉DX开发包,除了主窗口句柄,其他都获取不到....
为了实现一个蒙蒙脱机刷分挂里的“自动踢人”功能,曾经大半天的时间看SendMessage的
两个参数wParam,lParam (主要鼠标参数)。
直接用SendMessage发吧,泡泡堂里一但跳出其他窗口后主窗口hWnd句柄无效容易当机挂了,
用PostMessage发吧,效率又太低,感觉如同我乡村的邮递员,管没管你收到没
而且不能保证所有的人是否踢完了。
所来想到后台脱机的模拟鼠标点击,
可SendMessage发送时坐标又无法确定,被wParam,lParam两个参数又搞蒙了。
经百度google数小时的查找资料,现在终于搞懂了了。
于是自己可以在瞬间把房间所有成员全踢了
(但它不知道玩家是否准备的状态,不知道如何获取,所以只好全踢了)
“自动踢人”自己整出来的代码如下:
void CTestDlg::OnBtnClick()
{
// TODO: Add your control notification handler code here
HWND hWnd = ::FindWindow(NULL,_T("泡泡堂"));
if(hWnd)
{
// 1号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(75, 140) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(75,140));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(75,140));
::PostMessage(hWnd, WM_KEYDOWN,VK_RETURN,0);
::PostMessage(hWnd, WM_KEYUP,VK_RETURN,0);
// 2号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(180, 140) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(180,140));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(180,140));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(200);
// 3号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(285, 140) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(285,140));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(285,140));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(200);
// 4号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(390, 140) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(390,140));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(390,140));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(100);
// 5号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(75,280) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(75,280));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(75,280));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(200);
// 6号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(180,280) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(180,280));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(180,280));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(200);
// 7号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(285,280) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(285,280));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(285,280));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(200);
// 8号位置
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(390,280) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(390,280));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(390,280));
::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(350,390) );
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(350,390));
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(350,390));
Sleep(200);
}
}
弄到这里,发现自己又进入自己学习的一个“误区”了,于是赶紧跳出这个“死胡同”.......
而今天,我想学习汇编能让我分析一般的代码就行......
自己没有任何汇编基础,推荐些书籍、视频等,不盛感激!
希望各位大牛们不要惜言语,给小弟指引一条路~~~~!!
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)