Advertisement
xdxdxd123

Untitled

May 26th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.53 KB | None | 0 0
  1. how to make key generators?
  2. -===========================-
  3. Introduction
  4. ------------
  5. I take no responsibility of the usage of this information.
  6. This tutorial, is for educational knowledge ONLY.
  7. Hi there, in this tutorial, I intend to teach you how to make a pretty
  8. simple keygen, of a program called W3Filer 32 V1.1.3.
  9. W3Filer is a pretty good web downloader...
  10. I guess some of you might know the program.
  11. I`ll assume you know:
  12. A.How to use debugger (in this case, SoftIce).
  13. B.How to crack, generally (finding protection routines,patching them,etc...).
  14. C.How to use Disassembler (This knowledge can help).
  15. D.Assembly.
  16. E.How to code in Turbo Pascal (tm).
  17. Tools you`ll need:
  18. A.SoftIce 3.00/01 or newer.
  19. B.WD32Asm. (Not a must).
  20. C.The program W3Filer V1.13 (if not provided in this package), can be found in
  21. www.windows95.com I believe.
  22. D.Turbo Pascal (ANY version).
  23. Well, enough blah blah, let's go cracking...
  24. Run W3Filer 32.
  25. A nag screen pops, and , demands registration (Hmm, this sux ;-)) Now,
  26. We notice this program has some kind of serial number (Mine is 873977046),
  27. Let's keep the serial in mind, I bet we`ll meet it again while we're on
  28. the debugger.
  29. Well, now, let's put your name and a dummy reg code...
  30. set a BP on GetDlgItemTextA, and, press OK.
  31. We pop inside GetDlgItemTextA, Lets find the registration routine...
  32. I`ll save you the work, the registration routine is this:
  33. :00404DB2 8D95A8FAFFFF lea edx, dword ptr [ebp+FFFFFAA8]
  34. :00404DB8 52 push edx ---> Your user name here.
  35. :00404DB9 E80B550000 call 0040A2C9 ---> Registration routine.
  36. :00404DBE 83C408 add esp, 00000008 ---> Dunno exactly what is it.
  37. :00404DC1 85C0 test eax, eax ---> Boolean identifier, 0 if
  38. :00404DC3 7D17 jge 00404DDC ---> registration failed, 1 if
  39. OK.
  40. Well, Let's enter the CALL 40A2C9, and see what's inside it:
  41. (Please read my comments in the code).
  42. * Referenced by a CALL at Addresses:
  43. |:00404DB9 , :00407F76
  44. |
  45. :0040A2C9 55 push ebp
  46. :0040A2CA 8BEC mov ebp, esp
  47. :0040A2CC 81C4B0FEFFFF add esp, FFFFFEB0
  48. :0040A2D2 53 push ebx
  49. :0040A2D3 56 push esi
  50. :0040A2D4 57 push edi
  51. :0040A2D5 8B5508 mov edx, dword ptr [ebp+08]
  52. :0040A2D8 8DB500FFFFFF lea esi, dword ptr [ebp+FFFFFF00]
  53. :0040A2DE 33C0 xor eax, eax
  54. :0040A2E0 EB16 jmp 0040A2F8
  55. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  56. |:0040A2FB(C)
  57. |
  58. :0040A2E2 0FBE0A movsx ecx, byte ptr [edx] ----> Here Starts the
  59. interesting part.
  60. :0040A2E5 83F920 cmp ecx, 00000020 ----> ECX is the the current
  61. char in the user name, Hmm, 20h=' '...
  62. :0040A2E8 740D je 0040A2F7 ----> Let's see,
  63. :0040A2EA 8A0A mov cl, byte ptr [edx] ----> Generally, all this loop
  64. does, is copying
  65. the user name from
  66. [EDX], to [ESI], WITHOUT the spaces!
  67. (Keep this in mind! ).
  68. :0040A2EC 880C06 mov byte ptr [esi+eax], cl
  69. :0040A2EF 42 inc edx
  70. :0040A2F0 40 inc eax
  71. :0040A2F1 C6040600 mov byte ptr [esi+eax], 00
  72. :0040A2F5 EB01 jmp 0040A2F8
  73. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  74. |:0040A2E8(C)
  75. |
  76. :0040A2F7 42 inc edx
  77. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  78. |:0040A2E0(U), :0040A2F5(U)
  79. |
  80. :0040A2F8 803A00 cmp byte ptr [edx], 00
  81. :0040A2FB 75E5 jne 0040A2E2 ----------------> This is the loop , we got
  82. what it does,
  83. Let's continue tracing
  84. the code...
  85. :0040A2FD 56 push esi --------> The user name is pushed, in order
  86. to
  87. Upcase it's chars.
  88. * Reference To: USER32.CharUpperA, Ord:0000h
  89. |
  90. :0040A2FE E80F330000 Call User!CharUpper ---> After this, our name is in
  91. upper case.
  92. :0040A303 56 push esi -----> Our name in upper case here.
  93. * Reference To: cw3220mt._strlen, Ord:0000h
  94. |
  95. :0040A304 E86F300000 Call 0040D378 ---> This is the length of our name.
  96. :0040A309 59 pop ecx
  97. :0040A30A 8BC8 mov ecx, eax ---> ECX=Length.
  98. :0040A30C 83F904 cmp ecx, 00000004 ---> Length>=4 (MUST).
  99. :0040A30F 7D05 jge 0040A316 ---> Let's go to this address...
  100. :0040A311 83C8FF or eax, FFFFFFFF
  101. :0040A314 EB67 jmp 0040A37D
  102. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  103. |:0040A30F(C)
  104. |
  105. :0040A316 33D2 xor edx, edx
  106. :0040A318 33C0 xor eax, eax
  107. :0040A31A 3BC8 cmp ecx, eax
  108. :0040A31C 7E17 jle 0040A335 ---> (Not important, just another useless
  109. checking).
  110. ===================================================================================
  111. ============ FROM HERE AND ON, THE IMPORTANT CODE, PAY ATTENTION ==================
  112. ===================================================================================
  113. One thing before we continue, EDX = 00000000h as we enter to the next instructions.
  114. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  115. |:0040A333(C)
  116. |
  117. :0040A31E 0FBE1C06 movsx ebx, byte ptr [esi+eax] ---> EBX <--- char in user
  118. name, offset EAX.
  119. :0040A322 C1E303 shl ebx, 03 -----> Hmm, it shl's the char by 03h...
  120. (Remember that).
  121. :0040A325 0FBE3C06 movsx edi, byte ptr [esi+eax] ---> Now EDI <--- Char in
  122. user name , offset EAX.
  123. :0040A329 0FAFF8 imul edi, eax -----> It multiplies the char by the
  124. offset in user name! (Remember that).
  125. :0040A32C 03DF add ebx, edi -----> Adds the result to EBX (That was
  126. Shelled (Ding Dong =)).
  127. :0040A32E 03D3 add edx, ebx -----> EDX=EDX+EBX!!! - This is the CORE
  128. of this registration routine!!!
  129. :0040A330 40 inc eax -----> Increase EAX by one (next char).
  130. :0040A331 3BC8 cmp ecx, eax
  131. :0040A333 7FE9 jg 0040A31E ----> If ECX<EAX then, we leave the
  132. loop.
  133. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  134. |:0040A31C(C)
  135. |
  136. :0040A335 A120674100 mov eax, dword ptr [00416720] ---> HMMMMMM, What's in
  137. here?????
  138. :0040A33A C1F803 sar eax, 03 ---------> WAIT! Please type in SIce '?
  139. EAX'
  140. Does this number in EAX look
  141. familiar to us? ;-)
  142. If you still don`t understand,
  143. than, It's
  144. our SERIAL NUMBER! (PLEASE, take
  145. your time, and check by
  146. yourself - don`t trust me!). OK,
  147. so now we know,
  148. That it SHR's EAX by 03 (SAR is
  149. almost identical to SHR).
  150. :0040A33D 03D0 add edx, eax ---------> Hmm, it adds the result from the
  151. loop, the serial number shr'd by 03h
  152. :0040A33F 52 push edx -------> Let's continue. (At this point, I
  153. can tell you , the reg number, is
  154. in EDX - only that the reg number
  155. is in HEX --> That's how you enter it).
  156. * Possible StringData Ref from Data Obj ->"%lx"
  157. |
  158. :0040A340 685EF54000 push 0040F55E
  159. :0040A345 8D95B0FEFFFF lea edx, dword ptr [ebp+FFFFFEB0]
  160. :0040A34B 52 push edx
  161. * Reference To: USER32.wsprintfA, Ord:0000h
  162. |
  163. :0040A34C E8E5320000 Call 0040D636 -------> This one, does HEX2STR (Takes
  164. the value from EDX, and turns it to an hex string).
  165. :0040A351 83C40C add esp, 0000000C
  166. :0040A354 8D8DB0FEFFFF lea ecx, dword ptr [ebp+FFFFFEB0] -----> type 'd ecx' -
  167. THIS is the reg number! That's enough for us, the rest of
  168. the code, is
  169. just for comparing the correct reg code with ours.
  170. :0040A35A 51 push ecx
  171. * Reference To: USER32.CharLowerA, Ord:0000h
  172. |
  173. :0040A35B E8B8320000 Call 0040D618
  174. :0040A360 8D85B0FEFFFF lea eax, dword ptr [ebp+FFFFFEB0]
  175. :0040A366 50 push eax
  176. :0040A367 FF750C push [ebp+0C]
  177. * Reference To: cw3220mt._strcmp, Ord:0000h
  178. |
  179. :0040A36A E875300000 Call 0040D3E4
  180. :0040A36F 83C408 add esp, 00000008
  181. :0040A372 85C0 test eax, eax
  182. :0040A374 7405 je 0040A37B
  183. :0040A376 83C8FF or eax, FFFFFFFF
  184. :0040A379 EB02 jmp 0040A37D
  185. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  186. |:0040A374(C)
  187. |
  188. :0040A37B 33C0 xor eax, eax
  189. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  190. |:0040A314(U), :0040A379(U)
  191. |
  192. :0040A37D 5F pop edi
  193. :0040A37E 5E pop esi
  194. :0040A37F 5B pop ebx
  195. :0040A380 8BE5 mov esp, ebp
  196. :0040A382 5D pop ebp
  197. :0040A383 C3 ret
  198. Making the actual Keygen
  199. ~~~~~~~~~~~~~~~~~~~~~~~~
  200. Now, after I've explained how does the program calculate the registration
  201. code, you can either write your own keymaker, without looking at my code, or
  202. look at my code (in Turbo Pascal - sorry for all you C lovers ;-) Next time).
  203. That's it, here's the source of my keygen:
  204. ------------------- Cut here ---------------------------------------------
  205. Program W3FilerKeygen;
  206. var
  207. Key,SerialNum,EB,ED,digit:Longint;
  208. I,x:Byte;
  209. Name,KeyHex:String;
  210. begin
  211. Writeln(' W3Filer32 V1.1.3 Keymaker');
  212. writeln('Cracked by ^pain^ ''97 / Rebels!');
  213. Write('Your Name:'); { Read the name }
  214. readln(Name);
  215. Write('Serial Number:');
  216. readln(SerialNum); {Yes, we need the serial number for the calculation!}
  217. Key:=0;
  218. x:=0;
  219. For I:=1 to length(Name) do
  220. begin
  221. Name[I]:=upcase(Name[i]);
  222. If Name[I]<>' ' then begin
  223. eb:=ord(Name[I]) shl 3; {EB = Name[I] Shl 03h}
  224. Ed:=ord(Name[I]); {ED = Name[I]}
  225. ed:=ed*(x); {ED=ED*Offset}
  226. inc(x);
  227. eb:=eb+ed; {Add ED to EB}
  228. Key:=Key+EB; {Add EB to KEY}
  229. end;
  230. end;
  231. Key:=Key+(SerialNum shr 3); { Add SerialNum shr 03h to Key}
  232. { From here, this is just HEX2STRING --> I`m quite sure it's
  233. Self explaintory, else - go and learn number bases again! ;-)}
  234. KeyHex:='';
  235. repeat
  236. digit:=Key mod 16;
  237. key:=key div 16;
  238. If digit<10 then KeyHex:=Chr(Digit+ord('0'))+KeyHex;
  239. If digit>10 then KeyHex:=Chr(Digit-10+ord('a'))+KeyHex;
  240. until key=0;
  241. writeln('Your Key:',KeyHex);
  242. writeln(' Enjoy!');
  243. end.
  244. --------------------- Cut here -------------------------------------------
  245. This tutorial was written by ^pain^ / [mEXELiTE '97], Hope you enjoyed
  246. reading it, I`m always trying to improve my writing skills =).
  247. Hmm, I'd like to greet the following: (No special order)
  248. Blast Soft,Teraphy,J0b,Qapla,+ORC,Fravia,Charley,GhostRdr,Odin,kOUGER
  249. Niabi,Acpizer,Klagosong,Mystic Rioter,rANDOM,riDDLER (Come back man!
  250. we NEED ya),yoshi,JosephCo,Leddy,Krazy_N,Vizion,Gunnar_,Volcanic,
  251. Fant0m,Caruso,|PSA|,razzi,ThePharao,|KAIRN| + Everyone in #cracking & in
  252. #cracking4newbies, And ofcourse - everyone else I forgot. ;)
  253. ------------ Signing off - ^pain^ --------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement