|
|
|
[求助]请教在dll中如何接收WM_COPYDATA消息
无论用BC还是VC,DLL入口想建窗口,必须开线程,在线程中建立窗口。 给你个BC的DEMO: #include <vcl.h> #include <windows.h> #include "dlg.h" #pragma hdrstop #pragma argsused typedef void __stdcall (*Pfun)(LPARAM); HINSTANCE hInstance; void __stdcall WinMain(LPARAM op1) { MainF = new TMainF(0); MainF->ShowModal(); } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved) { if(fwdreason == DLL_PROCESS_ATTACH) { hInstance = hinstDLL; Pfun lpfunc = WinMain; HANDLE hThread = CreateThread(0,0,(DWORD(__stdcall*)(void*))lpfunc,0,0,0); CloseHandle(hThread); } return 1; } ----注意,如果是把消息循环的处理交给类维护,需要使用ShowModal();否则线程立即结束,窗口一闪而逝。 如果是自建窗口,需要自建消息循环,以下是VC: //================================================================ // 函数:注册窗口 //================================================================ ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc= WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = 0; wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = 0; wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance,0); return RegisterClassEx(&wcex); } //================================================================ // 函数:建立窗口并显示之 //================================================================ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hWnd = CreateWindow(szWindowClass,TEXT(""),WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); if (!hWnd)return FALSE; mainhwnd = hWnd; ShowWindow(hWnd,nCmdShow); UpdateWindow(hWnd); return TRUE; } //================================================================ // 函数:建立窗口线程 //================================================================ DWORD WINAPI start(PVOID lParam) { MyRegisterClass(NULL); if (!InitInstance(NULL,SW_HIDE)) { MessageBox(0,TEXT("窗口初始化失败!"),szWindowClass,MB_ICONSTOP); return 0; } MSG msg; while(GetMessage(&msg,NULL,0,0))DispatchMessage(&msg); return (int) msg.wParam; } //================================================================ // 函数:窗口消息回调 // 主要做Socket通讯 // 说明一下WM_DESTROY: // 自行处理WM_CLOSE消息时需要DestoryWindow(hWnd); // 并PostQuitMessage(0); // 而交给DefWindowProc处理,则自动调用DestoryWindow(hWnd); // 那个函数也是发送WM_DESTROY消息。 // SDK里说,两个消息,至少处理一个。这是IDE自建的,只是说明一下。 //================================================================ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { .... case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } 可惜啊可惜,没有分拿。。。 |
|
[求助]VC编辑dll工程中内联汇编会经常无响应,咋回事?
没什么好奇怪的,你用VC6.0内联汇编,无论是做什么工程,只要当前在显示汇编代码,就容易VC崩溃。 这是VC6.0固有的问题。 建议使用VS2008或更高级版本,否则你想在VC6.0下内联汇编异常痛苦。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
其实,做外挂的人应该最知道服务器应该如何做才能防止他们。 不知如何被破,怎知如何防破嘛。 从这点出发,应该比较省时省力。 当然,也比较取巧,还是无法太彻底解决未能爆出的隐藏问题。 |
|
如何获得另外的进程的寄存器的值,比如ESI的值
线程运行状态下,寄存器随时都在变化,不能获取,既使获取也无效。 调试状态下,中断时,线程挂起,此时可以获取,由调试器输出各个寄存器值。 如果你不想调试却又想实时监视,只能做HOOK,在想要监视的代码点插个钩子进去,实时输出。 |
|
[分享]分享一下OD反汇编引擎。
美得很,前一向就想改造OD的BC版反汇编引擎了,一看代码那么多,全局变量又一大堆,封装起来有点难度。一直没怎么去动。没想到还是牛人多。好好好! 楼主menting与9楼bluesand都牛! PS:搞成动态库更方便,还有——改unicode版本就更帅了,嘿嘿 |
|
[求助]初学HOOK,HOOK函数中,不能正确的返回到调用的地方?
写个函数,函数内部还原hook代码,结尾跳回。由于一般跳转很远,需要E9XXXXXXXX,5byte,所以这种情况,你必须覆盖6byte,最后一个byte做nop。给你个例子 sub_12345678: pushad ;注意保存寄存器 pushfd MOV DWORD PTR SS:[EBP-14],EAX ;还原覆盖代码 LEA ECX,DWORD PTR SS:[EBP-10] .... ;做其它事 popfd popad ret 0040127E |. call 12345678 00401283 |. nop 至于怎么下hook,以及到时怎么还原,自己考虑去吧。现成代码无法给你。抱歉。 另外,如果你hook回调函数用高级语言写的,内部操作寄存器可能会因为高级语言自行增加函数头的一些操作而发生变化,取错值。这时候,你应该需要一些技巧,在hook时把寄存器保存到一个结构里,回调函数则使用结构取值与改值。 |
|
[原创]游戏外挂反外挂杂谈 [抛砖引玉,欢迎业内业外人士畅谈]
同意“做外挂与反外挂技术上是对等的,完全靠技术手段是反不住外挂的,最好的反外挂系统是游戏本身”。 更强的技术保护手段只会激发更牛的人来破解之,牛人们连操作系统都能接管,还会怕这只是运行在操作系统之下的游戏软件么?再强的保护手段也不可能做到面面俱到,而有时候就因为一个微不足道的忽略导致整个保护体系崩溃。所以游戏应该以自身的游戏逻辑保护自己,这也许比较难,比较烦,但却更有力。能够掌握在手里的服务器端,它的强大,才是反外挂的保证。而客户端的保护,全部都是一层或厚或薄的蛋壳而已,迟早要被打破。 不过我不希望游戏公司做到这点,嘿嘿。 |
|
[求助]如何获取线程入口
同进程内,一般用fs:[0]回溯到0xFFFFFFFF时,在+18处就有线程入口地址了。 但是,进程A查找进程B的线程入口地址,还真没试过。procexp上可以看到线程入口,但具体怎么实现就不知道喽。虽然进程A得到进程B的线程句柄,也可以通过GetThreadContext得到相关线程环境,但是不同进程间数据的读取显然不方便,特别是读fs:[0],不知道能不能实现,嘿嘿,也没有做实验。我也就说说罢了。 另,找到一篇也许有点用:http://www.cnblogs.com/singlerace/archive/2008/10/16/1311795.html 搜索啊搜索 |
|
[原创]查表法反汇编引擎源码
楼主那个不支持指令也太多了吧,int3及call reg等都不支持啊。。。 |
|
[原创]国服游戏封包解密-外挂制作全过程
那个啥的游戏SEND与RECV是断不到任何消息的,因为——它丫把WS2_32.dll等一些系统动态库在内存中重做了一份,调用的是备份中的SEND与RECV。很多API断不到的,就是因为有备份动态库,这招有点恶心。 但嘿嘿,数据结构上有漏洞可以迅速定位,只要了解后,就没有问题了。 就封包数据来说,MH的服务器数据包我认为是最恶心的,基本能超过楼主所构想的标准。TMP数据丢弃,想要截获,只能更委琐。 楼主把这些技术都宣传了,以后游戏公司针对性地做更改,还让不让人吃饭了哇。 |
|
[原创]RadASM 2.2.1.6 汉化更新
看雪下载页上的编译工具应该更新了,MASM32都v10了,那还V9,而RadASM也才2.2.1.2。楼主大人再做做努力,放到下载页上去,以后方便大家找才是。好事做到底嘛 。 PS:RadASM是俺最最喜欢的IDE |
|
[求助]softice启动成功后看不到窗口啊
我是在VM上装的SI,也出现这样的问题,后来想到原来有提示的: 可以在虚拟机VMware 4.0以上版本使用SoftICE,使用前稍设置一下,在VMware虚拟的系统目录里,打开其中后缀名为vmx的文件,在其未端添加: svga.maxFullscreenRefreshTick = "5" 这样一设,果然没有问题了。 |
|
[原创]Warcarft III的一个MapHack的研究及一个Anti-MapHack方案
[I]*** 2008-11-27 10:30 被 ???? **** 原因:强烈痛恨DOTA还开MH的!丫的,相当郁闷!阴人阴不到,还经常被反阴![/I] |
|
|
|
|
|
扫雷里插入代码
直接手术PE文件以达到效果,实现起来只需要改两个地方,一个是“帮助”处的强跳,一个就是在文件中找一足够空间的空白处写上代码。修改如下:(修改了9h+30h共39h个字节) 01001F09 |. /EB 04 jmp short 01001F0F 01001F0B |90 nop 01001F0C |90 nop 01001F0D |90 nop 01001F0E |90 nop 01001F0F \E8 412B0000 call 01004A55 01001F14 |. E9 90020000 jmp 010021A9 01004A55 60 pushad 01004A56 33FF xor edi, edi 01004A58 47 inc edi 01004A59 33F6 xor esi, esi 01004A5B 46 inc esi 01004A5C 8BC7 mov eax, edi 01004A5E C1E0 05 shl eax, 5 01004A61 03C6 add eax, esi 01004A63 8A80 40530001 mov al, byte ptr [eax+1005340] 01004A69 3C 0F cmp al, 0F 01004A6B 75 07 jnz short 01004A74 01004A6D 57 push edi 01004A6E 56 push esi 01004A6F E8 9EEAFFFF call 01003512 01004A74 3B35 34530001 cmp esi, dword ptr [1005334] 01004A7A ^ 76 DF jbe short 01004A5B 01004A7C 3B3D 38530001 cmp edi, dword ptr [1005338] 01004A82 ^ 76 D4 jbe short 01004A58 01004A84 61 popad 01004A85 C3 retn OK了,可以直接按F1瞬间排雷了. 我用的winmine.exe是XP pro SP1的,系统版本不同,也许程序就不同了 |
|
[原创]趁着放假,回忆点东西
说的是好。。。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值