home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / nh-fcm05.ZIP / nh-fcm05.asm next >
Encoding:
Assembly Source File  |  2001-04-22  |  3.4 KB  |  229 lines

  1. IDC_EXIT equ 3
  2. IDC_CHECK equ 4
  3. IDC_EDIT1 equ 104
  4.  
  5. includelib import32.lib
  6. include windows.inc
  7. extrn GetModuleHandleA:proc
  8. extrn DialogBoxParamA:Proc
  9. extrn ExitProcess:Proc
  10. extrn MessageBoxA:proc
  11. extrn EndDialog:Proc
  12. extrn UpdateWindow:proc
  13. extrn MessageBoxA:proc
  14. extrn GetDlgItemTextA:proc
  15. extrn RegCreateKeyA:proc
  16. extrn RegSetValueExA:proc
  17. extrn RegCloseKey:proc
  18. .386
  19. .model flat
  20. .data
  21. dialog_name    db "Dlg1",0
  22. nm        db 22h dup (0)
  23. nmm        db 10h dup (0)
  24. nmmm        db '-[TS]',0
  25. key        dd ?
  26. s        db "Software\TrickSoft\fusS\Crackme05",0
  27. sss        db "UserName",0
  28. ssss        db "MagicValue",0
  29. capt        db "Error",0
  30. text        db "Can't create or write key...",0
  31. capt1        db "Congratulations...",0
  32. text1        db "fusS' 5th crackme is registered now...That's all",0
  33. .code
  34. _start:
  35.  xor ebx,ebx
  36.  push ebx
  37.  call GetModuleHandleA
  38.  push ebx
  39.  push offset dialog_proc
  40.  push ebx
  41.  push offset dialog_name
  42.  push eax
  43.  call DialogBoxParamA
  44.  push ebx
  45.  call ExitProcess
  46.  
  47. dialog_proc proc near
  48.  push ebp
  49.  mov ebp,esp
  50. dp_hWnd equ dword ptr [ebp+8h]
  51. dp_uMsg equ dword ptr [ebp+0ch]
  52. dp_wParam equ dword ptr [ebp+10h]
  53. dp_lParam equ dword ptr [ebp+14h]
  54. mov ecx,dp_hWnd
  55. mov eax,dp_uMsg
  56. cmp eax,WM_INITDIALOG
  57. jne not_initdialog
  58. mov ecx,dp_hWnd
  59. push dp_hWnd
  60. call UpdateWindow
  61. not_initdialog:
  62.  cmp eax,WM_CLOSE
  63.  jne not_close
  64.  push 0
  65.  push ecx
  66.  call EndDialog
  67. not_close:
  68.  cmp eax,WM_COMMAND
  69.  jne not_command
  70.  mov eax,dp_wParam
  71.  cmp eax,IDC_EXIT
  72.  jne not_exit
  73.  push 0
  74.  push ecx
  75.  call EndDialog
  76. not_exit:
  77.  cmp eax,IDC_CHECK
  78.  jne not_check
  79.  mov esi,offset nm
  80.  push 20h
  81.  push esi
  82.  push esi
  83.  push IDC_EDIT1
  84.  push dp_hWnd
  85.  call GetDlgItemTextA
  86.  push offset key
  87.  push offset s
  88.  push 80000002h
  89.  call RegCreateKeyA
  90.  test eax,eax
  91.  je not_err
  92. erro:
  93.  push 0h
  94.  push offset capt
  95.  push offset text
  96.  push dp_hWnd
  97.  call MessageBoxA
  98.  jmp not_check
  99. not_err:
  100.  mov esi,offset nm
  101.  xor ecx,ecx
  102.  xor edi,edi
  103. l1:
  104.  xor ebx,ebx
  105.  lodsb
  106.  or al,al
  107.  je l2
  108.  mov bl,al
  109.  mov bh,[esi]
  110.  mov eax,ebx
  111.  imul ebx
  112.  add edi,eax
  113.  
  114.  
  115.  inc ecx
  116.  jmp l1
  117. l2:
  118.  push ecx
  119. mov ecx,5
  120. add edi,0bab1e5h+63h*2
  121. imul edi,0deadbeefh
  122. sub edi,0deadbeefh
  123. mov ebx,10
  124. mov eax,edi
  125. mov edi,offset nmmm
  126. l3:
  127.  xor edx,edx
  128.  div ebx
  129.  dec edi
  130.  add dl,'0'
  131.  mov [edi],dl
  132.  inc ecx
  133. or eax,eax
  134. jne l3
  135.  push offset nm
  136.  push 1h
  137.  push 0h
  138.  push offset sss
  139.  push key
  140.  call RegSetValueExA
  141.  test eax,eax
  142.  jne erro
  143.  push ecx
  144.  push offset edi
  145.  push 1h
  146.  push 0h
  147.  push offset ssss
  148.  push key
  149.  call RegSetValueExA
  150.  test eax,eax
  151.  jne erro
  152.  push key
  153.  call RegCloseKey
  154.  push 0h
  155.  push offset capt1
  156.  push offset text1
  157.  push dp_hWnd
  158.  call MessageBoxA
  159. not_check:
  160.  xor eax,eax
  161.  inc eax
  162.  leave
  163.  ret 16
  164. not_command:
  165.  xor eax,eax
  166.  leave
  167.  ret 16
  168. dialog_proc endp
  169.  
  170.  
  171. end _start
  172.  
  173. .386
  174. .model tiny
  175. cseg    segment para public 'code' use16
  176. assume    cs:cseg,ds:cseg
  177. org 100h
  178. start:
  179. mov ah,09h
  180. mov dx,offset copyright
  181. int 21h
  182. inc ah
  183. mov dx,offset nm
  184. int 21h
  185. mov cl,byte ptr nm+1
  186. cmp cl,5h
  187. ja ok
  188. mov ah,09h
  189. mov dx,offset error
  190. int 21h
  191. ret
  192. ok:
  193. mov ah,09h
  194. mov dx,offset messy2
  195. int 21h
  196. movzx ecx,cl
  197. mov si,offset nm+2
  198. lea edi,[esi+ecx]
  199. mov byte ptr [di],0
  200. xor ebp,ebp
  201. l1:
  202.  xor ebx,ebx
  203.  lodsb
  204.  mov bl,al
  205.  mov bh,[si]
  206.  mov eax,ebx
  207.  imul ebx
  208.  add ebp,eax
  209. loop l1
  210. mov dx,di
  211. mov ah,09h
  212. int 21h
  213. ret
  214.  
  215. copyright    db 13,10,'KeyText 2000 v2.16 keygen by nh',13,10
  216.         db ' ■ Name : $'
  217. messy2        db 13,10,' ■ Key  : $-[TS]$'
  218. error        db 13,10,'Too little name...$'
  219. nm        dw 20h
  220.  
  221. ends
  222. end start
  223. end
  224.  
  225.  
  226.  
  227.  
  228.  
  229.