Advertisement
Guest User

Untitled

a guest
Sep 27th, 2017
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. format PE64 GUI 6.0
  2. entry start
  3.  
  4. include 'win64a.inc'
  5.  
  6. section '.code' code readable executable
  7.  
  8. proc start
  9.  
  10. invoke GetModuleHandleW,0
  11. mov [wc.hInstance],rax
  12.  
  13. mov [wc.cbSize],sizeof.WNDCLASSEX
  14.  
  15. mov [wc.style],CS_HREDRAW or CS_VREDRAW
  16. mov [wc.lpfnWndProc],WindowProc
  17. mov [wc.cbClsExtra],0
  18.  
  19. invoke LoadIcon,0,IDI_APPLICATION
  20. mov [wc.hIcon],rax
  21. mov [wc.hIconSm],rax
  22.  
  23. invoke LoadCursor,0,IDC_ARROW
  24. mov [wc.hCursor],rax
  25.  
  26. mov [wc.hbrBackground],COLOR_WINDOW+1
  27. mov [wc.lpszMenuName],NULL
  28. mov [wc.lpszClassName],szClass
  29.  
  30. invoke RegisterClass,wc
  31.  
  32. invoke CreateWindowEx,0,szClass,szTitle,WS_VISIBLE + WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,500,100,NULL,NULL,[wc.hInstance],NULL
  33. mov [hWnd],rax
  34.  
  35. msg_loop:
  36. invoke GetMessage,msg,NULL,0,0
  37. or eax,eax
  38. je exit
  39. jne msg_loop
  40.  
  41. invoke TranslateMessage,msg
  42. invoke DispatchMessage,msg
  43. jmp msg_loop
  44.  
  45. exit:
  46.  
  47. invoke ExitProcess,[msg.wParam]
  48.  
  49. endp
  50.  
  51. proc WindowProc hwnd,wmsg,wparam,lparam
  52.  
  53. mov [hwnd],rcx
  54. mov [wmsg],rdx
  55. mov [wparam],r8
  56. mov [lparam],r9
  57.  
  58. cmp [wmsg],WM_DESTROY
  59. jne .defwndproc
  60.  
  61. invoke PostQuitMessage,0
  62.  
  63. ret
  64.  
  65. .defwndproc:
  66.  
  67. invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
  68. ret
  69. endp
  70.  
  71.  
  72. section '.data' data readable writeable
  73.  
  74. hWnd dq ?
  75. hInstance dq ?
  76.  
  77. szTitle db 'CLOCK',0
  78. szClass db 'CLOCK',0
  79.  
  80. wc WNDCLASSEX
  81. msg MSG
  82.  
  83. section '.idata' import data readable writeable
  84.  
  85. library kernel,'KERNEL32.DLL',\
  86. user,'USER32.DLL'
  87.  
  88. import kernel,\
  89. ExitProcess,'ExitProcess',\
  90. GetModuleHandleW,'GetModuleHandleW',\
  91. Sleep,'Sleep'
  92.  
  93. import user,\
  94. PostQuitMessage,'PostQuitMessage',\
  95. LoadIcon,'LoadIconA',\
  96. LoadCursor,'LoadCursorA',\
  97. ShowWindow,'ShowWindow',\
  98. RegisterClass,'RegisterClassA',\
  99. CreateWindowEx,'CreateWindowExA',\
  100. DefWindowProc,'DefWindowProcA',\
  101. GetMessage,'GetMessageA',\
  102. TranslateMessage,'TranslateMessage',\
  103. DispatchMessage,'DispatchMessageA'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement