home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sberbank.sumy.ua
/
2014.11.ftp.sberbank.sumy.ua.tar
/
ftp.sberbank.sumy.ua
/
incoming
/
1
/
timesnm.ASM
< prev
next >
Wrap
Assembly Source File
|
2014-02-08
|
4KB
|
208 lines
format PE GUI 4.0
entry start
include 'win32w.inc'
section '.idata' import data readable writeable
library kernel32,'KERNEL32.DLL',\
user32,'USER32.DLL',\
gdi32,'GDI32.DLL'
include 'api\kernel32.inc'
include 'api\user32.inc'
include 'api\gdi32.inc'
section '.data' data readable writeable
_class TCHAR 'Evgeney_Victorovich_Kupin_27_April_1982',0
_title TCHAR 'Shot',0
_error TCHAR 'Evgeney_Victorovich_Kupin_27_April_1982',0
EVKupin TCHAR 'Evgeney Victorovich Kupin, born 27 April 1982',0
cFormatDcSt TCHAR '%08d%s',0
cFileName TCHAR '00000001.bmp',0
WindWidth dd 650
WindHeight dd 520
MinDate dd 02173000
MaxDate dd 02173900
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_WINDOW,NULL,_class
msg MSG
section '.bss' data readable writeable
hwnd dd ?
PosX dd ?
PosY dd ?
hdc dd ?
date dd ?
number dd ?
sysTime SYSTEMTIME
section '.text' code readable executable
start:
invoke GetModuleHandle,0
mov [wc.hInstance],eax
invoke LoadIcon,0,IDI_APPLICATION
mov [wc.hIcon],eax
invoke LoadCursor,0,IDC_ARROW
mov [wc.hCursor],eax
invoke RegisterClass,wc
test eax,eax
jz error
invoke CreateWindowEx,0,_class,_title,WS_OVERLAPPEDWINDOW,\
0,0,[WindWidth],[WindHeight],\
NULL,NULL,[wc.hInstance],NULL
test eax,eax
jz error
mov [hwnd],eax
invoke ShowWindow, [hwnd], SW_SHOWNORMAL
invoke UpdateWindow, [hwnd]
msg_loop:
invoke GetMessage,msg,NULL,0,0
cmp eax,1
jb end_loop
jne msg_loop
invoke TranslateMessage,msg
invoke DispatchMessage,msg
jmp msg_loop
error:
invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
end_loop:
invoke ExitProcess,[msg.wParam]
proc DisplayDibPixel
local X:DWORD, Y:DWORD, hFile:DWORD,dwBytesRead:DWORD,RGB:DWORD
push ebx esi edi
push [MinDate]
pop [number]
DisplayDibPixel_NUMBER:
invoke wsprintf, cFileName, cFormatDcSt, [number], cFileName+16
invoke CreateFile, cFileName, GENERIC_READ,\
0, NULL, OPEN_EXISTING,\
FILE_ATTRIBUTE_NORMAL, NULL
cmp eax, INVALID_HANDLE_VALUE
je DisplayDibPixel_NO_FILE
mov [hFile], eax
invoke SetFilePointer,[hFile],54,0,FILE_BEGIN
mov [Y], 479
DisplayDibPixel_Y:
mov [X], 0
DisplayDibPixel_X:
lea ecx, [RGB]
lea eax, [dwBytesRead]
invoke ReadFile,[hFile], ecx, 3, eax, NULL
and [RGB], 0xffffff
invoke SetPixel,[hdc],[X],[Y],[RGB]
inc [X]
cmp [X],640
jne DisplayDibPixel_X
dec [Y]
cmp [Y],0
jns DisplayDibPixel_Y
invoke CloseHandle,[hFile]
DisplayDibPixel_NO_FILE:
inc [number]
mov eax, [MaxDate]
cmp [number], eax
jb DisplayDibPixel_NUMBER
pop edi esi ebx
ret
endp
proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam
local ps:PAINTSTRUCT
cmp [wmsg],WM_PAINT
je WIN_MAIN_PAINT
cmp [wmsg], WM_CREATE
je WIN_MAIN_CREATE
cmp [wmsg],WM_DESTROY
je WIN_MAIN_DESTROY
WIN_MAIN_DEFAULT:
invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
jmp WIN_MAIN_FINISH
WIN_MAIN_CREATE:
invoke GetLocalTime, sysTime
mov ax,[sysTime.wYear]
and eax, 0xffff
sub ax, 2000
mov [date], eax
xor edx, edx
mov ecx, 10
div ecx
mov [date], edx
mov edx, 100
mul edx
add [date], eax
mov eax, DWORD[sysTime.wMonth]
and eax, 0xffff
mov ecx, 10
mul ecx
add [date], eax
mov eax, DWORD[sysTime.wDay]
and eax, 0xffff
mov ecx, 1000
mul ecx
add [date], eax
mov eax, [date]
mov ecx, 1000
mul ecx
mov [MinDate], eax
add eax, 999
mov [MaxDate], eax
; invoke wsprintf, cFileName, cFormatDcSt, [MaxDate], cFileName+16
; invoke MessageBox,[hwnd],cFileName,cFileName,0
xor eax, eax
jmp WIN_MAIN_FINISH
WIN_MAIN_PAINT:
lea eax, [ps]
invoke BeginPaint, [hwnd], eax
mov [hdc],eax
stdcall DisplayDibPixel
lea eax, [ps]
invoke EndPaint, [hwnd], eax
jmp WIN_MAIN_FINISH
WIN_MAIN_DESTROY:
invoke PostQuitMessage,0
xor eax,eax
WIN_MAIN_FINISH:
ret
endp