home *** CD-ROM | disk | FTP | other *** search
- This Tutorial is written by SCooB
-
- Target: - Crackme "PassMe" from Code_Inside downloaded from
- http://crackmes.cjb.net/
-
- Protection: - Serial
-
- Used: - SoftIce v 4.0.5
- - Brain
- - Good cup of coffee (hot and strong)
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
- * The pre-examination of the crackme
-
- Open the crackme and enter a serial. Press "check" and.....Password not
- accepted (hehe, why not:-)
- You noticed that you only have to enter a serialcode and no name, so it
- could be very simple or....:-)
-
- --------------------------------------------------------------------------------------------
-
- * Let's make the crack
-
- Run your crackme and enter a serial (I entered 12234556). Now open
- SoftIce and put a breakpoint on getdlgitemtexta. Close the debugger by
- typing "X" and press "Check".
- Boom, there's SoftIce popping up. Press "F11" one time to get out of
- the Call and you'll get here:
-
- 017F:00401056 FF15701D4000 CALL [USER32!GetDlgItemTextA]
- 017F:0040105C 3C08 CMP AL,08 <------- check if
- you entered 8 characters
- 017F:0040105E 7590 JNZ 00400FF0
- 017F:00401060 BFC2114000 MOV EDI,004011C2 <-- move text
- into EDI
- 017F:00401065 33C9 XOR ECX,ECX
- 017F:00401067 33D2 XOR EDX,EDX
- 017F:00401069 33F6 XOR ESI,ESI
- 017F:0040106B 8A0F MOV CL,[EDI] <------ move
- first char. in CL
- 017F:0040106D 8A5701 MOV DL,[EDI+01] <--- move
- second char. in DL
- 017F:00401070 80FA00 CMP DL,00 <--------- check if
- end of text reached
- 017F:00401073 7409 JZ 0040107E <------ if yes,
- jump
- 017F:00401075 01D1 ADD ECX,EDX
- 017F:00401077 01CE ADD ESI,ECX
- 017F:00401079 83C702 ADD EDI,02
- 017F:0040107C EBED JMP 0040106B
- 017F:0040107E 01CE ADD ESI,ECX
-
- Now, trace to the code (by typing "F10") to get an idea of what's going
- on. After a while you'll notice that you're inside a "code-circle". Now
- it's time to know what's happening. As you can see at address 00401060
- there's some text moving in register EDI and after that the characters
- are processed one by one. If the end of the text has reached, jump to
- 0040107E.
- So, place a breakpoint at address 0040107E and let SoftIce do it's job.
- Now you're at the code section listed below.
-
- 017F:0040107E 01CE ADD ESI,ECX <----- you landed
- here
- 017F:00401080 0FAFF0 IMUL ESI,EAX
- 017F:00401083 F7FE IDIV ESI
- 017F:00401085 01F6 ADD ESI,ESI
- 017F:00401087 01D6 ADD ESI,EDX
- 017F:00401089 8BD6 MOV EDX,ESI
- 017F:0040108B C1C210 ROL EDX,10
- 017F:0040108E 01D6 ADD ESI,EDX
- 017F:00401090 33D2 XOR EDX,EDX
- 017F:00401092 BF00134000 MOV EDI,00401300
- 017F:00401097 33C0 XOR EAX,EAX
- 017F:00401099 8B07 MOV EAX,[EDI]
- 017F:0040109B 8B4F04 MOV ECX,[EDI+04]
- 017F:0040109E 01C8 ADD EAX,ECX
- 017F:004010A0 3BC6 CMP EAX,ESI
- 017F:004010A2 7402 JZ 004010A6
- 017F:004010A4 EB2E JMP 004010D4
-
- When you trace through the code by pressing "F10" you will reach the
- address with the one and only jump in the section. It must be the
- "decide-jump". To check it, change the "zero-flag" and let the crackme
- run.............Good job cracker, you did it
-
- Ok, now we know we have the right jump and so we know that the serial
- processing has to be between 0040105C and 004010A2. We also know that
- when EAX is equal to ESI we have entered the right serial.
- Now we're going to have a look at what's inside the two registers:
- Type "? EAX" and you will see "igge" (if you entered the same serial as
- I did:-)
- Type "? ESI" and you will see "E[E[" (the correct serial after it is
- processed)
-
- When these are the same, you're the man :-)
-
- To find out what we have to enter to get E[E[ in the EAX-register,
- we're going to reverse the code.
-
- 017F:00401092 BF00134000 MOV EDI,00401300 <--- move
- 12234556 in EDI
- 017F:00401097 33C0 XOR EAX,EAX
- 017F:00401099 8B07 MOV EAX,[EDI] <------ move
- 3221 in EAX
- 017F:0040109B 8B4F04 MOV ECX,[EDI+04] <--- move
- 6554 in ECX
- 017F:0040109E 01C8 ADD EAX,ECX <-------- ADD ECX
- to EAX
- 017F:004010A0 3BC6 CMP EAX,ESI <-------- CMP igge
- to E[E[
- 017F:004010A2 7402 JZ 004010A6
- 017F:004010A4 EB2E JMP 004010D4
-
- As we can see, our code is chopped in half, is reversed and after that
- it is combined to each other. To prove this we have to convert the
- ascii-character to the ascii-value.
-
- 3221 is the same as 51 50 50 49
- 6554 is the same as 54 53 53 52
- ------------------------------------+
- 105 103 103 105 is the same as iggi
-
-
- After this it's a piece off cake to find one of the correct serials
-
- We're going to do the same trick backwards with E[E[
-
- E[E[ is the same as 69 91 69 91
- 35 45 35 45 is the same as # - # - (you can take
- every combination you want
- 34 46 34 46 is the same as " . " . as long as the
- sum is correct)
-
- Now, let's find out if it works.
-
- Open the crackme and type -#-#."." (remember that you had to reverse
- it:-)
-
- Good job, Cracker (thank you:-))
-
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- SCooB, scoob@secureroot.com
-