为了自己的程序能够正常地运行,而又想用此界面美化一下外表,只能对已被破解动态库“skinppwtl.dll”再动一次手术:
用ollydbg调试一下,对SetWindowHookEx下断,并记录下键盘的Hook过程:
堆栈区:
0012F7A4 00000002 |HookType = WH_KEYBOARD
0012F7A8 00C8B1D2 |Hookproc = SkinPPWT.00C8B1D2 // 00C8B1D2 此为键盘钩子处理函数
0012F7AC 00000000 |hModule = NULL
0012F7B0 00000AA8 \ThreadID = AA8
在 00C8B1D2处下断并进入函数内部:
00C8B1D2 55 push ebp
00C8B1D3 8BEC mov ebp, esp
00C8B1D5 837D 08 00 cmp dword ptr [ebp+8], 0
00C8B1D9 75 73 jnz short 00C8B24E
00C8B1DB FF15 6484CD00 call dword ptr [<&USER32.GetForegroun>; USER32.GetForegroundWindow
00C8B1E1 > 8B0D 9821CF00 mov ecx, dword ptr [CF2198]
00C8B1E7 3B81 A0000000 cmp eax, dword ptr [ecx+A0]
00C8B1ED 75 5F jnz short 00C8B24E
00C8B1EF 8B45 10 mov eax, dword ptr [ebp+10]
00C8B1F2 8B55 10 mov edx, dword ptr [ebp+10]
00C8B1F5 C1E8 10 shr eax, 10
00C8B1F8 56 push esi
00C8B1F9 8BF0 mov esi, eax
00C8B1FB F7D6 not esi
00C8B1FD C1EE 0F shr esi, 0F
00C8B200 81E2 FFFF0000 and edx, 0FFFF // 取lParam中的最低16位,为按键重复次数
00C8B206 83E6 01 and esi, 1 // 取lParam中的最高位,为0表示键按下,1为释放
00C8B209 F6C4 20 test ah, 20 // 扫描码
00C8B20C 74 17 je short 00C8B225
00C8B20E 50 push eax
00C8B20F 52 push edx
00C8B210 FF75 0C push dword ptr [ebp+C]
00C8B213 85F6 test esi, esi
00C8B215 74 07 je short 00C8B21E
00C8B217 E8 F2030000 call 00C8B60E ;
00C8B21C EB 1C jmp short 00C8B23A
00C8B21E E8 79040000 call 00C8B69C ;
00C8B223 EB 15 jmp short 00C8B23A
00C8B225 50 push eax
00C8B226 52 push edx
00C8B227 FF75 0C push dword ptr [ebp+C]
00C8B22A 85F6 test esi, esi
00C8B22C 74 07 je short 00C8B235
00C8B22E E8 6E040000 call 00C8B6A1 // key down
00C8B233 EB 05 jmp short 00C8B23A
00C8B235 E8 50050000 call 00C8B78A // key up
00C8B23A 85C0 test eax, eax
00C8B23C 5E pop esi
00C8B23D 74 05 je short 00C8B244 // 这里要改成 jmp short 00C8B244
00C8B23F 6A 01 push 1
00C8B241 58 pop eax
00C8B242 EB 1F jmp short 00C8B263 // 这里会直接跳到返回处而不 CallNextHookEx,问题的所在
00C8B244 FF75 10 push dword ptr [ebp+10]
00C8B247 FF75 0C push dword ptr [ebp+C]
00C8B24A 6A 00 push 0
00C8B24C EB 09 jmp short 00C8B257
00C8B24E FF75 10 push dword ptr [ebp+10]
00C8B251 FF75 0C push dword ptr [ebp+C]
00C8B254 FF75 08 push dword ptr [ebp+8]
00C8B257 FF35 A021CF00 push dword ptr [CF21A0]
00C8B25D FF15 6884CD00 call dword ptr [<&USER32.CallNextHook>; USER32.CallNextHookEx
00C8B263 5D pop ebp
00C8B264 C2 0C00 retn 0C
把地址为00C8B23D处的je改为jmp问题即解决。
[由于本内容可能会牵涉到什么什么版权问题,改后的dll就不往外发了,要的话留个言,我会发到你邮箱]
2011-7-22 QQ空间