------------------------------------------------------------------------------
:004141E2 8A8C2490010000 mov cl, byte ptr [esp+00000190] //lettre en cl
:004141E9 84C9 test cl, cl //y a une lettre ?
:004141EB 741F je 0041420C //si non, on saute
* Referenced by a (U)nconditional or (C)onditional Jump at Address: //boucle de génération
|:0041420A(C) //du sérial
|
:004141ED 80385F cmp byte ptr [eax], 5F //lettre = '_'
:004141F0 7503 jne 004141F5 //non on saute
:004141F2 C60020 mov byte ptr [eax], 20 //oui, on met un espace à la place
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:004141F0(C)
|
:004141F5 0FBE08 movsx ecx, byte ptr [eax] //ecx = lettre
:004141F8 334C2410 xor ecx, dword ptr [esp+10] //XOR ecx avec ce qui a en esp+10
:004141FC 81F1CE9A5713 xor ecx, 13579ACE //XOR ecx avec 13579ACE
:00414202 40 inc eax //eax = eax +1
:00414203 894C2410 mov dword ptr [esp+10], ecx //met ecx dans le truc en esp+10
:00414207 803800 cmp byte ptr [eax], 00 //y a plus de lettres
:0041420A 75E1 jne 004141ED //non, on saute
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:004141EB(C)
|
:0041420C 8D9424BC000000 lea edx, dword ptr [esp+000000BC]
------------------------------------------------------------------------------
bon bah voila, c'est tout commenté, je crois qui a pas besoin de plus d'explications.
Ah si, tout de même un truc. L'histoire de [esp+10], cette adresse permet le stockage
d'une valeur. Cependant on ne sait pas ce que contient cette valeur au départ.
On refait donc la manip et on regarde ça dès qu'on peut. On trouve:
------------------------------------------------------------------------------
;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
;
;ANOTHER KEYGEN by TiPiaX
;HAPPYICON keygenerator
;
;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
.386
.model flat, stdcall
option casemap :none ; case sensitive
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\comdlg32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\comdlg32.lib
DlgProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
GenKey PROTO :DWORD
IDD_DIALOG = 100
IDC_QUIT = 600
IDC_ABOUT = 500
IDC_NAME = 1000
IDC_FNAME = 1500
IDC_SERIAL = 2000
.data
titre db "TiPiaX/VDS",0
message db "Greetz to all the cracking and vx scene",13,10
db "and to: Drak, Cynabs, Sboub, Artif, Analyst, Kerberos",13,10
db "Christal, titi, Bendi, Androgyne, Kerberos and TsT",0
petit db "The name is too short",0
error db "Please enter a FirstName",0
happy db "%sHappyIcon%s",0
Fnom db 50 dup (0)
nom db 50 dup (0)
serial db 50 dup (0)
taille dd 0
print db "%lu",0
truc dd 0
.data?
hInstance HINSTANCE ?
.code
start:
invoke DialogBoxParam, hInstance,IDD_DIALOG,NULL,addr DlgProc,NULL
DlgProc proc hwnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg==WM_CLOSE
invoke ExitProcess,0
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF ax==IDC_ABOUT
invoke MessageBox,NULL,offset message,offset titre,NULL
.ELSEIF ax==IDC_QUIT
invoke ExitProcess,0
.ELSEIF ax==IDC_NAME
invoke GenKey,hwnd
.ELSEIF ax==IDC_FNAME
invoke GenKey,hwnd
.ENDIF
.ELSE
mov eax,FALSE
ret
.ENDIF
mov eax,TRUE
ret
DlgProc endp ;fin de dlgproc
GenKey proc hwnd:HWND
invoke GetDlgItemText,hwnd,IDC_NAME,offset nom,50
mov taille,eax
cmp eax,3
jl tooshort
invoke GetDlgItemText,hwnd,IDC_FNAME,offset Fnom,50
mov taille,eax
cmp eax,0
je questufou
;generate the code
;-----------------------
invoke wsprintf,offset serial,offset happy,offset Fnom,offset nom
mov truc,0FFFFFFFFh
lea eax,serial
debut:
cmp byte ptr [eax],05Fh
jnz etape2
mov byte ptr[eax],020h
etape2:
movsx ecx,byte ptr[eax]
xor ecx,truc
xor ecx,013579ACEh
inc eax
mov truc,ecx
cmp byte ptr[eax],00
jnz debut
mov ecx,truc
xor ecx,02468BDF0h
;end of keygen
;---------------
invoke wsprintfA,offset serial,offset print,ecx
invoke SetDlgItemText,hwnd,IDC_SERIAL,offset serial
ret
tooshort:
invoke SetDlgItemText,hwnd,IDC_SERIAL,offset petit
ret
questufou:
invoke SetDlgItemText,hwnd,IDC_SERIAL,offset error
ret
GenKey endp
end start
------------------------------------------------------------------------------
La variable "truc" remplace ici la valeur qu'on avait en esp+10. On fait une jolie
interface graphique avec ça et ça donne