-
Notifications
You must be signed in to change notification settings - Fork 2
/
keygen.asm
152 lines (89 loc) · 4.02 KB
/
keygen.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
; template v.1.7 (keygen)
;.......................................................................
.486
.model flat, stdcall
option casemap :none
;.......................................................................
include project.inc
;.......................................................................
.code
include release.asm
;.......................................................................
MAINDLGPROC PROC hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
switch uMsg
case WM_INITDIALOG
mov eax,hWnd
mov hWndGlobal, eax ; for the thread
invoke CreateEvent, 0, 0, 0, 0 ; creating the event
mov hEventStart,eax
invoke CreateThread, 0, 0, KEYGENPROC, 0, 0, addr hThreadID
invoke CloseHandle,eax ; creating the thread
invoke INITIALIZE, hWnd ; generating request code and printing it
case WM_COMMAND
mov eax,wParam
switch eax
case IDB_CLOSE ; close button
invoke EndDialog, hWnd, 0
IF INFODLG
case IDB_INF ; button info
invoke DialogBoxParam, hInst, IDD_INF, hWnd, INFODLGPROC, 0
ENDIF
IF AUTOUPDATE
case IDE_NAME || IDE_SERIAL
shr eax,16
.if ax == EN_CHANGE
; starting keygen thread
invoke SetEvent, hEventStart
.endif
ELSE
case IDB_GEN ; gen button
; starting keygen thread
invoke SetEvent, hEventStart
ENDIF
endsw
case WM_DEFEATED
invoke SendDlgItemMessage, hWnd, IDE_SERIAL, EM_SETREADONLY, 1, 0
invoke SendDlgItemMessage, hWnd, IDE_NAME, EM_SETREADONLY, 1, 0
invoke MessageBox, hWnd, addr szSUCCESSTEXT, addr szSUCCESSTITLE, MB_ICONINFORMATION + MB_OK + MB_TOPMOST
case WM_CLOSE || uMsg == WM_RBUTTONUP || uMsg == WM_LBUTTONDBLCLK
invoke EndDialog, hWnd, 0
case WM_LBUTTONDOWN
invoke SendMessage, hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
endsw
xor eax,eax
ret
MAINDLGPROC endp
;.......................................................................
IF INFODLG
INFODLGPROC PROC hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
switch uMsg
case WM_INITDIALOG
IF INFODLG AND RELEASEDATA
invoke FindResource, hInst, IDR_INF, RT_RCDATA
invoke LoadResource, hInst, eax
invoke LockResource, eax
invoke SendDlgItemMessage, hWnd, IDE_INF, WM_SETTEXT, 0, eax
ENDIF
case WM_COMMAND
.if wParam == IDB_CLSINF
invoke SendMessage, hWnd, WM_CLOSE, 0, 0
.endif
case WM_CLOSE || uMsg == WM_RBUTTONUP || uMsg == WM_LBUTTONDBLCLK
invoke EndDialog, hWnd, 0
case WM_LBUTTONDOWN
invoke SendMessage, hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
endsw
xor eax, eax
ret
INFODLGPROC ENDP
ENDIF
;.......................................................................
Start:
pushad
invoke GetModuleHandle, 0
mov hInst,eax
invoke DialogBoxParam, hInst, IDD_DLG, 0, MAINDLGPROC, 0
popad
invoke ExitProcess, 0
ret
end Start