谢谢捧场!
看见有兄弟捧场,兴致大增。再换一种思路爆破。
1、爆破反调试1
和一楼一样无变化。
2、爆破反调试2
此次换思路。见代码
0040171D |. 57 push edi
0040171E |. 51 push ecx ; /FileName
0040171F |. FF15 04304000 call dword ptr [<&KERNEL32.LoadLibrar>; \LoadLibraryA
00401725 |. 68 EC404000 push 004040EC
0040172A |. 8D4C24 14 lea ecx, dword ptr [esp+14]
0040172E |. 8BF8 mov edi, eax
00401730 |. E8 AD050000 call <jmp.&MFC42.#860_CString::operat>
00401735 |. 8B1D 00324000 mov ebx, dword ptr [<&USER32.PostQui>; USER32.PostQuitMessage
0040173B |. 85FF test edi, edi
0040173D |. 74 2C je short 0040176B
0040173F |. 33F6 xor esi, esi
00401741 |> 8A5434 24 /mov dl, byte ptr [esp+esi+24]
00401745 |. 8D4C24 10 |lea ecx, dword ptr [esp+10]
00401749 |. 52 |push edx
0040174A |. E8 C9050000 |call <jmp.&MFC42.#940_CString::opera>
0040174F |. 46 |inc esi
00401750 |. 83FE 11 |cmp esi, 11
00401753 |.^ 7C EC \jl short 00401741
00401755 |. 8B4424 10 mov eax, dword ptr [esp+10]
00401759 |. 50 push eax ; /ProcNameOrOrdinal
0040175A |. 57 push edi ; |hModule
0040175B |. FF15 00304000 call dword ptr [<&KERNEL32.GetProcAdd>; \GetProcAddress
00401761 |. FFD0 call eax ;反调试1
00401763 |. 85C0 test eax, eax
00401765 74 04 jmp short 0040176B ;已爆破反调试1
00401767 |. 6A 00 push 0
00401769 |. FFD3 call ebx
0040176B |> 8BCD mov ecx, ebp
0040176D |. E8 2E000000 call 004017A0 ;此处跟进
见代码
004017A0 /$ 81EC 0C010000 sub esp, 10C
004017A6 |. 8D4424 08 lea eax, dword ptr [esp+8]
004017AA |. 53 push ebx
004017AB |. 55 push ebp
004017AC |. 56 push esi
004017AD |. 68 04010000 push 104 ; /BufSize = 104 (260.)
004017B2 |. 50 push eax ; |PathBuffer
004017B3 |. 8BE9 mov ebp, ecx ; |
004017B5 |. 6A 00 push 0 ; |hModule = NULL
004017B7 |. FF15 18304000 call dword ptr [<&KERNEL32.GetModuleF>; \GetModuleFileNameA
004017BD |. 6A 00 push 0 ; /hTemplateFile = NULL
004017BF |. 68 80000000 push 80 ; |Attributes = NORMAL
004017C4 |. 6A 03 push 3 ; |Mode = OPEN_EXISTING
004017C6 |. 6A 00 push 0 ; |pSecurity = NULL
004017C8 |. 6A 01 push 1 ; |ShareMode = FILE_SHARE_READ
004017CA |. 8D4C24 28 lea ecx, dword ptr [esp+28] ; |
004017CE |. 68 00000080 push 80000000 ; |Access = GENERIC_READ
004017D3 |. 51 push ecx ; |FileName
004017D4 |. FF15 14304000 call dword ptr [<&KERNEL32.CreateFile>; \CreateFileA
004017DA |. 8BD8 mov ebx, eax
004017DC |. 83FB FF cmp ebx, -1
004017DF |. 75 0C jnz short 004017ED
004017E1 |. 5E pop esi
004017E2 |. 5D pop ebp
004017E3 |. 33C0 xor eax, eax
004017E5 |. 5B pop ebx
004017E6 |. 81C4 0C010000 add esp, 10C
004017EC |. C3 retn
004017ED |> 6A 00 push 0 ; /pFileSizeHigh = NULL
004017EF |. 53 push ebx ; |hFile
004017F0 |. FF15 10304000 call dword ptr [<&KERNEL32.GetFileSiz>; \GetFileSize
004017F6 |. 8BF0 mov esi, eax
004017F8 |. 83FE FF cmp esi, -1
004017FB |. 75 0C jnz short 00401809
004017FD |. 5E pop esi
004017FE |. 5D pop ebp
004017FF |. 33C0 xor eax, eax
00401801 |. 5B pop ebx
00401802 |. 81C4 0C010000 add esp, 10C
00401808 |. C3 retn
00401809 |> 57 push edi
0040180A |. 56 push esi
0040180B |. E8 1A050000 call <jmp.&MFC42.#823_operator new>
00401810 |. 83C4 04 add esp, 4
00401813 |. 8D5424 14 lea edx, dword ptr [esp+14]
00401817 |. 8BF8 mov edi, eax
00401819 |. 6A 00 push 0 ; /pOverlapped = NULL
0040181B |. 52 push edx ; |pBytesRead
0040181C |. 56 push esi ; |BytesToRead
0040181D |. 57 push edi ; |Buffer
0040181E |. 53 push ebx ; |hFile
0040181F |. FF15 0C304000 call dword ptr [<&KERNEL32.ReadFile>] ; \ReadFile
00401825 |. 53 push ebx ; /hObject
00401826 |. FF15 08304000 call dword ptr [<&KERNEL32.CloseHandl>; \CloseHandle
0040182C |. 8A47 3C mov al, byte ptr [edi+3C]
0040182F |. 884424 10 mov byte ptr [esp+10], al
00401833 |. 8B4424 10 mov eax, dword ptr [esp+10]
00401837 |. 25 FF000000 and eax, 0FF
0040183C |. 2BF0 sub esi, eax
0040183E |. 8D0C38 lea ecx, dword ptr [eax+edi]
00401841 |. 56 push esi
00401842 |. 51 push ecx
00401843 |. 8B79 FC mov edi, dword ptr [ecx-4]
00401846 |. 8BCD mov ecx, ebp
00401848 |. E8 23000000 call 00401870 ;核心校验,跟进
见代码
00401870 /$ 81EC 00040000 sub esp, 400
00401876 |. 33C9 xor ecx, ecx
00401878 |. 8D5424 00 lea edx, dword ptr [esp]
0040187C |. 56 push esi
0040187D |> 8BC1 /mov eax, ecx
0040187F |. BE 08000000 |mov esi, 8
00401884 |> A8 01 |/test al, 1
00401886 |. 74 09 ||je short 00401891
00401888 |. D1E8 ||shr eax, 1
0040188A |. 35 2083B8ED ||xor eax, EDB88320
0040188F |. EB 02 ||jmp short 00401893
00401891 |> D1E8 ||shr eax, 1
00401893 |> 4E ||dec esi
00401894 |.^ 75 EE |\jnz short 00401884
00401896 |. 8902 |mov dword ptr [edx], eax
00401898 |. 41 |inc ecx
00401899 |. 83C2 04 |add edx, 4
0040189C |. 81F9 00010000 |cmp ecx, 100
004018A2 |.^ 7C D9 \jl short 0040187D
004018A4 |. 8B8C24 0C0400>mov ecx, dword ptr [esp+40C]
004018AB |. 83C8 FF or eax, FFFFFFFF
004018AE |. 8BD1 mov edx, ecx
004018B0 |. 49 dec ecx
004018B1 |. 85D2 test edx, edx
004018B3 |. 74 27 je short 004018DC
004018B5 |. 8D71 01 lea esi, dword ptr [ecx+1]
004018B8 |. 8B8C24 080400>mov ecx, dword ptr [esp+408]
004018BF |. 53 push ebx
004018C0 |> 8BD0 /mov edx, eax
004018C2 |. 33DB |xor ebx, ebx
004018C4 |. 8A19 |mov bl, byte ptr [ecx]
004018C6 |. 81E2 FF000000 |and edx, 0FF
004018CC |. 33D3 |xor edx, ebx
004018CE |. C1E8 08 |shr eax, 8
004018D1 |. 8B5494 08 |mov edx, dword ptr [esp+edx*4+8]
004018D5 |. 33C2 |xor eax, edx
004018D7 |. 41 |inc ecx
004018D8 |. 4E |dec esi
004018D9 |.^ 75 E5 \jnz short 004018C0
004018DB |. 5B pop ebx
004018DC F7D0 not eax ;此处爆破
把文件偏移0x18DC处字节F7D0改为8BC7即可
3、爆破注册
和一楼一样无变化。
爆破反调试2的思路变化带来的好处就是不用千辛万苦寻找定时器响应函数了。我当初找得好辛苦。