今天破解了一个还原软件。可惜(未成功)。
我把我的思路和过程大概说下。希望有高手可以帮助下。
好了。
先打开OD:载入
RecoverSetup。exe
会弹出MessageBox显示密码错误。
然后就结束程序了 那我们就先断MessageBOx函数吧
运行后跟了一下。
00470E68 |> \33C9 xor ecx, ecx
00470E6A |. 55 push ebp
00470E6B |. 68 EC0E4700 push 00470EEC
00470E70 |. 64:FF31 push dword ptr fs:[ecx]
00470E73 |. 64:8921 mov dword ptr fs:[ecx], esp
00470E76 |. 56 push esi ; /Style
00470E77 |. 8B45 F8 mov eax, dword ptr [ebp-8] ; |
00470E7A |. 50 push eax ; |Title
00470E7B |. 57 push edi ; |Text
00470E7C |. 53 push ebx ; |hOwner
[COLOR="Red"]00470E7D |. E8 B26FF9FF call <jmp.&user32.MessageBoxA> ; [/COLOR]\MessageBoxA //这里断下来了
00470E82 |. 8945 F4 mov dword ptr [ebp-C], eax
00470E85 |. 33C0 xor eax, eax
00470E87 |. 5A pop edx
00470E88 |. 59 pop ecx
我们继续F8往下跟。。
004F91D6 |. A1 F4AC5000 mov eax, dword ptr [50ACF4]
004F91DB |. E8 60E0F8FF call 00487240
004F91E0 |. 84C0 test al, al
[COLOR="Red"]004F91E2 |. 75 1D jnz short 004F9201[/COLOR]//关键跳
004F91E4 |. 6A 10 push 10
004F91E6 |. B9 4C924F00 mov ecx, 004F924C
004F91EB |. BA 54924F00 mov edx, 004F9254
004F91F0 |. A1 24445000 mov eax, dword ptr [504424]
004F91F5 |. 8B00 mov eax, dword ptr [eax]
[COLOR="Red"]004F91F7 |. E8 887BF7FF call 00470D84[/COLOR]
004F91FC |. E8 67BCF0FF call 00404E68
004F9201 |> EB 0E jmp short 004F9211
call 00470D84这个函数 就是刚刚弹出错误Messagebox的函数
那么我们只需要把JNZ改成JMP就可以了哈。。
哈哈。。确实输入什么都可以显示出卸载驱动的主界面了啊。
但是::
之后我又输入了正确的密码:
有查看了一遍真正程序的流程应该是什么样子的。
我们开始。
OD载入:
还是断下MessageBox因为在卸载的时候会出现“是否确认卸载”的MessageBOx
我们断下来了
00470E68 |> \33C9 xor ecx, ecx
00470E6A |. 55 push ebp
00470E6B |. 68 EC0E4700 push 00470EEC
00470E70 |. 64:FF31 push dword ptr fs:[ecx]
00470E73 |. 64:8921 mov dword ptr fs:[ecx], esp
00470E76 |. 56 push esi ; /Style
00470E77 |. 8B45 F8 mov eax, dword ptr [ebp-8] ; |
00470E7A |. 50 push eax ; |Title
00470E7B |. 57 push edi ; |Text
00470E7C |. 53 push ebx ; |hOwner
[COLOR="Red"]00470E7D |. E8 B26FF9FF call <jmp.&user32.MessageBoxA> ; [/COLOR]\MessageBoxA
00470E82 |. 8945 F4 mov dword ptr [ebp-C], eax
00470E85 |. 33C0 xor eax, eax
00470E87 |. 5A pop edx
00470E88 |. 59 pop ecx
在迅闪程序的MessagBOX界面上点击“是”
继续 F8往下走
函数返回后:
004F77FB |. 8B00 mov eax, dword ptr [eax]
004F77FD |. E8 8295F7FF call 00470D84
004F7802 |. 83F8 02 cmp eax, 2
004F7805 |. 0F84 BA000000 je 004F78C5
004F780B |. 8BC3 mov eax, ebx
004F780D |. 8B15 BCC84300 mov edx, dword ptr [43C8BC] ; RecoverS.0043C908
004F7813 |. E8 84C9F0FF call 0040419C
004F7818 |. 8BF0 mov esi, eax
004F781A |. 8BC6 mov eax, esi
004F781C |. 33D2 xor edx, edx
004F781E |. 8B08 mov ecx, dword ptr [eax]
004F7820 |. FF51 68 call dword ptr [ecx+68]
004F7823 |. 8D45 DF lea eax, dword ptr [ebp-21]
004F7826 |. 33C9 xor ecx, ecx
004F7828 |. BA 21000000 mov edx, 21
004F782D |. E8 AAC0F0FF call 004038DC
004F7832 |. 8D45 DF lea eax, dword ptr [ebp-21]
004F7835 |. 8B15 28AD5000 mov edx, dword ptr [50AD28]
004F783B |. E8 D42AF1FF call 0040A314
004F7840 |. 8D45 DF lea eax, dword ptr [ebp-21]
004F7843 |. 50 push eax
004F7844 |. BA 30AD5000 mov edx, 0050AD30
004F7849 |. B1 01 mov cl, 1
004F784B |. A1 F4AC5000 mov eax, dword ptr [50ACF4]
004F7850 |. E8 6BFAF8FF call 004872C0
004F7855 |. 84C0 test al, al
004F7857 |. 74 1F je short 004F7878
004F7859 |. 6A 40 push 40
004F785B |. B9 04794F00 mov ecx, 004F7904
004F7860 |. BA 0C794F00 mov edx, 004F790C
004F7865 |. A1 24445000 mov eax, dword ptr [504424]
004F786A |. 8B00 mov eax, dword ptr [eax]
004F786C |. E8 1395F7FF call 00470D84
004F7871 |. E8 42F0FFFF call 004F68B8
004F7876 |. EB 4D jmp short 004F78C5
004F77FD |. E8 8295F7FF call 00470D84
就是我们刚刚的弹出消息的函数。
之后我跟了好几遍
发现真正卸载驱动的函数:
004F7850 |. E8 6BFAF8FF call 004872C0
在这里面
我又F7跟进去了
004872C0 /$ 55 push ebp
004872C1 |. 8BEC mov ebp, esp
004872C3 |. 33C0 xor eax, eax
004872C5 |. 833D 4C9D5000>cmp dword ptr [509D4C], 0
004872CC |. 74 0C je short 004872DA
004872CE |. 8B45 08 mov eax, dword ptr [ebp+8]
004872D1 |. 50 push eax
004872D2 |. 51 push ecx
004872D3 |. 52 push edx
004872D4 |. FF15 4C9D5000 call dword ptr [509D4C] ; DevInsta.HintUnInstall
004872DA |> 5D pop ebp
004872D4 |. FF15 4C9D5000 call dword ptr [509D4C] ; 再跟进去这个函数。
033D5770 > 64:A1 00000000 mov eax, dword ptr fs:[0]
033D5776 6A FF push -1
033D5778 68 89B73D03 push 033DB789
033D577D 50 push eax
033D577E A0 E4984203 mov al, byte ptr [34298E4]
033D5783 64:8925 0000000>mov dword ptr fs:[0], esp
033D578A 83EC 18 sub esp, 18
033D578D 84C0 test al, al
033D578F 74 19 je short 033D57AA
033D5791 68 A7010000 push 1A7
033D5796 68 94C53D03 push 033DC594 ; ASCII ".\DevInstallDll.cpp"
033D579B 68 A4C63D03 push 033DC6A4
033D57A0 6A 00 push 0
033D57A2 E8 79CAFFFF call 033D2220
033D57A7 83C4 10 add esp, 10
033D57AA 57 push edi
033D57AB 8B7C24 34 mov edi, dword ptr [esp+34]
033D57AF 85FF test edi, edi
033D57B1 75 1F jnz short 033D57D2
033D57B3 68 F0CF3D03 push 033DCFF0
033D57B8 FF15 C4C03D03 call dword ptr [<&KERNEL32.OutputDebu>; kernel32.OutputDebugStringA
033D57BE 32C0 xor al, al
033D57C0 5F pop edi
033D57C1 8B4C24 18 mov ecx, dword ptr [esp+18]
033D57C5 64:890D 0000000>mov dword ptr fs:[0], ecx
033D57CC 83C4 24 add esp, 24
033D57CF C2 0C00 retn 0C
033D57D2 8BC7 mov eax, edi
033D57D4 8D50 01 lea edx, dword ptr [eax+1]
033D57D7 8A08 mov cl, byte ptr [eax]
033D57D9 40 inc eax
033D57DA 84C9 test cl, cl
033D57DC ^ 75 F9 jnz short 033D57D7
033D57DE 2BC2 sub eax, edx
033D57E0 83F8 20 cmp eax, 20
033D57E3 76 1F jbe short 033D5804
033D57E5 68 D0CF3D03 push 033DCFD0
033D57EA FF15 C4C03D03 call dword ptr [<&KERNEL32.OutputDebu>; kernel32.OutputDebugStringA
033D57F0 32C0 xor al, al
033D57F2 5F pop edi
033D57F3 8B4C24 18 mov ecx, dword ptr [esp+18]
033D57F7 64:890D 0000000>mov dword ptr fs:[0], ecx
033D57FE 83C4 24 add esp, 24
033D5801 C2 0C00 retn 0C
033D5804 8A4424 30 mov al, byte ptr [esp+30]
033D5808 84C0 test al, al
033D580A 55 push ebp
033D580B 56 push esi
033D580C 0F85 94010000 jnz 033D59A6
033D5812 8B4424 34 mov eax, dword ptr [esp+34]
033D5816 85C0 test eax, eax
033D5818 75 21 jnz short 033D583B
033D581A 68 B0CF3D03 push 033DCFB0
033D581F FF15 C4C03D03 call dword ptr [<&KERNEL32.OutputDebu>; kernel32.OutputDebugStringA
033D5825 5E pop esi
033D5826 5D pop ebp
033D5827 32C0 xor al, al
033D5829 5F pop edi
033D582A 8B4C24 18 mov ecx, dword ptr [esp+18]
033D582E 64:890D 0000000>mov dword ptr fs:[0], ecx
033D5835 83C4 24 add esp, 24
033D5838 C2 0C00 retn 0C
033D583B 33C9 xor ecx, ecx
033D583D 894C24 0C mov dword ptr [esp+C], ecx
033D5841 894C24 10 mov dword ptr [esp+10], ecx
033D5845 894C24 14 mov dword ptr [esp+14], ecx
033D5849 894C24 18 mov dword ptr [esp+18], ecx
033D584D 894C24 1C mov dword ptr [esp+1C], ecx
033D5851 894C24 20 mov dword ptr [esp+20], ecx
033D5855 8B0D E8984203 mov ecx, dword ptr [34298E8]
033D585B 33F6 xor esi, esi
033D585D 85C9 test ecx, ecx
033D585F 0F8E 98000000 jle 033D58FD
033D5865 BF 58F13D03 mov edi, 033DF158
033D586A 8D68 11 lea ebp, dword ptr [eax+11]
033D586D 8D49 00 lea ecx, dword ptr [ecx]
033D5870 807D 00 00 cmp byte ptr [ebp], 0
033D5874 74 6A je short 033D58E0
033D5876 57 push edi
033D5877 C64434 10 01 mov byte ptr [esp+esi+10], 1
033D587C E8 2FCCFFFF call 033D24B0
033D5881 83C4 04 add esp, 4
033D5884 84C0 test al, al
033D5886 0F84 9D000000 je 033D5929
033D588C 57 push edi
033D588D E8 0ECEFFFF call 033D26A0
033D5892 83C4 04 add esp, 4
033D5895 84C0 test al, al
033D5897 75 4C jnz short 033D58E5
033D5899 6A 00 push 0
033D589B 6A 00 push 0
033D589D 68 90CF3D03 push 033DCF90
033D58A2 E8 55550000 call <jmp.&MFC71.#1123_AfxMessageBox>
033D58A7 6BF6 16 imul esi, esi, 16
033D58AA 68 D3010000 push 1D3
033D58AF 68 94C53D03 push 033DC594 ; ASCII ".\DevInstallDll.cpp"
033D58B4 81C6 58F13D03 add esi, 033DF158
033D58BA 56 push esi
033D58BB 68 54CF3D03 push 033DCF54
033D58C0 6A 00 push 0
033D58C2 E8 59C9FFFF call 033D2220
033D58C7 83C4 14 add esp, 14
033D58CA 5E pop esi
033D58CB 5D pop ebp
033D58CC 32C0 xor al, al
033D58CE 5F pop edi
033D58CF 8B4C24 18 mov ecx, dword ptr [esp+18]
033D58D3 64:890D 0000000>mov dword ptr fs:[0], ecx
033D58DA 83C4 24 add esp, 24
033D58DD C2 0C00 retn 0C
033D58E0 C64434 0C 00 mov byte ptr [esp+esi+C], 0
033D58E5 A1 E8984203 mov eax, dword ptr [34298E8]
033D58EA 46 inc esi
033D58EB 83C5 12 add ebp, 12
033D58EE 83C7 16 add edi, 16
033D58F1 3BF0 cmp esi, eax
033D58F3 ^ 0F8C 77FFFFFF jl 033D5870
033D58F9 8B7C24 3C mov edi, dword ptr [esp+3C]
033D58FD 8D4424 0C lea eax, dword ptr [esp+C]
033D5901 57 push edi
033D5902 50 push eax
033D5903 E8 58F9FFFF call 033D5260
033D5908 83C4 08 add esp, 8
033D590B 85C0 test eax, eax
033D590D 0F85 A4000000 jnz 033D59B7
033D5913 5E pop esi
033D5914 5D pop ebp
033D5915 32C0 xor al, al
033D5917 5F pop edi
033D5918 8B4C24 18 mov ecx, dword ptr [esp+18]
033D591C 64:890D 0000000>mov dword ptr fs:[0], ecx
033D5923 83C4 24 add esp, 24
033D5926 C2 0C00 retn 0C
033D5929 8D4C24 38 lea ecx, dword ptr [esp+38]
033D592D FF15 FCC03D03 call dword ptr [<&MFC71.#310_ATL::CSt>; MFC71.7C173199
033D5933 6BF6 16 imul esi, esi, 16
033D5936 8DB6 58F13D03 lea esi, dword ptr [esi+33DF158]
033D593C 56 push esi
033D593D 8D5424 3C lea edx, dword ptr [esp+3C]
033D5941 68 3CCF3D03 push 033DCF3C
033D5946 52 push edx
033D5947 C74424 38 00000>mov dword ptr [esp+38], 0
033D594F FF15 DCC03D03 call dword ptr [<&MFC71.#2322_ATL::CS>; MFC71.7C146A9D
033D5955 83C4 0C add esp, 0C
033D5958 6A 00 push 0
033D595A 6A 00 push 0
033D595C 8D4C24 40 lea ecx, dword ptr [esp+40]
033D5960 FF15 D8C03D03 call dword ptr [<&MFC71.#876_ATL::CSi>; MFC71.7C158BCD
033D5966 50 push eax
033D5967 E8 90540000 call <jmp.&MFC71.#1123_AfxMessageBox>
033D596C 68 CC010000 push 1CC
033D5971 68 94C53D03 push 033DC594 ; ASCII ".\DevInstallDll.cpp"
033D5976 56 push esi
033D5977 68 00CF3D03 push 033DCF00
033D597C 6A 00 push 0
033D597E E8 9DC8FFFF call 033D2220
033D5983 83C4 14 add esp, 14
033D5986 8D4C24 38 lea ecx, dword ptr [esp+38]
033D598A FF15 F0C03D03 call dword ptr [<&MFC71.#578_ATL::CSt>; MFC71.7C1771B1
033D5990 5E pop esi
033D5991 5D pop ebp
033D5992 32C0 xor al, al
033D5994 5F pop edi
033D5995 8B4C24 18 mov ecx, dword ptr [esp+18]
033D5999 64:890D 0000000>mov dword ptr fs:[0], ecx
033D59A0 83C4 24 add esp, 24
033D59A3 C2 0C00 retn 0C
033D59A6 57 push edi
[COLOR="Red"]033D59A7 E8 B4E6FFFF call 033D4060[/COLOR]
033D59AC 83C4 04 add esp, 4
033D59AF 84C0 test al, al
033D59B1 ^ 0F84 13FFFFFF je 033D58CA
033D59A7 E8 B4E6FFFF call 033D4060
再F7跟进去。
033D4060 55 push ebp
033D4061 8BEC mov ebp, esp
033D4063 83E4 F8 and esp, FFFFFFF8
033D4066 81EC 58020000 sub esp, 258
033D406C 56 push esi
033D406D 57 push edi
033D406E 33C0 xor eax, eax
033D4070 894424 0C mov dword ptr [esp+C], eax
033D4074 B9 7D000000 mov ecx, 7D
033D4079 8D7C24 68 lea edi, dword ptr [esp+68]
033D407D F3:AB rep stos dword ptr es:[edi]
033D407F B9 0B000000 mov ecx, 0B
033D4084 8D7C24 3C lea edi, dword ptr [esp+3C]
033D4088 F3:AB rep stos dword ptr es:[edi]
033D408A 8B4D 08 mov ecx, dword ptr [ebp+8]
033D408D 894424 10 mov dword ptr [esp+10], eax
033D4091 894424 28 mov dword ptr [esp+28], eax
033D4095 894424 2C mov dword ptr [esp+2C], eax
033D4099 B8 2C000000 mov eax, 2C
033D409E 894424 38 mov dword ptr [esp+38], eax
033D40A2 894424 40 mov dword ptr [esp+40], eax
033D40A6 8BC1 mov eax, ecx
033D40A8 C74424 14 01000>mov dword ptr [esp+14], 1
033D40B0 C74424 1C 20000>mov dword ptr [esp+1C], 20
033D40B8 C74424 24 05330>mov dword ptr [esp+24], 3305
033D40C0 8D70 01 lea esi, dword ptr [eax+1]
033D40C3 8A10 mov dl, byte ptr [eax]
033D40C5 40 inc eax
033D40C6 84D2 test dl, dl
033D40C8 ^ 75 F9 jnz short 033D40C3
033D40CA 2BC6 sub eax, esi
033D40CC 8D5424 48 lea edx, dword ptr [esp+48]
033D40D0 894424 44 mov dword ptr [esp+44], eax
033D40D4 8BC1 mov eax, ecx
033D40D6 2BD1 sub edx, ecx
033D40D8 8A08 mov cl, byte ptr [eax]
033D40DA 880C02 mov byte ptr [edx+eax], cl
033D40DD 40 inc eax
033D40DE 84C9 test cl, cl
033D40E0 ^ 75 F6 jnz short 033D40D8
033D40E2 6A 00 push 0
033D40E4 B9 08000000 mov ecx, 8
033D40E9 8D7424 20 lea esi, dword ptr [esp+20]
033D40ED 8D7C24 6C lea edi, dword ptr [esp+6C]
033D40F1 F3:A5 rep movs dword ptr es:[edi], dword p>
033D40F3 B9 0B000000 mov ecx, 0B
033D40F8 8D7424 40 lea esi, dword ptr [esp+40]
033D40FC 8DBC24 8C000000 lea edi, dword ptr [esp+8C]
033D4103 F3:A5 rep movs dword ptr es:[edi], dword p>
033D4105 8D4C24 1C lea ecx, dword ptr [esp+1C]
033D4109 51 push ecx
033D410A 8B0D BC984203 mov ecx, dword ptr [34298BC]
033D4110 6A 08 push 8
033D4112 8D5424 18 lea edx, dword ptr [esp+18]
033D4116 52 push edx
033D4117 6A 4C push 4C
033D4119 8D4424 7C lea eax, dword ptr [esp+7C]
033D411D 50 push eax
033D411E 68 00402200 push 224000
033D4123 51 push ecx
033D4124 C74424 30 FFFF0>mov dword ptr [esp+30], 0FFFF
033D412C FF15 ACC03D03 call dword ptr [<&KERNEL32.DeviceIoCo>; kernel32.DeviceIoControl
033D4132 85C0 test eax, eax
033D4134 75 1D jnz short 033D4153
033D4136 8B5424 10 mov edx, dword ptr [esp+10]
033D413A 68 AB090000 push 9AB
033D413F 68 94C53D03 push 033DC594 ; ASCII ".\DevInstallDll.cpp"
033D4144 52 push edx
033D4145 68 58C63D03 push 033DC658
033D414A 50 push eax
033D414B E8 D0E0FFFF call 033D2220
033D4150 83C4 14 add esp, 14
033D4153 8B4424 10 mov eax, dword ptr [esp+10]
033D4157 85C0 test eax, eax
033D4159 74 27 je short 033D4182
033D415B 68 B1090000 push 9B1
033D4160 68 94C53D03 push 033DC594 ; ASCII ".\DevInstallDll.cpp"
033D4165 50 push eax
033D4166 68 28C63D03 push 033DC628 ; ASCII "DevInstall.cpp---error code:%d---%s --%d",CR,LF
033D416B 6A 00 push 0
033D416D E8 AEE0FFFF call 033D2220
033D4172 33C0 xor eax, eax
033D4174 83C4 14 add esp, 14
033D4177 85C0 test eax, eax
033D4179 0F95C0 setne al
033D417C 5F pop edi
033D417D 5E pop esi
033D417E 8BE5 mov esp, ebp
033D4180 5D pop ebp
033D4181 C3 retn
033D4182 8B4424 14 mov eax, dword ptr [esp+14]
033D4186 85C0 test eax, eax
033D4188 5F pop edi
033D4189 0F95C0 setne al
033D418C 5E pop esi
033D418D 8BE5 mov esp, ebp
033D418F 5D pop ebp
033D4190 C3 retn
033D412C FF15 ACC03D03 call dword ptr [<&KERNEL32.DeviceIoCo>; kernel32.DeviceIoControl033D4159 /74 27 je short 033D4182
如果内核返回错误码 则报错。
如果不返回错误码则跳转重新启动。
我曾经把je short 033D4182
改成了jmp short 033D4182确实是重新启动了 但是重新启动好了也没有任何的反应。也没有卸载成功
我猜想应该是ring3下把用户输入的验证密码传到了内核程序下,由内核程序再验证一次。
如果密码正确:则在内核态执行卸载还原驱动的例程。
如果密码错误则:在内核态返回错误码给应用层MessageBOx报错。
我也猜想过 是不是用户态还有一次验证密码的时候。
也请牛人帮助分析分析 。我的判断对不对。。。
本人技术有限 如果有误 还请牛人别见笑。迅闪V4.0软件下载地址:
http://115.com/file/bhymdxpy
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)