s 0 l 90000000 'This program is'
xxx:004016A3 F3A5 REPZ MOVSD
001B:0054803B 84C0 TEST AL,AL
1 001B:00548029 8BD8 MOV EBX,EAX 2 001B:0054802B 803D0C275F0000 CMP BYTE PTR [005F270C],00 3 001B:00548032 751E JNZ 00548052 (NO JUMP) 4 001B:00548034 8BC3 MOV EAX,EBX 5 001B:00548036 E87575F9FF CALL 004DF5B0 6 001B:0054803B 84C0 TEST AL,AL 7 001B:0054803D 7413 JZ 00548052 (JUMP)
1 001B:005433A0 803D0C275F0000 CMP BYTE PTR [005F270C],00 2 001B:005433A7 741D JZ 005433C6 (JUMP)
MOV BYTE PTR [005F270C],01
001B:006AD10B 83C704 ADD EDI,04
001B:006AD1C6 61 POPAD 001B:006AD1C7 E93867F3FF JMP 005E3904
UPX 0.60 Copyright (C) 1996-1999 Laszlo Molnar & Markus Oberhumer
1 001B:005433A0 803D0C275F0000 CMP BYTE PTR [005F270C],00 2 001B:005433A7 741D JZ 005433C6
1 001B:005433A0 C6050C275F0001 MOV BYTE PTR [005F270C],01 2 001B:005433A7 741D JZ 005433C6
1 00400296 C705A0335400C6050C27 MOV DWORD PTR [005433A0],270C05C6 2 004002A0 C705A43354005F000174 MOV DWORD PTR [005433A4],7401005F 3 004002AA E955361E00 JMP 005E3904
006AD1C7 E9CA30D5FF JMP 00400296
een this is. It's clearly not a messagebox nor a dialog box. That makes it a resource ie a bitmap. You can try to bpx on messageboxA or dialogbox and softice will not break. So let's try a bpx on loadbitmapA. Softice will break inside LoadbitmapA so step out of it (F11) and look at the stack. There's only two PSP references and they are both at the bottom (since they were the last adresses pushed on the "Call stack").
PSP!.text+0029F15 at 0137:0042AF15
PSP!.text+5546 at 0137:406546
Lets look what that code looks like:
:0042AF10 E83BB5FDFF call 00406450
:0042AF15 83C404 add esp, 00000004
Put a breakpoint on 0137:0042AF10. Notice that there is no nag until you execute this call at 42AF10. So that means that we have found the nag caller. Now what. Lets nop the bastard out. Five nop's instead of call 00406450.
Sad but true, you can see the screen for a second and then it exits. Leaving us to our desktop. Hmmn What now? We need to find what went wrong (no kidding) to do that we trace the code until we find something useful. It's now time for you to experience the fat overbloated MFC42.DLL. Nop the call out and continue tracing.
You'll return to 5F4018C6 in MFC42.dll
After tracing that for some time you'll get to Kernel!_FREQASM. Keep on and you'll get to Kernel, user and FINALLY back to PSP at adress 4363XX. In this procedure there is some calls that sets up PSP's screen. At 4364CD there is a call to "updatewindow". You better place a breakpoint on 4364CD or any nearby adress so you don't have to trace on next time. Anyway executing Updatewindow and you'll see PSP's screen.
Here is the path we take:
:004364CD FF1560324C00 Call dword ptr [004C3260]
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
:004364D3 8B4DE8 mov ecx, dword ptr [ebp-18]
:004364D6 E8754AFFFF call 0042AF50
:004364DB 85C0 test eax, eax
:004364DD 7576 jne 00436555 we have eax=0
:004364DF C645FC00 mov [ebp-04], 00
:004364E3 E83B020000 call 00436723
:004364E8 E99AFAFFFF jmp 00435F87 therefore we jump here
We have 0 in eax and therefore we will jump at :004364E8 to 435F87 and we will then end up at :
:00435F87 C745FCFFFFFFFF mov [ebp-04], FFFFFFFF
:00435F8E E8AA070000 call 0043673D
:00435F93 33C0 xor eax, eax
:00435F95 8B4DF4 mov ecx, dword ptr [ebp-0C]
:00435F98 5F pop edi
:00435F99 64890D00000000 mov dword ptr fs:, ecx
:00435FA0 5E pop esi
:00435FA1 5B pop ebx
:00435FA2 8BE5 mov esp, ebp
:00435FA4 5D pop ebp
:00435FA5 C3 ret
The ret will take us to a nasty place in MFC42.dll
:5F407EAB 85C0 test eax, eax
:5F407EAD 7415 je 5F407EC4
:5F407EAF 8B06 mov eax, dword ptr [esi]
:5F407EB1 8BCE mov ecx, esi
:5F407EB3 FF505C call [eax+5C]
:5F407EB6 8BF8 mov edi, eax
:5F407EB8 E81D990000 call 5F4117DA
:5F407EBD 8BC7 mov eax, edi
:5F407EBF 5F pop edi
:5F407EC0 5E pop esi
:5F407EC1 C21000 ret 0010
AND WE'LL CONTINUE
:5F407EC4 8B4E20 mov ecx, dword ptr [esi+20]
:5F407EC7 85C9 test ecx, ecx
:5F407EC9 0F8575440100 jne 5F41C344 Here we jump
:5F41C344 8B01 mov eax, dword ptr [ecx]
:5F41C346 FF5060 call [eax+60]
:5F41C349 E981BBFEFF jmp 5F407ECF
:5F407ECF 8B06 mov eax, dword ptr [esi]
:5F407ED1 8BCE mov ecx, esi
:5F407ED3 FF5070 call [eax+70] killer!!!!
:5F407ED6 EBDE jmp 5F407EB6
The call to [eax+70] kills the window, how rude of them to exit before we even had the chance to draw a single pixel.
You, dear reader have of course already spotted the jump that needs to be changed and you may be wondering why I included all this MFC code. However there's a reason why I'm showing you all this code of MFC42.dll and that's because there is a good chance that you'll miss the *important* code among the overbloated MFC dlls. And if you do so you'll end up patching the MFC42 code instead of your targets call.
Where where where is the important code, well if you change al from 0 to 1 at :004364DB 85C0 test eax, eax The whole bazar will start. But as I said before should you miss this spot you'll end up changing:
:5F407EAB 85C0 test eax, eax
:5F407EAD 7415 je 5F407EC4
Inside MFC42.dll wich IS NOT a good idea, since other programs may use this particular function.
This will be the last essay on selfexpainary cracks. I want to move on to more complex cracks. What I mean by that is that only protections that donot use the common API calls will be written down and that goes for any contributor too. I'm well aware of the prideness one feel when one has succeed in cracking by oneself for the first time, but there's too many essay's on the web explaining the same sort of protections. What I wont to cover is:
They don't have to be tough or hard to crack, the important thing is that they offer some new schemes like this PSP essay who deals with a nagscreen that is a bitmaps.
(Saddle all the horses far on the indian trail, 'til it's time to change key and jump into a different scale)