.386
.model flat,stdcall
option casemap:none
include windows.inc
include
gdi32.inc
includelib gdi32.lib
include user32.inc
includelib user32.lib
include
kernel32.inc
includelib kernel32.lib
include masm32.inc
includelib masm32.lib
.data
szCoder db 'Code By Firewings[CCG] Org:China Crack Group',0
a db
26 dup(0)
b db 26 dup(0)
count db 0
num db 0
num1 db 0
szButton
db 'button',0
szButtonText db 'Generate',0
szButtonText1 db 'Copy',0
szButtonText2
db 'Exit',0
sztext db 'Hello World!',0
hInstance dd ?
hWinMain dd ?
hGA
dd ?
hIcon dd ?
hDcBack dd ?
base dd 33
hBmp dd ?
ORISTR db 'B2CD6FHJ1LN4RSTE3VWX8YZA0Q7MUK9P5',0
.const
szClassName db 'FWClass',0
szCaptionMain db 'KeyGen of 3Dmark 2003
Build 3.1.3.0',0
szText db 'Hello, I',39,'m Firewings!',0
.code
Paint_Proc proc hWin:DWORD, hDC:DWORD
LOCAL hOld:DWORD
LOCAL memDC :DWORD
invoke CreateCompatibleDC,hDC
mov memDC, eax
invoke SelectObject,memDC,hBmp
mov hOld, eax
invoke BitBlt,hDC,120,10,150,56,memDC,0,0,SRCCOPY
;invoke BitBlt,hDc,90,71,150,56,hBmp,0,0,SRCCOPY
invoke SelectObject,hDC,hOld
invoke DeleteDC,memDC
mov eax,0
ret
Paint_Proc endp
_ProcWinMain proc uses
ebx edi esi,hWnd,uMsg,wParam,lParam
local @stPs:PAINTSTRUCT
local @stRect:RECT
local @hdc1
local @hDc
local @hBmpBack
local @hDc2
mov eax,uMsg
.if eax==WM_PAINT
invoke BeginPaint,hWnd,addr @stPs
mov @hDc,eax
invoke GetClientRect,hWnd,addr @stRect
invoke FillRect,@hDc,addr @stRect,COLOR_BTNFACE+1
invoke EndPaint,hWnd,addr @stPs
invoke GetDC,hWnd
mov @hDc,eax
invoke
Paint_Proc,hWnd,@hDc
mov @stRect.left,90
mov @stRect.top,71
mov @stRect.right,310
mov @stRect.bottom,91
invoke FillRect,@hDc,addr @stRect,COLOR_BTNFACE+1
invoke SetBkMode,@hDc,TRANSPARENT
invoke DrawText,@hDc,addr a,-1,addr @stRect,DT_CENTER
or DT_VCENTER or DT_SINGLELINE
mov @stRect.left,3
mov @stRect.top,92
mov @stRect.right,380
mov @stRect.bottom,112
invoke SetBkMode,@hDc,TRANSPARENT
invoke DrawText,@hDc,addr szCoder,-1,addr @stRect,DT_VCENTER or DT_SINGLELINE
invoke ReleaseDC,hWnd,@hDc
.elseif eax==WM_CLOSE
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,NULL
.elseif eax==WM_COMMAND
mov eax,wParam
movzx eax,ax
.if eax==1
call _KeyGen
invoke SendMessage ,hWnd,WM_PAINT,NULL,NULL
.elseif eax==2
invoke GlobalAlloc,GMEM_MOVEABLE,30
mov hGA,eax
invoke
GlobalLock,hGA
.if eax==0
.else
mov edi,eax
mov esi,offset a
mov ecx,25
rep movsb
invoke GlobalUnlock,hGA
call _CopyData
.endif
.elseif eax==3
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,NULL
.else
jmp loc4
.endif
.else
loc4: invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
;********************************************************************
xor eax,eax
ret
_ProcWinMain endp
_WinMain
proc
local @stWndClass:WNDCLASSEX
local @stMsg:MSG
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
invoke LoadBitmap,hInstance,5678
mov hBmp, eax
invoke LoadIcon,hInstance,1234
mov @stWndClass.hIcon,eax
mov hIcon,eax
invoke LoadCursor,0,IDC_ARROW
mov @stWndClass.hCursor,eax
push hInstance
pop @stWndClass.hInstance
mov @stWndClass.cbSize,sizeof WNDCLASSEX
mov @stWndClass.style,CS_HREDRAW
or CS_VREDRAW
mov @stWndClass.lpfnWndProc,offset _ProcWinMain
mov @stWndClass.hbrBackground,COLOR_BTNFACE+1
mov @stWndClass.lpszClassName,offset szClassName
invoke RegisterClassEx,addr
@stWndClass
invoke CreateWindowEx,WS_EX_CLIENTEDGE,offset szClassName,offset
szCaptionMain,WS_OVERLAPPED or WS_SYSMENU,300,200,340,150,NULL,NULL,hInstance,NULL
mov hWinMain,eax
invoke CreateWindowEx,NULL,offset szButton,offset szButtonText,WS_CHILD
or WS_VISIBLE,10,10,70,22,hWinMain,1,hInstance,NULL
invoke CreateWindowEx,NULL,offset
szButton,offset szButtonText1,WS_CHILD or WS_VISIBLE,10,40,70,22,hWinMain,2,hInstance,NULL
invoke CreateWindowEx,NULL,offset szButton,offset szButtonText2,WS_CHILD or WS_VISIBLE,10,70,70,22,hWinMain,3,hInstance,NULL
invoke ShowWindow,hWinMain,SW_SHOWNORMAL
call _KeyGen
invoke UpdateWindow,hWinMain
.While TRUE
invoke GetMessage,addr @stMsg,NULL,0,0
.break .if eax==0
invoke TranslateMessage,addr @stMsg
invoke DispatchMessage,addr @stMsg
.endw
ret
_WinMain endp
_KeyGen proc
uses ebx edi esi
invoke GetTickCount
invoke nseed,eax
mov count,0
lea ebx,a
loc1:
mov eax,1
add al,count
xor edx,edx
mov ecx,6
div ecx
cmp edx,0
jz loc2
invoke nrandom,base
lea edx,ORISTR
mov num,al
add edx,eax
mov al,[edx]
jmp loc3
loc2: mov al,2dh
mov num,-1
loc3: xor ecx,ecx
mov cl,count
lea ebx,a
mov [ebx+ecx],al
mov al,num
lea ebx,b
mov [ebx+ecx],al
add count,1
cmp count,18
jnz loc1
lea esi,a
lea edi,b
xor eax,eax
xor ecx,ecx
xor ebx,ebx
loc7:
push ecx
xor edx,edx
mov count,0
mov num,0
mov al,6
mul cl
mov num1,al
loc8: movzx bx,count
xor ecx,ecx
push eax
add ax,bx
mov al,[edi+eax]
add num,al
add count,1
cmp count,4
pop eax
jnz loc8
xor eax,eax
xor edx,edx
mov al,num
mov ecx,33
div
ecx
lea ebx,ORISTR
add bx,dx
mov bl,[ebx]
xor ax,ax
mov al,num1
add al,4
mov [esi+eax],bl
mov [edi+eax],dl
pop ecx
inc ecx
cmp ecx,3
jnz loc7
xor eax,eax
xor edx,edx
xor ebx,ebx
mov
ecx,33
mov bl,[edi+4]
add ax,bx
mov bl,[edi+10]
add ax,bx
mov bl,[edi+16]
add ax,bx
div cx
lea ebx,ORISTR
add bx,dx
mov bl,[ebx]
mov [esi+18],bl
mov [edi+18],dl
xor eax,eax
xor edx,edx
mov ecx,33
xor ebx,ebx
mov bl,[edi+10]
add ax,bx
mov bl,[edi+16]
add ax,bx
mov bl,[edi+18]
add ax,bx
div cx
lea ebx,ORISTR
add bx,dx
mov bl,[ebx]
mov [esi+19],bl
mov [edi+19],dl
xor eax,eax
xor edx,edx
xor ebx,ebx
mov ecx,33
mov bl,[edi+16]
add ax,bx
mov bl,[edi+18]
add ax,bx
mov bl,[edi+19]
add ax,bx
div cx
lea ebx,ORISTR
add bx,dx
mov bl,[ebx]
mov [esi+20],bl
mov [edi+20],dl
xor eax,eax
xor edx,edx
xor ebx,ebx
mov ecx,33
mov bl,[edi+18]
add ax,bx
mov bl,[edi+19]
add ax,bx
mov bl,[edi+20]
add ax,bx
div cx
lea ebx,ORISTR
add bx,dx
mov bl,[ebx]
mov [esi+21],bl
mov [edi+21],dl
xor eax,eax
xor edx,edx
xor ebx,ebx
mov ecx,33
mov bl,[edi+19]
add ax,bx
mov bl,[edi+20]
add ax,bx
mov bl,[edi+21]
add ax,bx
div cx
lea ebx,ORISTR
add bx,dx
mov bl,[ebx]
mov
[esi+22],bl
mov [edi+22],dl
invoke UpdateWindow,hWinMain
ret
_KeyGen
endp
_CopyData proc
invoke OpenClipboard,hWinMain
invoke EmptyClipboard
invoke SetClipboardData,CF_TEXT,hGA
invoke CloseClipboard
ret
_CopyData endp
start:
;invoke MessageBox,NULL,offset a,offset szCap,MB_OK
call _WinMain
invoke ExitProcess,NULL
end start