home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / E_bliss / klefz.txt < prev    next >
Text File  |  2000-05-25  |  5KB  |  101 lines

  1. Crackme 1.0 by Pusillus
  2. -----------------------
  3. This crackme was a nice piece, XOR encryption.. that's fun :)
  4. well first of all BPX GetDlgItemTextA and then start the crackme
  5. and enter a junk serial, press the 'Check' button, and you should
  6. be in softice at the GetDlgItemTextA call, press F12 to get out of
  7. that call and you should land here:
  8.  
  9. :004010AB  CALL    USER32!GetDlgItemTextA
  10. :004010B0  CALL    004010C9
  11. :004010B5  JMP     004010C0
  12. :004010B7  MOV     EAX,00000000
  13. :004010BC  LEAVE
  14. :004010BD  RET     0010
  15.  
  16. Press F8 to trace into the CALL 004010C9 (where the routine is)
  17. and we lands here:
  18.  
  19. :004010C9  PUSH    ESI
  20. :004010CA  PUSH    EDI
  21. :004010CB  PUSH    ECX
  22. :004010CC  XOR     ESI,ESI
  23. :004010CE  XOR     EDI,EDI
  24. :004010D0  MOV     ECX,00000008      ; counter = 8
  25. :004010D5  MOV     ESI,00403044      ; esi = our junk serial
  26. :004010DA  XOR     BYTE PTR [ESI],32 ; takes each char of the junk serial and XOR's the value with 32h
  27. :004010DD  INC     ESI               ; esi + 1
  28. :004010DE  LOOP    004011DA          ; loop until counter = 0
  29. :004010E0  MOV     ESI,00403044      ; esi = our junk serial XOR'ed
  30. :004010E5  MOV     ECX,00000004      ; counter = 4
  31. :004010EA  MOV     AL,[ESI]          ; al = value of first char in our junk serial
  32. :004010EC  MOV     BL,[ESI+01]       ; bl = value of second char
  33. :004010EF  XOR     AL,BL             ; AL = AL XOR BL
  34. :004010F1  MOV     [EDI+0040304C],AL ; string = char(al)
  35. :004010F7  ADD     ESI,02            ; esi + 2
  36. :004010FA  INC     EDI
  37. :004010FB  LOOP    004011EA          ; loop until counter = 0
  38. :004010FD  MOV     ESI,0040304C      ; ESI = string
  39. :00401102  MOV     AL,[ESI]          ; al = value of first char in string
  40. :00401104  MOV     BL,[ESI+01]       ; bl = value of second char
  41. :00401107  XOR     AL,BL             ; al = al xor bl
  42. :00401109  MOV     BL,[ESI+02]       ; bl = value of third char
  43. :0040110C  MOV     CL,[ESI+03]       ; cl = value of fourth char
  44. :0040110F  XOR     BL,CL             ; bl = bl xor cl
  45. :00401111  XOR     AL,BL             ; al = al xor bl
  46. :00401113  MOV     ECX,00000008      ; counter = 8
  47. :00401118  MOV     ESI,00403044      ; esi = our junk serial
  48. :0040111D  XOR     [ESI],AL          ; char = char xor al
  49. :0040111F  INC     ESI
  50. :00401120  LOOP    0040121D          ; loop until counter = 0
  51. :00401122  MOV     ECX,00000008      ; counter = 8
  52. :00401127  MOV     ESI,00403044      ; our fully xor'ed junk serial
  53. :0040112C  MOV     EDI,00403008      ; and this is how it should look like do a 'd 404008' and you'll see that it should be 71h, 18h, 59h, 1Bh, 79h, 42h, 45h, 4Ch
  54. :00401131  MOV     AL,[ESI]          ; al = value of junk serial char
  55. :00401133  CMP     AL,[EDI]          ; compare it with the right
  56. :00401135  JNZ     00401154          ; jump if not zero
  57. :00401137  INC     ESI               ; else loop
  58. :00401138  INC     EDI
  59. :00401139  LOOP    00401231          ; loop until counter = 0
  60. :0040113B  PUSH    40
  61. :0040113D  PUSH    00403035
  62. :00401142  PUSH    00403010
  63. :00401147  PUSH    DWORD PTR [00403054]
  64. :0040114D  CALL    USER32!MessageBoxA ; good cracker box!
  65. :00401152  JMP     0040116B
  66. :00401154  PUSH    30               ; bad cracker comes here
  67. :00401156  PUSH    00403035
  68. :0040115B  PUSH    00403022
  69. :00401160  PUSH    DWORD PTR [00403054]
  70. :00401166  CALL    USER32!MessageBoxA ; show the bad cracker box
  71. :0040116B  POP     EDI
  72. :0040116C  POP     ESI
  73. :0040116D  POP     ECX
  74. :0040116E  RET
  75.  
  76. so lets calculate :), but hey! we code an program to do it for us (it's easier ;)
  77. here is a sample PASCAL program to calculate the right serial..
  78.  
  79. var string1,string2:string;
  80.     x0r,i,cnt:byte;
  81.  
  82. begin
  83.    string1:=chr($71)+chr($18)+chr($59)+chr($1B)+chr($79)+chr($42)+chr($45)+chr($4C); { string1=the right serial xor'ed (from the 'd 404008' }
  84.    string2:='1234';
  85.    x0r:=0;
  86.    cnt:=1;
  87.    for i:=1 to 8 do string1[i]:=chr(ord(string1[i]) xor $32); { XOR each char with 32h }
  88.    for i:=1 to 4 do begin
  89.       string2[i]:=chr(ord(string1[cnt]) xor ord(string1[cnt+1])); { string2[i] = value of string1[cnt] xor value of string1[cnt+1] }
  90.       cnt:=cnt+2;
  91.    end;
  92.    string2[1]:=chr(ord(string2[1]) xor ord(string2[2])); { string2[1] = value of string2[1] xor value of string2[2] }
  93.    string2[2]:=chr(ord(string2[3]) xor ord(string2[4])); { string2[2] = value of string2[3] xor value of string2[4] }
  94.    x0r:=ord(string2[1]) xor ord(string2[2]); { x0r = value of string2[1] xor value of string2[2] }
  95.    for i:=1 to 8 do string1[i]:=chr(ord(string1[i]) xor x0r); { XOR each char of STRING1 with the value of x0r }
  96.    writeln(string1); { print the serial out on the screen }
  97. end.
  98.  
  99. and it will show Z3r0Ring which is the right serial :)
  100. ---
  101. /Klefz