-
Notifications
You must be signed in to change notification settings - Fork 2
/
core.asm
89 lines (66 loc) · 3.56 KB
/
core.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
; 10/10/2009 -----------------------------------------------------------
; +------------u n t i l----r e a c h----v o i d------------¦
; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
; ¦ ¦¦ _ ¦¦ ¦¦ ¯¦¦ ¯ ¦
; ¦ ________ ¦¦___ ¯¯¯¦¦ ________ ¦¦ ¦¦¦_ ¯¦¦
; ¦ _ ¦¦ ¯ ¦¦ _¦¦ _ ¦¦ _ ¦
; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
; a s p h y x i a
;
; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
;
; in memoriam of l.
; smiling in another plane of existence, perhaps...
.code
;-----------------------------------------------------------------------
;(sha1(szname)*2)^2 + serial.part1^2 == serial.part2^2
;(sha1(szname)*2)*(sha1(szname)*2) + serial.part1*serial.part1 == serial.part2*serial.part2
include core\misc.inc
registration proc hWnd
local szname[MAX_NAME_LENGTH+1]:byte, szregistration[200]:byte, hregistration:sregistration
pushad
.while (1)
invoke WaitForSingleObject, hEvent, -1
invoke SendDlgItemMessage, hWnd, IDE_NAME, WM_GETTEXT, sizeof szname, addr szname
.if eax >= MIN_NAME_LENGTH && eax <= MAX_NAME_LENGTH
invoke SendDlgItemMessage, hWnd, IDE_REGISTRATION, WM_GETTEXT, sizeof szregistration, addr szregistration
invoke validate_format, addr szregistration
.if eax >= MIN_SERIAL_LENGTH && eax <= MAX_SERIAL_LENGTH
invoke xfill, 0, addr hregistration, sizeof sregistration
invoke xbase256, addr szregistration, addr hregistration
invoke blowfish_init, addr random, 20
invoke blowfish_decrypt, addr hregistration, sizeof sregistration, 0
invoke verify_registration, addr szname, addr hregistration
.if eax == TRUE
invoke PostMessage, hWnd, WM_DEFEATED, 0, 0
.endif
.endif
.endif
.endw
popad
ret
registration endp
;-----------------------------------------------------------------------
initialize proc hWnd:HWND
local dwlen:dword, szusername[100]:byte, szrandom[100]:byte
pushad
invoke create_random_activation, addr random
invoke print_random_activation, addr random, 20, addr szrandom
invoke SendDlgItemMessage, hWnd, IDE_ACTIVATION, WM_SETTEXT, 0, addr szrandom
; Fetching and displaying user name in field "Name"
mov dwlen, MAX_NAME_LENGTH
invoke GetUserName, addr szusername, addr dwlen
invoke SendDlgItemMessage, hWnd, IDE_NAME, WM_SETTEXT, 0, addr szusername
; Setting up object to activate the thread below
invoke CreateEvent, 0, 0, 0, 0
mov hEvent, eax
; Creates registration basic check thread
invoke CreateThread, NULL, NULL, addr registration, hWnd, NULL, NULL
popad
ret
initialize endp
;-----------------------------------------------------------------------
deinitialize proc
ret
deinitialize endp
;-----------------------------------------------------------------------