Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE64 GUI 6.0
- entry start
- include 'win64a.inc'
- section '.code' code readable executable
- proc start
- invoke GetModuleHandleW,0
- mov [wc.hInstance],rax
- mov [wc.cbSize],sizeof.WNDCLASSEX
- mov [wc.style],CS_HREDRAW or CS_VREDRAW
- mov [wc.lpfnWndProc],WindowProc
- mov [wc.cbClsExtra],0
- invoke LoadIcon,0,IDI_APPLICATION
- mov [wc.hIcon],rax
- mov [wc.hIconSm],rax
- invoke LoadCursor,0,IDC_ARROW
- mov [wc.hCursor],rax
- mov [wc.hbrBackground],COLOR_WINDOW+1
- mov [wc.lpszMenuName],NULL
- mov [wc.lpszClassName],szClass
- invoke RegisterClass,wc
- invoke CreateWindowEx,0,szClass,szTitle,WS_VISIBLE + WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,500,100,NULL,NULL,[wc.hInstance],NULL
- mov [hWnd],rax
- msg_loop:
- invoke GetMessage,msg,NULL,0,0
- or eax,eax
- je exit
- jne msg_loop
- invoke TranslateMessage,msg
- invoke DispatchMessage,msg
- jmp msg_loop
- exit:
- invoke ExitProcess,[msg.wParam]
- endp
- proc WindowProc hwnd,wmsg,wparam,lparam
- mov [hwnd],rcx
- mov [wmsg],rdx
- mov [wparam],r8
- mov [lparam],r9
- cmp [wmsg],WM_DESTROY
- jne .defwndproc
- invoke PostQuitMessage,0
- ret
- .defwndproc:
- invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
- ret
- endp
- section '.data' data readable writeable
- hWnd dq ?
- hInstance dq ?
- szTitle db 'CLOCK',0
- szClass db 'CLOCK',0
- wc WNDCLASSEX
- msg MSG
- section '.idata' import data readable writeable
- library kernel,'KERNEL32.DLL',\
- user,'USER32.DLL'
- import kernel,\
- ExitProcess,'ExitProcess',\
- GetModuleHandleW,'GetModuleHandleW',\
- Sleep,'Sleep'
- import user,\
- PostQuitMessage,'PostQuitMessage',\
- LoadIcon,'LoadIconA',\
- LoadCursor,'LoadCursorA',\
- ShowWindow,'ShowWindow',\
- RegisterClass,'RegisterClassA',\
- CreateWindowEx,'CreateWindowExA',\
- DefWindowProc,'DefWindowProcA',\
- GetMessage,'GetMessageA',\
- TranslateMessage,'TranslateMessage',\
- DispatchMessage,'DispatchMessageA'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement