Advertisement
Guest User

messageboxa x64.asm

a guest
Jan 29th, 2018
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; 1. Compile
  3. ; nasm.exe -w-orphan-labels "messageboxa x64.asm" -f win64 -o "messageboxa x64.obj"
  4. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5. ; 2. Link
  6. ; GoLink.exe "messageboxa x64.obj" "kernel32.dll" /dynamicbase /entry start /largeaddressaware /nxcompat /fo "messageboxa x64.exe"
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9. BITS 64
  10.  
  11. extern LoadLibraryA
  12. extern GetProcAddress
  13.  
  14. section .text use64
  15.  
  16.  
  17. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  18. ; Main Thread                                                               ;
  19. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  20. ; Procedure loading and fast as possible window message dispatching.        ;
  21. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  22.  
  23.  
  24. global start
  25. export start
  26. start:
  27. ;
  28. sub rsp, 0x68
  29. ;
  30. lea rcx, [rel kernel32_dll_0]
  31. call LoadLibraryA
  32. mov [rel LoadLibrary_kernel32_dll_], rax
  33. mov rcx, [rel LoadLibrary_kernel32_dll_]
  34. lea rdx, [rel SetUnhandledExceptionFilter_0]
  35. call GetProcAddress
  36. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_SetUnhandledExceptionFilter_], rax
  37. ;
  38. mov rcx, [rel LoadLibrary_kernel32_dll_]
  39. lea rdx, [rel RaiseException_0]
  40. call GetProcAddress
  41. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_RaiseException_], rax
  42. ;
  43. lea rcx, [rel user32_dll_0]
  44. call LoadLibraryA
  45. mov [rel LoadLibrary_user32_dll_], rax
  46. mov rcx, rax
  47. lea rdx, [rel MessageBoxA_0]
  48. call GetProcAddress
  49. mov [rel GetProcAddress_LoadLibrary_user32_dll_MessageBoxA_], rax
  50. ;
  51. mov rcx, [rel LoadLibrary_kernel32_dll_]
  52. lea rdx, [rel GetModuleHandleA_0]
  53. call GetProcAddress
  54. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_GetModuleHandleA_], rax
  55. ;
  56. xor rcx, rcx
  57. call [rel GetProcAddress_LoadLibrary_kernel32_dll_GetModuleHandleA_]
  58. mov [rel GetModuleHandleA__], rax
  59. ;
  60. mov rcx, [rel LoadLibrary_user32_dll_]
  61. lea rdx, [rel RegisterClassExW_0]
  62. call GetProcAddress
  63. mov [rel GetProcAddress_LoadLibrary_user32_dll_RegisterClassExW_], rax
  64. ;
  65. mov dword [rel WNDCLASSEX_cbSize], 80
  66. mov dword [rel WNDCLASSEX_style], 0x00000000
  67. mov rcx, [rel LoadLibrary_user32_dll_]
  68. lea rdx, [rel DefWindowProcW_0]
  69. call GetProcAddress
  70. mov [rel GetProcAddress_LoadLibrary_user32_dll_DefWindowProcW_], rax
  71. mov qword [rel WNDCLASSEX_lpfnWndProc], rax
  72. mov dword [rel WNDCLASSEX_cbClsExtra], 0
  73. mov dword [rel WNDCLASSEX_cbWndExtra], 0
  74. mov rax, [rel GetModuleHandleA__]
  75. mov qword [rel WNDCLASSEX_hInstance], rax
  76. mov qword [rel WNDCLASSEX_hIcon], 0
  77. mov rcx, [rel LoadLibrary_user32_dll_]
  78. lea rdx, [rel LoadCursorW_0]
  79. call GetProcAddress
  80. mov [rel GetProcAddress_LoadLibrary_user32_dll_LoadCursorW_], rax
  81. xor rcx, rcx
  82. mov rdx, 32512
  83. call [rel GetProcAddress_LoadLibrary_user32_dll_LoadCursorW_]
  84. mov [rel LoadCursorW__], rax
  85. mov qword [rel WNDCLASSEX_hCursor], rax
  86. mov qword [rel WNDCLASSEX_hbrBackground], 0
  87. mov qword [rel WNDCLASSEX_lpszMenuName], 0
  88. lea rax, [rel _0]
  89. mov qword [rel WNDCLASSEX_lpszClassName], rax
  90. mov qword [rel WNDCLASSEX_hIconSm], 0
  91. lea rcx, [rel WNDCLASSEX]
  92. call [rel GetProcAddress_LoadLibrary_user32_dll_RegisterClassExW_]
  93. mov [rel RegisterClassExW__], rax
  94. ;
  95. mov rcx, [rel LoadLibrary_user32_dll_]
  96. lea rdx, [rel CreateWindowExW_0]
  97. call GetProcAddress
  98. mov [rel GetProcAddress_LoadLibrary_user32_dll_CreateWindowExW_], rax
  99. ;
  100. mov rcx, 0x00000000000C0000
  101. mov rdx, [rel RegisterClassExW__]
  102. xor r8, r8
  103. mov r9, 0x0000000000000000
  104. mov qword [rsp+0x20], 0
  105. mov qword [rsp+0x28], 0
  106. mov qword [rsp+0x30], 800
  107. mov qword [rsp+0x38], 600
  108. mov qword [rsp+0x40], 0
  109. mov qword [rsp+0x48], 0
  110. mov rax, [rel GetModuleHandleA__]
  111. mov qword [rsp+0x50], rax
  112. mov qword [rsp+0x58], 0
  113. call [rel GetProcAddress_LoadLibrary_user32_dll_CreateWindowExW_]
  114. mov [rel CreateWindowExW__], rax
  115. ;
  116. mov rcx, [rel LoadLibrary_user32_dll_]
  117. lea rdx, [rel SetWindowLongPtrW_0]
  118. call GetProcAddress
  119. mov [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowLongPtrW_], rax
  120. ; Some flags do not take effect using CreateWindowExW, try better this time
  121. mov rcx, [rel CreateWindowExW__]
  122. mov rdx, -20
  123. mov r8, 0x00000000000C0000
  124. call [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowLongPtrW_]
  125. mov [rel SetWindowLongPtrW__], rax
  126. mov rcx, [rel CreateWindowExW__]
  127. mov rdx, -16
  128. mov r8, 0x0000000000000000
  129. call [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowLongPtrW_]
  130. mov [rel SetWindowLongPtrW__], rax
  131. ;
  132. mov rcx, [rel LoadLibrary_user32_dll_]
  133. lea rdx, [rel SetWindowPos_0]
  134. call GetProcAddress
  135. mov [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowPos_], rax
  136. ;
  137. mov rcx, [rel LoadLibrary_user32_dll_]
  138. lea rdx, [rel EnumDisplaySettingsW_0]
  139. call GetProcAddress
  140. mov [rel GetProcAddress_LoadLibrary_user32_dll_EnumDisplaySettingsW_], rax
  141. ;
  142. xor rcx, rcx
  143. mov edx, 0xffffffff
  144. mov word [rel DEVMODEW_dmSize], 220
  145. mov word [rel DEVMODEW_dmDriverExtra], 0
  146. lea r8, [rel DEVMODEW]
  147. call [rel GetProcAddress_LoadLibrary_user32_dll_EnumDisplaySettingsW_]
  148. mov [rel EnumDisplaySettingsW__], rax
  149. ;
  150. mov rcx, [rel CreateWindowExW__]
  151. xor rdx, rdx
  152. xor r8, r8
  153. xor r9, r9
  154. mov eax, dword [rel DEVMODEW_dmPelsWidth]
  155. cmp eax, 800
  156. jae WindowWidthSet
  157. mov eax, 800
  158. export WindowWidthSet
  159. WindowWidthSet:
  160. mov dword [rsp+0x20], eax
  161. mov eax, dword [rel DEVMODEW_dmPelsHeight]
  162. cmp eax, 600
  163. jae WindowHeightSet
  164. mov eax, 600
  165. export WindowHeightSet
  166. WindowHeightSet:
  167. mov dword [rsp+0x28], eax
  168. mov qword [rsp+0x30], 0x00000000000000A0
  169. call [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowPos_]
  170. mov [rel SetWindowPos__], rax
  171. ;
  172. lea rcx, [rel Gdi32_dll_0]
  173. call LoadLibraryA
  174. mov [rel LoadLibrary_Gdi32_dll_], rax
  175. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  176. lea rdx, [rel CreatePolygonRgn_0]
  177. call GetProcAddress
  178. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreatePolygonRgn_], rax
  179. ;
  180. lea rcx, [rel CreatePolygonRgn_POINT]
  181. mov rdx, 4
  182. mov r8, 1
  183. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreatePolygonRgn_]
  184. mov [rel HRGN], rax
  185. ;
  186. mov rcx, [rel LoadLibrary_user32_dll_]
  187. lea rdx, [rel SetWindowRgn_0]
  188. call GetProcAddress
  189. mov [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowRgn_], rax
  190. ;
  191. mov rcx, [rel CreateWindowExW__]
  192. mov rdx, [rel HRGN]
  193. mov r8, 1
  194. call [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowRgn_]
  195. mov [rel SetWindowRgn__], rax
  196. ;
  197. mov rcx, [rel LoadLibrary_user32_dll_]
  198. lea rdx, [rel GetDC_0]
  199. call GetProcAddress
  200. mov [rel GetProcAddress_LoadLibrary_user32_dll_GetDC_], rax
  201. ;
  202. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  203. lea rdx, [rel SelectObject_0]
  204. call GetProcAddress
  205. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_SelectObject_], rax
  206. ;
  207. mov rcx, [rel LoadLibrary_user32_dll_]
  208. lea rdx, [rel ReleaseDC_0]
  209. call GetProcAddress
  210. mov [rel GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_], rax
  211. ;
  212. mov rcx, [rel LoadLibrary_user32_dll_]
  213. lea rdx, [rel ShowWindow_0]
  214. call GetProcAddress
  215. mov [rel GetProcAddress_LoadLibrary_user32_dll_ShowWindow_], rax
  216. ;
  217. mov rcx, [rel LoadLibrary_user32_dll_]
  218. lea rdx, [rel SetLayeredWindowAttributes_0]
  219. call GetProcAddress
  220. mov [rel GetProcAddress_LoadLibrary_user32_dll_SetLayeredWindowAttributes_], rax
  221. ;
  222. ;mov rcx, [rel CreateWindowExW__]
  223. ;xor rdx, rdx
  224. ;mov r8, 255
  225. ;mov r9, 2
  226. ;call [rel GetProcAddress_LoadLibrary_user32_dll_SetLayeredWindowAttributes_]
  227. ;mov [rel SetLayeredWindowAttributes__], rax
  228. ;
  229. mov rcx, [rel CreateWindowExW__]
  230. mov rdx, 5
  231. call [rel GetProcAddress_LoadLibrary_user32_dll_ShowWindow_]
  232. mov [rel ShowWindow__], rax
  233. ;
  234. mov rcx, [rel CreateWindowExW__]
  235. mov rdx, 5
  236. call [rel GetProcAddress_LoadLibrary_user32_dll_ShowWindow_]
  237. mov [rel ShowWindow__], rax
  238. ;
  239. mov rcx, [rel LoadLibrary_user32_dll_]
  240. lea rdx, [rel UpdateWindow_0]
  241. call GetProcAddress
  242. mov [rel GetProcAddress_LoadLibrary_user32_dll_UpdateWindow_], rax
  243. ;
  244. mov rcx, [rel CreateWindowExW__]
  245. call [rel GetProcAddress_LoadLibrary_user32_dll_UpdateWindow_]
  246. mov [rel UpdateWindow__], rax
  247. ;
  248. mov rcx, [rel LoadLibrary_user32_dll_]
  249. lea rdx, [rel GetMessageW_0]
  250. call GetProcAddress
  251. mov [rel GetProcAddress_LoadLibrary_user32_dll_GetMessageW_], rax
  252. ;
  253. mov rcx, [rel LoadLibrary_user32_dll_]
  254. lea rdx, [rel TranslateMessage_0]
  255. call GetProcAddress
  256. mov [rel GetProcAddress_LoadLibrary_user32_dll_TranslateMessage_], rax
  257. ;
  258. mov rcx, [rel LoadLibrary_user32_dll_]
  259. lea rdx, [rel DispatchMessageW_0]
  260. call GetProcAddress
  261. mov [rel GetProcAddress_LoadLibrary_user32_dll_DispatchMessageW_], rax
  262. ;
  263. mov rcx, [rel LoadLibrary_kernel32_dll_]
  264. lea rdx, [rel CreateThread_0]
  265. call GetProcAddress
  266. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_CreateThread_], rax
  267. ;
  268. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  269. lea rdx, [rel CreateDIBSection_0]
  270. call GetProcAddress
  271. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreateDIBSection_], rax
  272. ;
  273. mov rcx, [rel LoadLibrary_kernel32_dll_]
  274. lea rdx, [rel CreateFileMappingW_0]
  275. call GetProcAddress
  276. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_CreateFileMappingW_], rax
  277. ;
  278. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  279. lea rdx, [rel GdiFlush_0]
  280. call GetProcAddress
  281. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_GdiFlush_], rax
  282. ;
  283. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  284. lea rdx, [rel CreateCompatibleDC_0]
  285. call GetProcAddress
  286. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreateCompatibleDC_], rax
  287. ;
  288. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  289. lea rdx, [rel BitBlt_0]
  290. call GetProcAddress
  291. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_BitBlt_], rax
  292. ;
  293. mov rcx, [rel LoadLibrary_user32_dll_]
  294. lea rdx, [rel ValidateRect_0]
  295. call GetProcAddress
  296. mov [rel GetProcAddress_LoadLibrary_user32_dll_ValidateRect_], rax
  297. ;
  298. mov rcx, [rel LoadLibrary_user32_dll_]
  299. lea rdx, [rel IsWindowEnabled_0]
  300. call GetProcAddress
  301. mov [rel GetProcAddress_LoadLibrary_user32_dll_IsWindowEnabled_], rax
  302. ;
  303. mov rcx, [rel LoadLibrary_user32_dll_]
  304. lea rdx, [rel IsWindowVisible_0]
  305. call GetProcAddress
  306. mov [rel GetProcAddress_LoadLibrary_user32_dll_IsWindowVisible_], rax
  307. ;
  308. mov rcx, [rel LoadLibrary_user32_dll_]
  309. lea rdx, [rel UpdateLayeredWindow_0]
  310. call GetProcAddress
  311. mov [rel GetProcAddress_LoadLibrary_user32_dll_UpdateLayeredWindow_], rax
  312. ;
  313. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  314. lea rdx, [rel GdiAlphaBlend_0]
  315. call GetProcAddress
  316. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_GdiAlphaBlend_], rax
  317. ;
  318. mov rcx, [rel LoadLibrary_kernel32_dll_]
  319. lea rdx, [rel VirtualQuery_0]
  320. call GetProcAddress
  321. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_VirtualQuery_], rax
  322. ;
  323. mov rcx, [rel LoadLibrary_kernel32_dll_]
  324. lea rdx, [rel CreateEventW_0]
  325. call GetProcAddress
  326. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_CreateEventW_], rax
  327. ;
  328. mov rcx, [rel LoadLibrary_kernel32_dll_]
  329. lea rdx, [rel SetEvent_0]
  330. call GetProcAddress
  331. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_SetEvent_], rax
  332. ;
  333. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  334. lea rdx, [rel D3DKMTOpenAdapterFromHdc_0]
  335. call GetProcAddress
  336. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTOpenAdapterFromHdc_], rax
  337. ;
  338. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  339. lea rdx, [rel D3DKMTCreateDevice_0]
  340. call GetProcAddress
  341. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCreateDevice_], rax
  342. ;
  343. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  344. lea rdx, [rel D3DKMTWaitForVerticalBlankEvent_0]
  345. call GetProcAddress
  346. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTWaitForVerticalBlankEvent_], rax
  347. ;
  348. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  349. lea rdx, [rel D3DKMTDestroyDevice_0]
  350. call GetProcAddress
  351. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTDestroyDevice_], rax
  352. ;
  353. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  354. lea rdx, [rel D3DKMTCloseAdapter_0]
  355. call GetProcAddress
  356. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCloseAdapter_], rax
  357. ;
  358. xor rcx, rcx
  359. xor rdx, rdx
  360. xor r8, r8
  361. xor r9, r9
  362. call [rel GetProcAddress_LoadLibrary_kernel32_dll_CreateEventW_]
  363. mov [rel CreateEventW__], rax
  364. ;
  365. mov rcx, [rel CreateEventW__]
  366. call [rel GetProcAddress_LoadLibrary_kernel32_dll_SetEvent_]
  367. mov [rel SetEvent__], rax
  368. test eax, eax
  369. jne SetEventIsWorking
  370. lea rdx, [rel guimessage_Event]
  371. lea r8, [rel guititle_Error]
  372. jmp ShowMessageBoxWithCustomText
  373. ;
  374. export SetEventIsWorking
  375. SetEventIsWorking:
  376. ;
  377. xor rdx, rdx
  378. mov eax, 1000
  379. mov ebx, dword [rel DEVMODEW_dmDisplayFrequency]
  380. test ebx, ebx
  381. jne DisplayFrequencyNotZero
  382. mov ebx, 1
  383. DisplayFrequencyNotZero:
  384. div ebx
  385. mov dword [rel SetTimer_uElapse], eax
  386. ;
  387. mov rcx, [rel LoadLibrary_user32_dll_]
  388. lea rdx, [rel SetTimer_0]
  389. call GetProcAddress
  390. mov [rel GetProcAddress_LoadLibrary_user32_dll_SetTimer_], rax
  391. ;
  392. mov rcx, [rel CreateWindowExW__]
  393. xor rdx, rdx
  394. mov r8d, dword [rel SetTimer_uElapse]
  395. xor r9, r9
  396. call [rel GetProcAddress_LoadLibrary_user32_dll_SetTimer_]
  397. mov [rel SetTimer__], rax
  398. ;
  399. mov rcx, [rel LoadLibrary_kernel32_dll_]
  400. lea rdx, [rel WaitForSingleObject_0]
  401. call GetProcAddress
  402. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_WaitForSingleObject_], rax
  403. ;
  404. mov rcx, [rel LoadLibrary_kernel32_dll_]
  405. lea rdx, [rel HeapCreate_0]
  406. call GetProcAddress
  407. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_HeapCreate_], rax
  408. ;
  409. xor rcx, rcx
  410. xor rdx, rdx
  411. xor r8, r8
  412. call [rel GetProcAddress_LoadLibrary_kernel32_dll_HeapCreate_]
  413. mov [rel HeapCreate__], rax
  414. ;
  415. mov rcx, [rel LoadLibrary_kernel32_dll_]
  416. lea rdx, [rel HeapAlloc_0]
  417. call GetProcAddress
  418. mov [rel GetProcAddress_LoadLibrary_kernel32_dll_HeapAlloc_], rax
  419. ;
  420. mov rcx, [rel HeapCreate__]
  421. xor rdx, rdx
  422. mov r8, 16777216
  423. call [rel GetProcAddress_LoadLibrary_kernel32_dll_HeapAlloc_]
  424. mov [rel HeapAlloc__], rax
  425. ;
  426. test rax, rax
  427. jne MemoryLoaded
  428. lea rdx, [rel guimessage_Memory]
  429. lea r8, [rel guititle_Error]
  430. jmp ShowMessageBoxWithCustomText
  431. export MemoryLoaded
  432. MemoryLoaded:
  433. ;
  434. mov rcx, [rel LoadLibrary_Gdi32_dll_]
  435. lea rdx, [rel ExtCreateRegion_0]
  436. call GetProcAddress
  437. mov [rel GetProcAddress_LoadLibrary_Gdi32_dll_ExtCreateRegion_], rax
  438. ;
  439. xor rax, rax
  440. ;
  441. xor rcx, rcx
  442. xor rdx, rdx
  443. lea r8, [rel DCDrawer]
  444. xor r9, r9
  445. mov qword [rsp+0x20], 0
  446. mov qword [rsp+0x28], 0
  447. call [rel GetProcAddress_LoadLibrary_kernel32_dll_CreateThread_]
  448. mov [rel CreateThread__], rax
  449. ;
  450. mov qword [rel MessagesReceived], 0
  451. export ProcessMessages
  452. ProcessMessages:
  453. lea rcx, [rel MSG]
  454. mov rdx, qword [rel CreateWindowExW__]
  455. xor r8, r8
  456. xor r9, r9
  457. call [rel GetProcAddress_LoadLibrary_user32_dll_GetMessageW_]
  458. mov [rel GetMessageW__], rax
  459. cmp eax, 0xffffffff
  460. je ShowMessageBox
  461. cmp eax, 0x00000000
  462. je ShowMessageBox
  463. ;
  464. cmp word [rel MSG_message], 0x0113
  465. jne ProcessWindowMessage__WM_TIMER
  466. mov rcx, [rel CreateEventW__]
  467. call [rel GetProcAddress_LoadLibrary_kernel32_dll_SetEvent_]
  468. mov [rel SetEvent__], rax
  469. export ProcessWindowMessage__WM_TIMER
  470. ProcessWindowMessage__WM_TIMER:
  471. ;
  472. lea rcx, [rel MSG]
  473. call [rel GetProcAddress_LoadLibrary_user32_dll_TranslateMessage_]
  474. lea rcx, [rel MSG]
  475. call [rel GetProcAddress_LoadLibrary_user32_dll_DispatchMessageW_]
  476. inc qword [rel MessagesReceived]
  477. jmp ProcessMessages
  478. ;
  479. export ShowMessageBox
  480. ShowMessageBox:
  481. lea rdx, [rel guimessage]
  482. lea r8, [rel guititle]
  483. export ShowMessageBoxWithCustomText
  484. ShowMessageBoxWithCustomText:
  485. xor rcx, rcx
  486. xor r9, r9
  487. call [rel GetProcAddress_LoadLibrary_user32_dll_MessageBoxA_]
  488. xor rax, rax
  489. add rsp, 0x68
  490. ret
  491.  
  492. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  493. ; DCDrawer                                                                  ;
  494. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  495. ; Window content drawing                                                    ;
  496. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  497.  
  498. export DCDrawer
  499. DCDrawer:
  500. sub rsp, 0x78
  501. ;
  502. mov rcx, 0xffffffffffffffff
  503. xor rdx, rdx
  504. mov r8, 0x0000000000000004
  505. xor r9, r9
  506. mov qword [rsp+0x20], 16777216
  507. mov qword [rsp+0x28], 0x0000000000000000
  508. call [rel GetProcAddress_LoadLibrary_kernel32_dll_CreateFileMappingW_]
  509. mov [rel CreateFileMappingW__], rax
  510. ;
  511. mov rcx, [rel CreateWindowExW__]
  512. call [rel GetProcAddress_LoadLibrary_user32_dll_GetDC_]
  513. mov [rel GetDC__], rax
  514. ;
  515. mov rcx, [rel GetDC__]
  516. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreateCompatibleDC_]
  517. mov [rel CreateCompatibleDC__], rax
  518. ;
  519. mov rcx, [rel CreateWindowExW__]
  520. mov rdx, [rel GetDC__]
  521. call [rel GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_]
  522. mov [rel ReleaseDC__], rax
  523. ;
  524. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biSize], 40
  525. mov eax, dword [rel DEVMODEW_dmPelsWidth]
  526. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biWidth], eax
  527. mov eax, dword [rel DEVMODEW_dmPelsHeight]
  528. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biHeight], eax
  529. mov word [rel BITMAPINFO_BITMAPINFOHEADER_biPlanes], 1
  530. mov word [rel BITMAPINFO_BITMAPINFOHEADER_biBitCount], 32
  531. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biCompression], 0
  532. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biSizeImage], 0
  533. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biXPelsPerMeter], 0
  534. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biYPelsPerMeter], 0
  535. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biClrUsed], 0
  536. mov dword [rel BITMAPINFO_BITMAPINFOHEADER_biClrImportant], 0
  537. mov dword [rel BITMAPINFO_RGBQUAD], 0
  538. ;
  539. mov rcx, [rel CreateCompatibleDC__]
  540. lea rdx, [rel BITMAPINFO]
  541. xor r8, r8
  542. lea r9, [rel CreateDIBSection_ppvBits]
  543. mov rax, [rel CreateFileMappingW__]
  544. mov qword [rsp+0x20], rax
  545. mov qword [rsp+0x28], 0x0000000000000000
  546. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreateDIBSection_]
  547. mov [rel CreateDIBSection__], rax
  548. cmp qword [rel CreateDIBSection_ppvBits], 0
  549. jne DisplayMemoryLoaded
  550. lea rdx, [rel guimessage_DisplayMemory]
  551. lea r8, [rel guititle_Error]
  552. jmp ShowMessageBoxWithCustomText_DCDrawer
  553. export DisplayMemoryLoaded
  554. DisplayMemoryLoaded:
  555. ;
  556. mov rcx, [rel CreateDIBSection_ppvBits]
  557. lea rdx, [rel MEMORY_BASIC_INFORMATION]
  558. mov r8, 48
  559. call [rel GetProcAddress_LoadLibrary_kernel32_dll_VirtualQuery_]
  560. mov [rel VirtualQuery__], rax
  561. ;
  562. mov rcx, [rel CreateCompatibleDC__]
  563. mov rdx, [rel CreateDIBSection__]
  564. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_SelectObject_]
  565. mov [rel SelectObject__], rax
  566. ;
  567. mov r10d, dword [rel DEVMODEW_dmPelsWidth]
  568. mov r11d, dword [rel DEVMODEW_dmPelsHeight]
  569. ; 0, 0 ---> 0, r11 ---> r10, r11
  570. ; r10, r11 ---> r10, 0 ---> 0, 0
  571. mov dword [rel CreatePolygonRgn_POINT_FullScreen], 0
  572. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x4], 0
  573. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x8], 0
  574. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0xC], r11d
  575. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x10], r10d
  576. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x14], r11d
  577. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x18], r10d
  578. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x1C], 0
  579. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x20], 0
  580. mov dword [rel CreatePolygonRgn_POINT_FullScreen+0x24], 0
  581. ;
  582. lea rcx, [rel CreatePolygonRgn_POINT_FullScreen]
  583. mov rdx, 4
  584. mov r8, 1
  585. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_CreatePolygonRgn_]
  586. mov [rel HRGN_FullScreen], rax
  587. ;
  588. mov rcx, [rel CreateWindowExW__]
  589. mov rdx, [rel HRGN_FullScreen]
  590. mov r8, 1
  591. call [rel GetProcAddress_LoadLibrary_user32_dll_SetWindowRgn_]
  592. mov [rel SetWindowRgn__], rax
  593. ;
  594. mov qword [rel FramesDrawn], 0
  595. export SetFrame
  596. SetFrame:
  597. ;
  598. mov rcx, [rel CreateWindowExW__]
  599. call [rel GetProcAddress_LoadLibrary_user32_dll_GetDC_]
  600. mov [rel GetDC__], rax
  601. test rax, rax
  602. je ShowMessageBox_DCDrawer
  603. ;
  604. cmp qword [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTOpenAdapterFromHdc_], 0
  605. je UseEventFrameSync
  606. cmp qword [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCreateDevice_], 0
  607. je UseEventFrameSync
  608. cmp qword [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTWaitForVerticalBlankEvent_], 0
  609. je UseEventFrameSync
  610. cmp qword [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTDestroyDevice_], 0
  611. je UseEventFrameSync
  612. cmp qword [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCloseAdapter_], 0
  613. je UseEventFrameSync
  614. ;
  615. mov rax, [rel GetDC__]
  616. mov [rel D3DKMT_OPENADAPTERFROMHDC_hDc], rax
  617. lea rcx, [rel D3DKMT_OPENADAPTERFROMHDC]
  618. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTOpenAdapterFromHdc_]
  619. mov [rel D3DKMTOpenAdapterFromHdc__], rax
  620. test eax, eax
  621. jne UseEventFrameSync
  622. ;
  623. mov eax, dword [rel D3DKMT_OPENADAPTERFROMHDC_hAdapter]
  624. mov dword [rel D3DKMT_CREATEDEVICE_hAdapter], eax
  625. mov dword [rel D3DKMT_CREATEDEVICE_Flags], 2
  626. lea rcx, [rel D3DKMT_CREATEDEVICE]
  627. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCreateDevice_]
  628. mov [rel D3DKMTCreateDevice__], rax
  629. ;
  630. test eax, eax
  631. je WaitForD3DKMTVerticalBlankEvent
  632. mov dword [rel D3DKMT_CREATEDEVICE_hDevice], 0
  633. export WaitForD3DKMTVerticalBlankEvent
  634. WaitForD3DKMTVerticalBlankEvent:
  635. ;
  636. mov eax, dword [rel D3DKMT_OPENADAPTERFROMHDC_hAdapter]
  637. mov dword [rel D3DKMT_WAITFORVERTICALBLANKEVENT_hAdapter], eax
  638. mov eax, dword [rel D3DKMT_CREATEDEVICE_hDevice]
  639. mov dword [rel D3DKMT_WAITFORVERTICALBLANKEVENT_hDevice], eax
  640. mov eax, dword [rel D3DKMT_OPENADAPTERFROMHDC_VidPnSourceId]
  641. mov dword [rel D3DKMT_WAITFORVERTICALBLANKEVENT_VidPnSourceId], eax
  642. lea rcx, [rel D3DKMT_WAITFORVERTICALBLANKEVENT]
  643. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTWaitForVerticalBlankEvent_]
  644. mov [rel D3DKMTWaitForVerticalBlankEvent__], rax
  645. ;
  646. cmp dword [rel D3DKMTCreateDevice__], 0
  647. jne ReleaseD3DKMTAdapter
  648. mov eax, dword [rel D3DKMT_CREATEDEVICE_hDevice]
  649. mov dword [rel D3DKMT_DESTROYDEVICE_hDevice], eax
  650. lea rcx, [rel D3DKMT_DESTROYDEVICE]
  651. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTDestroyDevice_]
  652. mov [rel D3DKMTDestroyDevice__], rax
  653. ;
  654. export ReleaseD3DKMTAdapter
  655. ReleaseD3DKMTAdapter:
  656. mov eax, dword [rel D3DKMT_OPENADAPTERFROMHDC_hAdapter]
  657. mov dword [rel D3DKMT_CLOSEADAPTER_hAdapter], eax
  658. lea rcx, [rel D3DKMT_CLOSEADAPTER]
  659. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCloseAdapter_]
  660. mov [rel D3DKMTCloseAdapter__], rax
  661. ;
  662. cmp dword [rel D3DKMTWaitForVerticalBlankEvent__], 0
  663. je FrameSyncComplete
  664. ;
  665. export UseEventFrameSync
  666. UseEventFrameSync:
  667. mov rcx, [rel CreateEventW__]
  668. mov rdx, 0xFFFFFFFF
  669. call [rel GetProcAddress_LoadLibrary_kernel32_dll_WaitForSingleObject_]
  670. mov [rel WaitForSingleObject__], rax
  671. ;
  672. export FrameSyncComplete
  673. FrameSyncComplete:
  674. ;
  675. mov rcx, [rel CreateWindowExW__]
  676. mov rdx, [rel GetDC__]
  677. call [rel GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_]
  678. mov [rel ReleaseDC__], rax
  679. test eax, eax
  680. je ShowMessageBox_DCDrawer
  681. ;
  682. mov r10d, dword [rel DEVMODEW_dmPelsWidth]
  683. mov r11d, dword [rel DEVMODEW_dmPelsHeight]
  684. xor rdx, rdx
  685. mov rax, [rel FramesDrawn]
  686. mov rbx, r10
  687. add rbx, r11
  688. div rbx
  689. ;
  690. ; 0, 0 ---> 0, r11 ---> r10, r11
  691. ; r10, r11 ---> r10, 0 ---> 0, 0
  692. cmp edx, r11d
  693. ja VariableExtendsHeight
  694. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x8], 0x00000000      ;0x8
  695. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0xC], edx         ;0xC
  696. mov r12d, r11d
  697. sub r12d, edx
  698. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x18], r10d       ;0x18
  699. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x1C], r12d       ;0x1C
  700. jmp VariableHeightWidthMoveComplete
  701. export VariableExtendsHeight
  702. VariableExtendsHeight:
  703. mov r12d, edx
  704. sub r12d, r11d
  705. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x8], r12d            ;0x8
  706. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0xC], r11d        ;0xC
  707. mov r13d, edx
  708. sub r13d, r11d
  709. mov r14d, r10d
  710. sub r14d, r13d
  711. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x18], r14d       ;0x18
  712. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x1C], 0x00000000 ;0x1C
  713. export VariableHeightWidthMoveComplete
  714. VariableHeightWidthMoveComplete:
  715. ;
  716. ; 0, r11 ---> r10, r11 ---> r10, 0
  717. ; r10, 0 ---> 0, 0 ---> 0, r11
  718. cmp edx, r10d
  719. ja VariableExtendsWidth
  720. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x10], edx         ;0x10
  721. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x14], r11d        ;0x14
  722. mov r12d, r10d
  723. sub r12d, edx
  724. mov dword [rel CreatePolygonRgn_POINT_DCDrawer], r12d       ;0x0
  725. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x4], 0x00000000 ;0x4
  726. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x20], r12d
  727. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x24], 0x00000000
  728. jmp VariableWidthHeightMoveComplete
  729. export VariableExtendsWidth
  730. VariableExtendsWidth:
  731. mov r12d, edx
  732. sub r12d, r10d
  733. mov r13d, r11d
  734. sub r13d, r12d
  735. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x10], r10d        ;0x10
  736. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x14], r13d        ;0x14
  737. mov r13d, edx
  738. sub r13d, r10d
  739. mov dword [rel CreatePolygonRgn_POINT_DCDrawer], 0x00000000 ;0x0
  740. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x4], r13d       ;0x4
  741. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x20], 0x00000000
  742. mov dword [rel CreatePolygonRgn_POINT_DCDrawer+0x24], r13d
  743. export VariableWidthHeightMoveComplete
  744. VariableWidthHeightMoveComplete:
  745. ;
  746. mov rbx, qword [rel HeapAlloc__]
  747. mov dword [rbx], 0x20
  748. mov dword [rbx+0x4], 1
  749. mov dword [rbx+0x8], 0 ; Count of rectangles
  750. mov dword [rbx+0xC], 0 ; Buffer size for rectangles
  751. mov dword [rbx+0x10], 0 ; left
  752. mov dword [rbx+0x14], 0 ; top
  753. mov eax, dword [rel DEVMODEW_dmPelsWidth]
  754. mov dword [rbx+0x18], eax ; right
  755. mov eax, dword [rel DEVMODEW_dmPelsHeight]
  756. mov dword [rbx+0x1C], eax ; bottom
  757. ;
  758. xor rcx, rcx ; size
  759. xor rsi, rsi ; current y
  760. xor rdi, rdi ; '...'
  761. xor r14, r14  ; x value
  762. xor r15, r15
  763. ; 1 - found x in row
  764. ; 4 and 2 - line counter for polygon, current limit - 4 lines
  765. ; 8 - 0: process top line for pixel, 1: process bottom line
  766. ; 16 - 0: find lower x, 1: find higher x
  767. ;
  768. export RegionCreater_RGNDATACreated
  769. RegionCreater_RGNDATACreated:
  770. mov rax, r15
  771. and rax, 6
  772. shr rax, 1
  773. lea r12, [rel CreatePolygonRgn_POINT_DCDrawer]
  774. ;
  775. mov r8d, dword [r12+8*rax+0x4] ; y1
  776. mov r9d, dword [r12+8*rax+0xC] ; y2
  777. mov r10d, dword [r12+8*rax]    ; x1
  778. mov r11d, dword [r12+8*rax+0x8]; x2
  779. cmp r8d, r9d
  780. jl RegionCreater_VerticalSortComplete
  781. je RegionCreater_LineInRangeCheckComplete
  782. xchg r8d, r9d
  783. xchg r10d, r11d
  784. export RegionCreater_VerticalSortComplete
  785. RegionCreater_VerticalSortComplete:
  786. ; r8d <= r12d <= r9d
  787. mov edi, esi
  788. test r15, 8
  789. jz RegionCreater_PixelTopOrBottomLineResolved
  790. inc edi
  791. export RegionCreater_PixelTopOrBottomLineResolved
  792. RegionCreater_PixelTopOrBottomLineResolved:
  793. ;
  794. cmp r8d, edi
  795. jg RegionCreater_LineInRangeCheckComplete
  796. cmp edi, r9d
  797. jg RegionCreater_LineInRangeCheckComplete
  798. ;
  799. ; x*(y2-y1) = x2*(y-y1) + x1*(y2-y)
  800. mov eax, edi
  801. sub eax, r8d
  802. imul r11d
  803. mov r12d, edx
  804. mov r13d, eax
  805. mov eax, r9d
  806. sub eax, edi
  807. imul r10d
  808. add eax, r13d
  809. adc edx, r12d
  810. mov r12d, r9d
  811. sub r12d, r8d
  812. idiv r12d
  813. ; idiv op gives signed remainder at rdx
  814. cmp edx, 0
  815. jge RegionCreater_LoweringCorrectionWithRemainderComplete
  816. test r15, 16
  817. jne RegionCreater_LoweringCorrectionWithRemainderComplete
  818. dec eax
  819. jmp RegionCreater_HigheringCorrectionWithRemainderComplete
  820. export RegionCreater_LoweringCorrectionWithRemainderComplete
  821. RegionCreater_LoweringCorrectionWithRemainderComplete:
  822. ;
  823. je RegionCreater_HigheringCorrectionWithRemainderComplete
  824. test r15, 16
  825. je RegionCreater_HigheringCorrectionWithRemainderComplete
  826. inc eax
  827. export RegionCreater_HigheringCorrectionWithRemainderComplete
  828. RegionCreater_HigheringCorrectionWithRemainderComplete:
  829. ;
  830. test r15, 1
  831. je RegionCreater_FoundX
  832. cmp eax, r14d
  833. jge RegionCreater_NeedLowerXChecked
  834. test r15, 16
  835. je RegionCreater_FoundX
  836. jmp RegionCreater_XIsSet
  837. export RegionCreater_NeedLowerXChecked
  838. RegionCreater_NeedLowerXChecked:
  839. je RegionCreater_XIsSet
  840. test r15, 16
  841. je RegionCreater_XIsSet
  842. ;
  843. export RegionCreater_FoundX
  844. RegionCreater_FoundX:
  845. mov r14d, eax
  846. export RegionCreater_XIsSet
  847. RegionCreater_XIsSet:
  848. or r15, 1
  849. ;
  850. export RegionCreater_LineInRangeCheckComplete
  851. RegionCreater_LineInRangeCheckComplete:
  852. ;
  853. mov rax, r15
  854. and rax, 6
  855. shr rax, 1
  856. inc rax
  857. and rax, 3
  858. shl rax, 1
  859. and r15, 0xFFFFFFFFFFFFFFF9
  860. or r15, rax
  861. test rax, rax
  862. jne RegionCreater_RGNDATACreated
  863. ;
  864. test r15, 8 ;top/bottom
  865. jnz RegionCreater_TopBottomProcessed
  866. xor r15, 8
  867. jmp RegionCreater_RGNDATACreated
  868. export RegionCreater_TopBottomProcessed
  869. RegionCreater_TopBottomProcessed:
  870. xor r15, 8
  871. ;
  872. test r15, 1
  873. jz RegionCreater_RowProcessed
  874. test r15, 16
  875. jnz RegionCreater_LowXSet
  876. mov dword [rbx+rcx+0x20], r14d ;left
  877. xor r15, 16
  878. jmp RegionCreater_RGNDATACreated
  879. export RegionCreater_LowXSet
  880. RegionCreater_LowXSet:
  881. ;
  882. xor r15, 16
  883. mov dword [rbx+rcx+0x24], esi ;top
  884. mov dword [rbx+rcx+0x28], r14d ;right
  885. mov eax, esi
  886. inc eax
  887. mov dword [rbx+rcx+0x2C], eax ;bottom
  888. add ecx, 0x10
  889. mov dword [rbx+0xC], ecx ; Buffer size for rectangles
  890. shr ecx, 4
  891. mov dword [rbx+0x8], ecx ; Count of rectangles
  892. shl ecx, 4
  893. xor r14, r14
  894. xor r15, 1
  895. ;
  896. export RegionCreater_RowProcessed
  897. RegionCreater_RowProcessed:
  898. inc esi
  899. cmp esi, dword [rel DEVMODEW_dmPelsHeight]
  900. jne RegionCreater_RGNDATACreated
  901. ;
  902. ;lea edx, [ecx+0x20]
  903. ;xor rcx, rcx
  904. ;mov r8, qword [rel HeapAlloc__]
  905. ;call [rel GetProcAddress_LoadLibrary_Gdi32_dll_ExtCreateRegion_]
  906. ;mov [rel HRGN_DCDrawer], rax
  907. ;
  908. xor eax, eax
  909. mov eax, dword [rel DEVMODEW_dmPelsWidth]
  910. xor edx, edx
  911. mov edx, dword [rel DEVMODEW_dmPelsHeight]
  912. mul rdx
  913. test rdx, rdx
  914. jnz DisplayMemoryFailure
  915. mov rbx, rax
  916. mov rax, 0xC000000000000000
  917. test rbx, rax
  918. jnz DisplayMemoryFailure
  919. mov rax, rbx
  920. shl rax, 2
  921. cmp rax, [rel MEMORY_BASIC_INFORMATION_RegionSize]
  922. jbe DisplayMemoryVerifiedSize
  923. export DisplayMemoryFailure
  924. DisplayMemoryFailure:
  925. lea rdx, [rel guimessage_DisplayMemoryInconsistentSize]
  926. lea r8, [rel guititle_Error]
  927. jmp ShowMessageBoxWithCustomText_DCDrawer
  928. ;
  929. export DisplayMemoryVerifiedSize
  930. DisplayMemoryVerifiedSize:
  931. mov r8, qword [rel HeapAlloc__]
  932. mov rbx, [rel CreateDIBSection_ppvBits]
  933. mov r9d, dword [r8 + 0xC]
  934. lea r9, [r8 + r9 + 0x20]
  935. lea r8, [r8 + 0x20]
  936. cmp r9, r8
  937. je Renderer_BitmapDrawn
  938. export Renderer_NewRectangleReady
  939. Renderer_NewRectangleReady:
  940. ;
  941. mov eax, dword [r8+0x4]
  942. cmp eax, 0
  943. jl Renderer_LineDrawn
  944. cmp eax, dword [rel DEVMODEW_dmPelsHeight]
  945. jge Renderer_LineDrawn
  946. mov ecx, dword [rel DEVMODEW_dmPelsHeight]
  947. sub ecx, eax
  948. mov eax, ecx
  949. dec eax
  950. mov edx, dword [rel DEVMODEW_dmPelsWidth]
  951. mul edx
  952. shl eax, 2
  953. lea rdi, [rbx+rax]
  954. mov r10d, dword [r8]
  955. mov r11d, dword [r8+0x8]
  956. cmp r10d, 0
  957. jge Renderer_LowerXInLowerLimit
  958. mov r10d, 0
  959. export Renderer_LowerXInLowerLimit
  960. Renderer_LowerXInLowerLimit:
  961. cmp r10d, dword [rel DEVMODEW_dmPelsWidth]
  962. jle Renderer_LowerXInHigherLimit
  963. mov r10d, dword [rel DEVMODEW_dmPelsWidth]
  964. export Renderer_LowerXInHigherLimit
  965. Renderer_LowerXInHigherLimit:
  966. cmp r11d, 0
  967. jge Renderer_HigherXInLowerLimit
  968. mov r11d, 0
  969. export Renderer_HigherXInLowerLimit
  970. Renderer_HigherXInLowerLimit:
  971. cmp r11d, dword [rel DEVMODEW_dmPelsWidth]
  972. jle Renderer_HigherXInHigherLimit
  973. mov r11d, dword [rel DEVMODEW_dmPelsWidth]
  974. export Renderer_HigherXInHigherLimit
  975. Renderer_HigherXInHigherLimit:
  976. cmp r11d, r10d
  977. jnb Renderer_XBoundariesAreOrdered
  978. mov r11d, r10d
  979. export Renderer_XBoundariesAreOrdered
  980. Renderer_XBoundariesAreOrdered:
  981. mov ecx, r10d
  982. mov eax, 0x00000000
  983. rep stosd
  984. mov ecx, r11d
  985. sub ecx, r10d
  986. mov eax, 0xFF000000
  987. rep stosd
  988. mov ecx, dword [rel DEVMODEW_dmPelsWidth]
  989. sub ecx, r11d
  990. mov eax, 0x00000000
  991. rep stosd
  992. export Renderer_LineDrawn
  993. Renderer_LineDrawn:
  994. add r8, 0x10
  995. cmp r9, r8
  996. jne Renderer_NewRectangleReady
  997. export Renderer_BitmapDrawn
  998. Renderer_BitmapDrawn:
  999. ;
  1000. xor r15, r15
  1001. ; 2 and 1 - line counter for polygon, current limit - 4 lines
  1002. ; 4 - 0: scan vertical edge of pixel; 1: horizontal edge
  1003. ; 8 - 0: line crosses parallel edges of pixel; 1: perpendicular edges
  1004. ; 16 - 0: x increases; 1: x decreases
  1005. ; 32 - 0: y increases; 1: y decreases
  1006. ; 64 - 0: value matches integral over x axis; 1: one minus integral
  1007. export SemitransparentEdge_ScanLine
  1008. SemitransparentEdge_ScanLine:
  1009. mov rax, r15
  1010. and rax, 3
  1011. lea r12, [rel CreatePolygonRgn_POINT_DCDrawer]
  1012. mov r8d, dword [r12+8*rax+0x4] ; y1
  1013. mov r9d, dword [r12+8*rax+0xC] ; y2
  1014. mov r10d, dword [r12+8*rax]    ; x1
  1015. mov r11d, dword [r12+8*rax+0x8]; x2
  1016. mov esi, r10d ; current x
  1017. mov edi, r8d ; current y
  1018. xor r13d, r13d ; rx
  1019. xor r14d, r14d ; ry
  1020. ;
  1021. cmp r11d, r10d
  1022. je SemitransparentEdge_LineDrawn
  1023. jg SemitransparentEdge_XDirectionSet
  1024. or r15, 16
  1025. export SemitransparentEdge_XDirectionSet
  1026. SemitransparentEdge_XDirectionSet:
  1027. ;
  1028. cmp r9d, r8d
  1029. je SemitransparentEdge_LineDrawn
  1030. jg SemitransparentEdge_YDirectionSet
  1031. or r15, 32
  1032. export SemitransparentEdge_YDirectionSet
  1033. SemitransparentEdge_YDirectionSet:
  1034. ;
  1035. mov rax, r15
  1036. inc rax
  1037. and rax, 3
  1038. mov eax, dword [r12+8*rax+0x8] ; xi
  1039. sub eax, r10d
  1040. mov rdx, r15
  1041. inc rdx
  1042. and rdx, 3
  1043. mov edx, dword [r12+8*rdx+0xC] ; yi
  1044. neg edx
  1045. add edx, r9d
  1046. imul edx
  1047. mov ebx, eax
  1048. mov ecx, edx
  1049. mov rax, r15
  1050. inc rax
  1051. and rax, 3
  1052. mov eax, dword [r12+8*rax+0x8] ; xi
  1053. sub eax, r11d
  1054. mov rdx, r15
  1055. inc rdx
  1056. and rdx, 3
  1057. mov edx, dword [r12+8*rdx+0xC] ; yi
  1058. sub edx, r8d
  1059. imul edx
  1060. add eax, ebx
  1061. adc edx, ecx
  1062. cmp edx, 0
  1063. jge SemitransparentEdge_IntegralDirectionSet
  1064. or r15, 64
  1065. export SemitransparentEdge_IntegralDirectionSet
  1066. SemitransparentEdge_IntegralDirectionSet:
  1067. ;
  1068. mov edx, r9d
  1069. sub edx, r8d
  1070. test r15, 32
  1071. je SemitransparentEdge_YDirectionCorrectionCompleteAt2xy
  1072. neg edx
  1073. export SemitransparentEdge_YDirectionCorrectionCompleteAt2xy
  1074. SemitransparentEdge_YDirectionCorrectionCompleteAt2xy:
  1075.  
  1076. mov eax, r11d
  1077. sub eax, r10d
  1078. test r15, 16
  1079. je SemitransparentEdge_XDirectionCorrectionCompleteAt2xy
  1080. neg eax
  1081. export SemitransparentEdge_XDirectionCorrectionCompleteAt2xy
  1082. SemitransparentEdge_XDirectionCorrectionCompleteAt2xy:
  1083. ;
  1084. mul edx
  1085. rol rdx, 32
  1086. or rdx, rax
  1087. shl rdx, 1
  1088. mov rcx, rdx ;2xy
  1089. ;
  1090. export SemitransparentEdge_ScanPixel
  1091. SemitransparentEdge_ScanPixel:
  1092. test r15, 4
  1093. jne SemitransparentEdge_VerticalEdgeScanComplete
  1094. mov eax, r9d
  1095. sub eax, r8d
  1096. ;
  1097. test r15, 32
  1098. je SemitransparentEdge_YDirectionCorrectionCompleteAtVerticalEdge
  1099. neg eax
  1100. export SemitransparentEdge_YDirectionCorrectionCompleteAtVerticalEdge
  1101. SemitransparentEdge_YDirectionCorrectionCompleteAtVerticalEdge:
  1102. ;
  1103. add eax, r14d
  1104. mov ebx, r11d
  1105. sub ebx, r10d
  1106. ;
  1107. test r15, 16
  1108. je SemitransparentEdge_XDirectionCorrectionCompleteAtVerticalEdge
  1109. neg ebx
  1110. export SemitransparentEdge_XDirectionCorrectionCompleteAtVerticalEdge
  1111. SemitransparentEdge_XDirectionCorrectionCompleteAtVerticalEdge:
  1112. ;
  1113. cmp eax, ebx
  1114. jle SemitransparentEdge_VerifyVerticalEdgeDirectionComplete
  1115. xor r15, 4
  1116. or r15, 8
  1117. jmp SemitransparentEdge_ScanPixel
  1118. export SemitransparentEdge_VerifyVerticalEdgeDirectionComplete
  1119. SemitransparentEdge_VerifyVerticalEdgeDirectionComplete:
  1120. ;
  1121. test r15, 8
  1122. jne SemitransparentEdge_ParalelCalculationComplete
  1123. add eax, r14d
  1124. mov ebx, eax
  1125. shl eax, 8
  1126. sub eax, ebx
  1127. mov ebx, r11d
  1128. sub ebx, r10d
  1129. ;
  1130. test r15, 16
  1131. je SemitransparentEdge_XDirectionCorrectionCompleteAtVerticalEdgeDividend
  1132. neg ebx
  1133. export SemitransparentEdge_XDirectionCorrectionCompleteAtVerticalEdgeDividend
  1134. SemitransparentEdge_XDirectionCorrectionCompleteAtVerticalEdgeDividend:
  1135. ;
  1136. shl ebx, 1
  1137. xor edx, edx
  1138. div ebx
  1139. jmp SemitransparentEdge_PerpendicularCalculationComplete
  1140. export SemitransparentEdge_VerticalEdgeScanComplete
  1141. SemitransparentEdge_VerticalEdgeScanComplete:
  1142. ;
  1143. mov eax, r11d
  1144. sub eax, r10d
  1145. ;
  1146. test r15, 16
  1147. je SemitransparentEdge_XDirectionCorrectionCompleteAtHorizontalEdge
  1148. neg eax
  1149. export SemitransparentEdge_XDirectionCorrectionCompleteAtHorizontalEdge
  1150. SemitransparentEdge_XDirectionCorrectionCompleteAtHorizontalEdge:
  1151. ;
  1152. add eax, r13d
  1153. mov ebx, r9d
  1154. sub ebx, r8d
  1155. ;
  1156. test r15, 32
  1157. je SemitransparentEdge_YDirectionCorrectionCompleteAtHorizontalEdge
  1158. neg ebx
  1159. export SemitransparentEdge_YDirectionCorrectionCompleteAtHorizontalEdge
  1160. SemitransparentEdge_YDirectionCorrectionCompleteAtHorizontalEdge:
  1161. ;
  1162. cmp eax, ebx
  1163. jle SemitransparentEdge_VerifyHorizontalEdgeDirectionComplete
  1164. xor r15, 4
  1165. or r15, 8
  1166. jmp SemitransparentEdge_ScanPixel
  1167. export SemitransparentEdge_VerifyHorizontalEdgeDirectionComplete
  1168. SemitransparentEdge_VerifyHorizontalEdgeDirectionComplete:
  1169. ;
  1170. test r15, 8
  1171. jne SemitransparentEdge_ParalelCalculationComplete
  1172. add eax, r13d
  1173. mov ebx, eax
  1174. shl eax, 8
  1175. sub eax, ebx
  1176. mov ebx, r9d
  1177. sub ebx, r8d
  1178. ;
  1179. test r15, 32
  1180. je SemitransparentEdge_YDirectionCorrectionCompleteAtHorizontalEdgeDividend
  1181. neg ebx
  1182. export SemitransparentEdge_YDirectionCorrectionCompleteAtHorizontalEdgeDividend
  1183. SemitransparentEdge_YDirectionCorrectionCompleteAtHorizontalEdgeDividend:
  1184. ;
  1185. shl ebx, 1
  1186. xor edx, edx
  1187. div ebx
  1188. jmp SemitransparentEdge_PerpendicularCalculationComplete
  1189. export SemitransparentEdge_ParalelCalculationComplete
  1190. SemitransparentEdge_ParalelCalculationComplete:
  1191. ;
  1192. mul eax
  1193. rol rdx, 32
  1194. or rax, rdx
  1195. mov rbx, rax
  1196. shl rax, 8
  1197. sub rax, rbx
  1198. mov rbx, rcx
  1199. xor rdx, rdx
  1200. div rbx
  1201. export SemitransparentEdge_PerpendicularCalculationComplete
  1202. SemitransparentEdge_PerpendicularCalculationComplete:
  1203. ;
  1204. test r15b, 116
  1205. jp SemitransparentEdge_IntegralDirectionCorrectionDone
  1206. ;jump if following is false
  1207. ; (r15b & 4 == 4)^(r15b & 16 == 16)^(r15b & 32 == 32)^(r15b & 64 == 64)
  1208. neg eax
  1209. add eax, 0xFF
  1210. cmp rdx, 0
  1211. je SemitransparentEdge_IntegralDirectionCorrectionDone
  1212. dec eax
  1213. neg rdx
  1214. add rdx, rbx
  1215. export SemitransparentEdge_IntegralDirectionCorrectionDone
  1216. SemitransparentEdge_IntegralDirectionCorrectionDone:
  1217. ;
  1218. shr rbx, 1
  1219. cmp rdx, rbx
  1220. jb SemitransparentEdge_RoundingByRemaiderComplete
  1221. inc eax
  1222. export SemitransparentEdge_RoundingByRemaiderComplete
  1223. SemitransparentEdge_RoundingByRemaiderComplete:
  1224. ;
  1225. test r15, 16
  1226. je SemitransparentEdge_BackwardXDirectionRangeCheckComplete
  1227. cmp esi, 0
  1228. jle SemitransparentEdge_PixelDrawn
  1229. cmp esi, dword [rel DEVMODEW_dmPelsWidth]
  1230. jg SemitransparentEdge_PixelDrawn
  1231. jmp SemitransparentEdge_FowardXDirectionRangeCheckComplete
  1232. export SemitransparentEdge_BackwardXDirectionRangeCheckComplete
  1233. SemitransparentEdge_BackwardXDirectionRangeCheckComplete:
  1234. ;
  1235. cmp esi, 0
  1236. jl SemitransparentEdge_PixelDrawn
  1237. cmp esi, dword [rel DEVMODEW_dmPelsWidth]
  1238. jge SemitransparentEdge_PixelDrawn
  1239. export SemitransparentEdge_FowardXDirectionRangeCheckComplete
  1240. SemitransparentEdge_FowardXDirectionRangeCheckComplete:
  1241. ;
  1242. test r15, 32
  1243. je SemitransparentEdge_BackwardYDirectionRangeCheckComplete
  1244. cmp edi, 0
  1245. jle SemitransparentEdge_PixelDrawn
  1246. cmp edi, dword [rel DEVMODEW_dmPelsHeight]
  1247. jg SemitransparentEdge_PixelDrawn
  1248. jmp SemitransparentEdge_FowardYDirectionRangeCheckComplete
  1249. export SemitransparentEdge_BackwardYDirectionRangeCheckComplete
  1250. SemitransparentEdge_BackwardYDirectionRangeCheckComplete:
  1251. ;
  1252. cmp edi, 0
  1253. jl SemitransparentEdge_PixelDrawn
  1254. cmp edi, dword [rel DEVMODEW_dmPelsHeight]
  1255. jge SemitransparentEdge_PixelDrawn
  1256. export SemitransparentEdge_FowardYDirectionRangeCheckComplete
  1257. SemitransparentEdge_FowardYDirectionRangeCheckComplete:
  1258. ;
  1259. mov ebx, eax
  1260. mov eax, dword [rel DEVMODEW_dmPelsHeight]
  1261. sub eax, edi
  1262. test r15, 32
  1263. je SemitransparentEdge_YDirectionCorrectionCompleteAtPixelAddress
  1264. inc eax
  1265. export SemitransparentEdge_YDirectionCorrectionCompleteAtPixelAddress
  1266. SemitransparentEdge_YDirectionCorrectionCompleteAtPixelAddress:
  1267. dec eax
  1268. mov edx, dword [rel DEVMODEW_dmPelsWidth]
  1269. mul edx
  1270. test r15, 16
  1271. je SemitransparentEdge_BackwardsXDirectionCorrectionCompleteAtPixelAddress
  1272. dec esi
  1273. add eax, esi
  1274. adc edx, 0
  1275. inc esi
  1276. jmp SemitransparentEdge_FowardXDirectionCorrectionCompleteAtPixelAddress
  1277. export SemitransparentEdge_BackwardsXDirectionCorrectionCompleteAtPixelAddress
  1278. SemitransparentEdge_BackwardsXDirectionCorrectionCompleteAtPixelAddress:
  1279. add eax, esi
  1280. adc edx, 0
  1281. export SemitransparentEdge_FowardXDirectionCorrectionCompleteAtPixelAddress
  1282. SemitransparentEdge_FowardXDirectionCorrectionCompleteAtPixelAddress:
  1283. rol rdx, 32
  1284. or rax, rdx
  1285. shl rax, 2
  1286. mov rdx, [rel CreateDIBSection_ppvBits]
  1287. and ebx, 0xFF
  1288. shl ebx, 24
  1289. mov dword [rdx+rax], ebx
  1290. export SemitransparentEdge_PixelDrawn
  1291. SemitransparentEdge_PixelDrawn:
  1292. ;
  1293. mov rax, 0xFFFFFFFFFFFFFFF7
  1294. and r15, rax
  1295. test r15, 4
  1296. jne SemitransparentEdge_NextVerticalEdgePixelSelected
  1297. mov eax, r9d
  1298. sub eax, r8d
  1299. test r15, 32
  1300. je SemitransparentEdge_YDirectionCorrectionCompleteAtEdgeIterator
  1301. neg eax
  1302. export SemitransparentEdge_YDirectionCorrectionCompleteAtEdgeIterator
  1303. SemitransparentEdge_YDirectionCorrectionCompleteAtEdgeIterator:
  1304. sub r13d, eax
  1305. add r14d, eax
  1306. test r15, 16
  1307. je SemitransparentEdge_BackwardsXDirectionIteration
  1308. dec esi
  1309. jmp SemitransparentEdge_FowardXDirectionIteration
  1310. export SemitransparentEdge_BackwardsXDirectionIteration
  1311. SemitransparentEdge_BackwardsXDirectionIteration:
  1312. inc esi
  1313. export SemitransparentEdge_FowardXDirectionIteration
  1314. SemitransparentEdge_FowardXDirectionIteration:
  1315. cmp esi, r11d
  1316. jne SemitransparentEdge_ScanPixel
  1317. jmp SemitransparentEdge_NextHorizontalEdgePixelSelected
  1318. export SemitransparentEdge_NextVerticalEdgePixelSelected
  1319. SemitransparentEdge_NextVerticalEdgePixelSelected:
  1320. ;
  1321. mov eax, r11d
  1322. sub eax, r10d
  1323. test r15, 16
  1324. je SemitransparentEdge_XDirectionCorrectionCompleteAtEdgeIterator
  1325. neg eax
  1326. export SemitransparentEdge_XDirectionCorrectionCompleteAtEdgeIterator
  1327. SemitransparentEdge_XDirectionCorrectionCompleteAtEdgeIterator:
  1328. add r13d, eax
  1329. sub r14d, eax
  1330. test r15, 32
  1331. je SemitransparentEdge_BackwardsYDirectionIteration
  1332. dec edi
  1333. jmp SemitransparentEdge_FowardYDirectionIteration
  1334. export SemitransparentEdge_BackwardsYDirectionIteration
  1335. SemitransparentEdge_BackwardsYDirectionIteration:
  1336. inc edi
  1337. export SemitransparentEdge_FowardYDirectionIteration
  1338. SemitransparentEdge_FowardYDirectionIteration:
  1339. cmp edi, r9d
  1340. jne SemitransparentEdge_ScanPixel
  1341. export SemitransparentEdge_NextHorizontalEdgePixelSelected
  1342. SemitransparentEdge_NextHorizontalEdgePixelSelected:
  1343. ;
  1344. export SemitransparentEdge_LineDrawn
  1345. SemitransparentEdge_LineDrawn:
  1346. and r15, 3
  1347. inc r15
  1348. and r15, 3
  1349. test r15, r15
  1350. jne SemitransparentEdge_ScanLine
  1351. ;
  1352. xor rcx, rcx
  1353. call [rel GetProcAddress_LoadLibrary_user32_dll_GetDC_]
  1354. mov [rel GetDC_0_], rax
  1355. test rax, rax
  1356. je ShowMessageBox_DCDrawer
  1357. ;
  1358. mov rcx, [rel CreateWindowExW__]
  1359. mov rdx, [rel GetDC_0_]
  1360. lea r8, [rel UpdateLayeredWindow_pptDst]
  1361. mov eax, dword [rel DEVMODEW_dmPelsWidth]
  1362. mov dword [rel UpdateLayeredWindow_psize], eax
  1363. mov eax, dword [rel DEVMODEW_dmPelsHeight]
  1364. mov dword [rel UpdateLayeredWindow_psize+0x4], eax
  1365. lea r9, [rel UpdateLayeredWindow_psize]
  1366. mov rax, [rel CreateCompatibleDC__]
  1367. mov qword [rsp+0x20], rax
  1368. lea rax, [rel UpdateLayeredWindow_pptSrc]
  1369. mov qword [rsp+0x28], rax
  1370. mov dword [rsp+0x30], 0
  1371. lea rax, [rel BLENDFUNCTION]
  1372. mov qword [rsp+0x38], rax
  1373. mov dword [rsp+0x40], 2
  1374. call [rel GetProcAddress_LoadLibrary_user32_dll_UpdateLayeredWindow_]
  1375. mov [rel UpdateLayeredWindow__], rax
  1376. test eax, eax
  1377. je ShowMessageBox_DCDrawer
  1378. ;
  1379. ;mov rcx, [rel CreateWindowExW__]
  1380. ;call [rel GetProcAddress_LoadLibrary_user32_dll_GetDC_]
  1381. ;mov [rel GetDC__], rax
  1382. ;test rax, rax
  1383. ;je ShowMessageBox_DCDrawer
  1384. ;
  1385. ;mov rcx, [rel GetDC__]
  1386. ;xor rdx, rdx
  1387. ;xor r8, r8
  1388. ;mov eax, dword [rel DEVMODEW_dmPelsWidth]
  1389. ;mov r9d, eax
  1390. ;mov eax, dword [rel DEVMODEW_dmPelsHeight]
  1391. ;mov dword [rsp+0x20], eax
  1392. ;mov rax, [rel CreateCompatibleDC__]
  1393. ;mov qword [rsp+0x28], rax
  1394. ;mov qword [rsp+0x30], 0
  1395. ;mov qword [rsp+0x38], 0
  1396. ;mov qword [rsp+0x40], 0x0000000000CC0020
  1397. ;call [rel GetProcAddress_LoadLibrary_Gdi32_dll_BitBlt_]
  1398. ;mov [rel BitBlt__], rax
  1399. ;test eax, eax
  1400. ;je ShowMessageBox_DCDrawer
  1401. ;
  1402. ;mov rcx, [rel CreateWindowExW__]
  1403. ;mov rdx, [rel GetDC__]
  1404. ;call [rel GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_]
  1405. ;mov [rel ReleaseDC__], rax
  1406. ;test eax, eax
  1407. ;je ShowMessageBox_DCDrawer
  1408. ;
  1409. xor rcx, rcx
  1410. mov rdx, [rel GetDC_0_]
  1411. call [rel GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_]
  1412. mov [rel ReleaseDC__], rax
  1413. test eax, eax
  1414. je ShowMessageBox_DCDrawer
  1415. ;
  1416. mov rcx, [rel CreateWindowExW__]
  1417. xor rdx, rdx
  1418. call [rel GetProcAddress_LoadLibrary_user32_dll_ValidateRect_]
  1419. mov [rel ValidateRect__], rax
  1420. test eax, eax
  1421. je ShowMessageBox_DCDrawer
  1422. ;
  1423. call [rel GetProcAddress_LoadLibrary_Gdi32_dll_GdiFlush_]
  1424. inc qword [rel FramesDrawn]
  1425. jmp SetFrame
  1426. ;
  1427. export ShowMessageBox_DCDrawer
  1428. ShowMessageBox_DCDrawer:
  1429. lea rdx, [rel guimessage]
  1430. lea r8, [rel guititle]
  1431. export ShowMessageBoxWithCustomText_DCDrawer
  1432. ShowMessageBoxWithCustomText_DCDrawer:
  1433. xor rcx, rcx
  1434. xor r9, r9
  1435. call [rel GetProcAddress_LoadLibrary_user32_dll_MessageBoxA_]
  1436. xor rax, rax
  1437. add rsp, 0x78
  1438. ret
  1439.  
  1440.  
  1441. section .data use64 align=16
  1442.  
  1443. export user32_dll_0
  1444. export MessageBoxA_0
  1445. export guititle
  1446. export guimessage
  1447. user32_dll_0 db "user32.dll",0
  1448. MessageBoxA_0 db "MessageBoxA",0
  1449. guititle db "This is an example title",0
  1450. guimessage db "This is an example message! ",0
  1451. export kernel32_dll_0
  1452. export CreateFileMappingW_0
  1453. export Gdi32_dll_0
  1454. export CreateCompatibleDC_0
  1455. kernel32_dll_0 db "kernel32.dll",0
  1456. CreateFileMappingW_0 db "CreateFileMappingW",0
  1457. Gdi32_dll_0 db "Gdi32.dll",0
  1458. CreateCompatibleDC_0 db "CreateCompatibleDC",0
  1459. export CreateDIBSection_0
  1460. export SelectObject_0
  1461. export CreateWindowExW_0
  1462. export GetModuleHandleA_0
  1463. CreateDIBSection_0 db "CreateDIBSection",0
  1464. SelectObject_0 db "SelectObject",0
  1465. CreateWindowExW_0 db "CreateWindowExW",0
  1466. GetModuleHandleA_0 db "GetModuleHandleA",0
  1467. export RegisterClassExW_0
  1468. export DefWindowProcW_0
  1469. export _0
  1470. export ShowWindow_0
  1471. export UpdateWindow_0
  1472. export GetMessageW_0
  1473. export TranslateMessage_0
  1474. export DispatchMessageW_0
  1475. RegisterClassExW_0 db "RegisterClassExW",0
  1476. DefWindowProcW_0 db "DefWindowProcW",0
  1477. align 8, db 0
  1478. _0 dq 32
  1479. ShowWindow_0 db "ShowWindow",0
  1480. UpdateWindow_0 db "UpdateWindow",0
  1481. GetMessageW_0 db "GetMessageW",0
  1482. TranslateMessage_0 db "TranslateMessage",0
  1483. DispatchMessageW_0 db "DispatchMessageW",0
  1484. export SetWindowLongPtrW_0
  1485. export SetWindowPos_0
  1486. SetWindowLongPtrW_0 db "SetWindowLongPtrW",0
  1487. SetWindowPos_0 db "SetWindowPos",0
  1488. export CreateThread_0
  1489. export GetDC_0
  1490. export GdiFlush_0
  1491. export BitBlt_0
  1492. export ValidateRect_0
  1493. export SetLayeredWindowAttributes_0
  1494. export IsWindowEnabled_0
  1495. export IsWindowVisible_0
  1496. CreateThread_0 db "CreateThread",0
  1497. GetDC_0 db "GetDC",0
  1498. GdiFlush_0 db "GdiFlush",0
  1499. BitBlt_0 db "BitBlt",0
  1500. ValidateRect_0 db "ValidateRect",0
  1501. SetLayeredWindowAttributes_0 db "SetLayeredWindowAttributes",0
  1502. IsWindowEnabled_0 db "IsWindowEnabled",0
  1503. IsWindowVisible_0 db "IsWindowVisible",0
  1504. export UpdateLayeredWindow_0
  1505. export GdiAlphaBlend_0
  1506. UpdateLayeredWindow_0 db "UpdateLayeredWindow",0
  1507. GdiAlphaBlend_0 db "GdiAlphaBlend",0
  1508. export CreatePolygonRgn_0
  1509. export CreatePolygonRgn_POINT
  1510. export ReleaseDC_0
  1511. export SetWindowRgn_0
  1512. CreatePolygonRgn_0 db "CreatePolygonRgn",0
  1513. align 4, db 0
  1514. CreatePolygonRgn_POINT dd 0,0,0,0,0,0,0,0,0,0
  1515. ;CreatePolygonRgn_POINT dd 0,0,0,1,1,1,1,0,0,0
  1516. ReleaseDC_0 db "ReleaseDC", 0
  1517. SetWindowRgn_0 db "SetWindowRgn",0
  1518. export LoadCursorW_0
  1519. export VirtualQuery_0
  1520. LoadCursorW_0 db "LoadCursorW",0
  1521. VirtualQuery_0 db "VirtualQuery",0
  1522. export CreateEventW_0
  1523. export SetEvent_0
  1524. export guimessage_Event
  1525. export guititle_Error
  1526. CreateEventW_0 db "CreateEventW",0
  1527. SetEvent_0 db "SetEvent",0
  1528. guimessage_Event db "Unfortunately, I was unable to use Windows event object\
  1529. to sync with your desktop frame rate.",0
  1530. guititle_Error db "Error!",0
  1531. export EnumDisplaySettingsW_0
  1532. export SetTimer_0
  1533. export WaitForSingleObject_0
  1534. EnumDisplaySettingsW_0 db "EnumDisplaySettingsW",0
  1535. SetTimer_0 db "SetTimer",0
  1536. WaitForSingleObject_0 db "WaitForSingleObject",0
  1537. export D3DKMTOpenAdapterFromHdc_0
  1538. export D3DKMTCreateDevice_0
  1539. export D3DKMTWaitForVerticalBlankEvent_0
  1540. export D3DKMTDestroyDevice_0
  1541. export D3DKMTCloseAdapter_0
  1542. D3DKMTOpenAdapterFromHdc_0 db "D3DKMTOpenAdapterFromHdc",0
  1543. D3DKMTCreateDevice_0 db "D3DKMTCreateDevice",0
  1544. D3DKMTWaitForVerticalBlankEvent_0 db "D3DKMTWaitForVerticalBlankEvent",0
  1545. D3DKMTDestroyDevice_0 db "D3DKMTDestroyDevice",0
  1546. D3DKMTCloseAdapter_0 db "D3DKMTCloseAdapter",0
  1547. export guimessage_DisplayMemory
  1548. guimessage_DisplayMemory db "Unfortunately, configured memory size for your \
  1549. display is too low.",0
  1550. export SetUnhandledExceptionFilter_0
  1551. export RaiseException_0
  1552. SetUnhandledExceptionFilter_0: db "SetUnhandledExceptionFilter",0
  1553. RaiseException_0: db "RaiseException",0
  1554. export HeapCreate_0
  1555. export HeapAlloc_0
  1556. export guimessage_Memory
  1557. HeapCreate_0: db "HeapCreate",0
  1558. HeapAlloc_0: db "HeapAlloc",0
  1559. guimessage_Memory: db "Unable to reserve free memory.",0
  1560. export ExtCreateRegion_0
  1561. ExtCreateRegion_0: db "ExtCreateRegion", 0
  1562. align 16, db 0
  1563. export FFFFFFFF
  1564. FFFFFFFF: dd -1, -1, -1, -1
  1565. export UpdateLayeredWindow_pptDst
  1566. export UpdateLayeredWindow_pptSrc
  1567. export BLENDFUNCTION
  1568. export BLENDFUNCTION_BlendOp
  1569. export BLENDFUNCTION_BlendFlags
  1570. export BLENDFUNCTION_SourceConstantAlpha
  1571. export BLENDFUNCTION_AlphaFormat
  1572. align 8, db 0
  1573. UpdateLayeredWindow_pptDst: dd 0, 0
  1574. UpdateLayeredWindow_pptSrc: dd 0, 0
  1575. BLENDFUNCTION
  1576. BLENDFUNCTION_BlendOp: db 0
  1577. BLENDFUNCTION_BlendFlags: db 0
  1578. BLENDFUNCTION_SourceConstantAlpha: db 255
  1579. BLENDFUNCTION_AlphaFormat: db 1
  1580. align 16, db 0
  1581. export __FFFFFF
  1582. export FF000000
  1583. __FFFFFF: dd 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF
  1584. FF000000: dd 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000
  1585. export guimessage_DisplayMemoryInconsistentSize
  1586. guimessage_DisplayMemoryInconsistentSize: db "Operating system returned disp\
  1587. lay memory size that does not add up with manual calculations",0
  1588.  
  1589.  
  1590. section .bss use64 align=16
  1591.  
  1592. export LoadLibrary_user32_dll_
  1593. export GetProcAddress_LoadLibrary_user32_dll_MessageBoxA_
  1594. LoadLibrary_user32_dll_: resq 1
  1595. GetProcAddress_LoadLibrary_user32_dll_MessageBoxA_: resq 1
  1596. export LoadLibrary_kernel32_dll_
  1597. export GetProcAddress_LoadLibrary_kernel32_dll_CreateFileMappingW_
  1598. export CreateFileMappingW__
  1599. export LoadLibrary_Gdi32_dll_
  1600. export GetProcAddress_LoadLibrary_Gdi32_dll_CreateCompatibleDC_
  1601. export CreateCompatibleDC__
  1602. LoadLibrary_kernel32_dll_: resq 1
  1603. GetProcAddress_LoadLibrary_kernel32_dll_CreateFileMappingW_: resq 1
  1604. CreateFileMappingW__: resq 1
  1605. LoadLibrary_Gdi32_dll_: resq 1
  1606. GetProcAddress_LoadLibrary_Gdi32_dll_CreateCompatibleDC_: resq 1
  1607. CreateCompatibleDC__: resq 1
  1608. export CreateDIBSection_ppvBits
  1609. export GetProcAddress_LoadLibrary_Gdi32_dll_CreateDIBSection_
  1610. export CreateDIBSection__
  1611. export GetProcAddress_LoadLibrary_Gdi32_dll_SelectObject_
  1612. export SelectObject__
  1613. CreateDIBSection_ppvBits: resq 1
  1614. GetProcAddress_LoadLibrary_Gdi32_dll_CreateDIBSection_: resq 1
  1615. CreateDIBSection__: resq 1
  1616. GetProcAddress_LoadLibrary_Gdi32_dll_SelectObject_: resq 1
  1617. SelectObject__: resq 1
  1618. export GetProcAddress_LoadLibrary_user32_dll_CreateWindowExW_
  1619. export CreateWindowExW__
  1620. GetProcAddress_LoadLibrary_user32_dll_CreateWindowExW_: resq 1
  1621. CreateWindowExW__: resq 1
  1622. export GetProcAddress_LoadLibrary_kernel32_dll_GetModuleHandleA_
  1623. export GetModuleHandleA__
  1624. GetProcAddress_LoadLibrary_kernel32_dll_GetModuleHandleA_: resq 1
  1625. GetModuleHandleA__: resq 1
  1626. export GetProcAddress_LoadLibrary_user32_dll_RegisterClassExW_
  1627. GetProcAddress_LoadLibrary_user32_dll_RegisterClassExW_: resq 1
  1628. export WNDCLASSEX
  1629. export WNDCLASSEX_cbSize
  1630. export WNDCLASSEX_style
  1631. export WNDCLASSEX_lpfnWndProc
  1632. export WNDCLASSEX_cbClsExtra
  1633. export WNDCLASSEX_cbWndExtra
  1634. export WNDCLASSEX_hInstance
  1635. export WNDCLASSEX_hIcon
  1636. export WNDCLASSEX_hCursor
  1637. export WNDCLASSEX_hbrBackground
  1638. export WNDCLASSEX_lpszMenuName
  1639. export WNDCLASSEX_lpszClassName
  1640. export WNDCLASSEX_hIconSm
  1641. align 8, db 0
  1642. WNDCLASSEX
  1643. WNDCLASSEX_cbSize: resd 1
  1644. WNDCLASSEX_style: resd 1
  1645. WNDCLASSEX_lpfnWndProc: resq 1
  1646. WNDCLASSEX_cbClsExtra: resd 1
  1647. WNDCLASSEX_cbWndExtra: resd 1
  1648. WNDCLASSEX_hInstance: resq 1
  1649. WNDCLASSEX_hIcon: resq 1
  1650. WNDCLASSEX_hCursor: resq 1
  1651. WNDCLASSEX_hbrBackground: resq 1
  1652. WNDCLASSEX_lpszMenuName: resq 1
  1653. WNDCLASSEX_lpszClassName: resq 1
  1654. WNDCLASSEX_hIconSm: resq 1
  1655. export GetProcAddress_LoadLibrary_user32_dll_DefWindowProcW_
  1656. export RegisterClassExW__
  1657. export GetProcAddress_LoadLibrary_user32_dll_ShowWindow_
  1658. export ShowWindow__
  1659. export GetProcAddress_LoadLibrary_user32_dll_UpdateWindow_
  1660. export UpdateWindow__
  1661. GetProcAddress_LoadLibrary_user32_dll_DefWindowProcW_: resq 1
  1662. RegisterClassExW__: resq 1
  1663. GetProcAddress_LoadLibrary_user32_dll_ShowWindow_: resq 1
  1664. ShowWindow__: resq 1
  1665. GetProcAddress_LoadLibrary_user32_dll_UpdateWindow_: resq 1
  1666. UpdateWindow__: resq 1
  1667. export MSG
  1668. export MSG_hwnd
  1669. export MSG_message
  1670. export MSG_wParam_padding
  1671. export MSG_wParam
  1672. export MSG_lParam
  1673. export MSG_time
  1674. export MSG_POINT_x
  1675. export MSG_POINT_y
  1676. export MSG_padding
  1677. align 8, db 0
  1678. MSG
  1679. MSG_hwnd: resq 1   ;8
  1680. MSG_message: resd 1
  1681. MSG_wParam_padding: resd 1  ;16
  1682. MSG_wParam: resq 1   ;24
  1683. MSG_lParam: resq 1   ;32
  1684. MSG_time: resd 1
  1685. MSG_POINT_x: resd 1    ;40
  1686. MSG_POINT_y: resd 1
  1687. MSG_padding: resd 1   ;48
  1688. export GetProcAddress_LoadLibrary_user32_dll_GetMessageW_
  1689. export GetProcAddress_LoadLibrary_user32_dll_TranslateMessage_
  1690. export GetProcAddress_LoadLibrary_user32_dll_DispatchMessageW_
  1691. export GetMessageW__
  1692. GetProcAddress_LoadLibrary_user32_dll_GetMessageW_: resq 1
  1693. GetProcAddress_LoadLibrary_user32_dll_TranslateMessage_: resq 1
  1694. GetProcAddress_LoadLibrary_user32_dll_DispatchMessageW_: resq 1
  1695. GetMessageW__: resq 1
  1696. export GetProcAddress_LoadLibrary_user32_dll_SetWindowLongPtrW_
  1697. export SetWindowLongPtrW__
  1698. export GetProcAddress_LoadLibrary_user32_dll_SetWindowPos_
  1699. export SetWindowPos__
  1700. GetProcAddress_LoadLibrary_user32_dll_SetWindowLongPtrW_: resq 1
  1701. SetWindowLongPtrW__: resq 1
  1702. GetProcAddress_LoadLibrary_user32_dll_SetWindowPos_: resq 1
  1703. SetWindowPos__: resq 1
  1704. export GetProcAddress_LoadLibrary_kernel32_dll_CreateThread_
  1705. export CreateThread__
  1706. export GetProcAddress_LoadLibrary_user32_dll_GetDC_
  1707. export GetDC__
  1708. export GetProcAddress_LoadLibrary_Gdi32_dll_GdiFlush_
  1709. export GetProcAddress_LoadLibrary_Gdi32_dll_BitBlt_
  1710. export BitBlt__
  1711. export GetProcAddress_LoadLibrary_user32_dll_ValidateRect_
  1712. export ValidateRect__
  1713. export GetProcAddress_LoadLibrary_user32_dll_SetLayeredWindowAttributes_
  1714. export SetLayeredWindowAttributes__
  1715. export GetProcAddress_LoadLibrary_user32_dll_IsWindowEnabled_
  1716. export GetProcAddress_LoadLibrary_user32_dll_IsWindowVisible_
  1717. export IsWindowEnabled__
  1718. export IsWindowVisible__
  1719. GetProcAddress_LoadLibrary_kernel32_dll_CreateThread_: resq 1
  1720. CreateThread__: resq 1
  1721. GetProcAddress_LoadLibrary_user32_dll_GetDC_: resq 1
  1722. GetDC__: resq 1
  1723. GetProcAddress_LoadLibrary_Gdi32_dll_GdiFlush_: resq 1
  1724. GetProcAddress_LoadLibrary_Gdi32_dll_BitBlt_: resq 1
  1725. BitBlt__: resq 1
  1726. GetProcAddress_LoadLibrary_user32_dll_ValidateRect_: resq 1
  1727. ValidateRect__: resq 1
  1728. GetProcAddress_LoadLibrary_user32_dll_SetLayeredWindowAttributes_: resq 1
  1729. SetLayeredWindowAttributes__: resq 1
  1730. GetProcAddress_LoadLibrary_user32_dll_IsWindowEnabled_: resq 1
  1731. GetProcAddress_LoadLibrary_user32_dll_IsWindowVisible_: resq 1
  1732. IsWindowEnabled__: resq 1
  1733. IsWindowVisible__: resq 1
  1734. export FramesDrawn
  1735. FramesDrawn: resq 1
  1736. export GetProcAddress_LoadLibrary_user32_dll_UpdateLayeredWindow_
  1737. export GetProcAddress_LoadLibrary_Gdi32_dll_GdiAlphaBlend_
  1738. export GdiAlphaBlend__
  1739. GetProcAddress_LoadLibrary_user32_dll_UpdateLayeredWindow_: resq 1
  1740. GetProcAddress_LoadLibrary_Gdi32_dll_GdiAlphaBlend_: resq 1
  1741. GdiAlphaBlend__: resq 1
  1742. export GetProcAddress_LoadLibrary_Gdi32_dll_CreatePolygonRgn_
  1743. export HRGN
  1744. export GetDC__MainThread
  1745. export SelectObject__MainThread
  1746. export GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_
  1747. export ReleaseDC__MainThread
  1748. export GetProcAddress_LoadLibrary_user32_dll_SetWindowRgn_
  1749. export SetWindowRgn__
  1750. GetProcAddress_LoadLibrary_Gdi32_dll_CreatePolygonRgn_: resq 1
  1751. HRGN: resq 1
  1752. GetDC__MainThread: resq 1
  1753. SelectObject__MainThread: resq 1
  1754. GetProcAddress_LoadLibrary_user32_dll_ReleaseDC_: resq 1
  1755. ReleaseDC__MainThread: resq 1
  1756. GetProcAddress_LoadLibrary_user32_dll_SetWindowRgn_: resq 1
  1757. SetWindowRgn__: resq 1
  1758. export MessagesReceived
  1759. MessagesReceived: resq 1
  1760. export GetProcAddress_LoadLibrary_user32_dll_LoadCursorW_
  1761. export LoadCursorW__
  1762. GetProcAddress_LoadLibrary_user32_dll_LoadCursorW_: resq 1
  1763. LoadCursorW__: resq 1
  1764. export CreatePolygonRgn_POINT_DCDrawer
  1765. export HRGN_DCDrawer
  1766. export SetWindowRgn__DCDrawer
  1767. align 8, resb 1
  1768. CreatePolygonRgn_POINT_DCDrawer: resq 5
  1769. HRGN_DCDrawer: resq 1
  1770. SetWindowRgn__DCDrawer: resq 1
  1771. export GetProcAddress_LoadLibrary_kernel32_dll_VirtualQuery_
  1772. export MEMORY_BASIC_INFORMATION
  1773. export MEMORY_BASIC_INFORMATION_BaseAddress
  1774. export MEMORY_BASIC_INFORMATION_AllocationBase
  1775. export MEMORY_BASIC_INFORMATION_AllocationProtect
  1776. export MEMORY_BASIC_INFORMATION_AllocationProtect_padding
  1777. export MEMORY_BASIC_INFORMATION_RegionSize
  1778. export MEMORY_BASIC_INFORMATION_State
  1779. export MEMORY_BASIC_INFORMATION_Protect
  1780. export MEMORY_BASIC_INFORMATION_Type
  1781. export MEMORY_BASIC_INFORMATION_padding
  1782. export VirtualQuery__
  1783. export MEMORY_BASIC_INFORMATION_RegionSize_multipleofMSG
  1784. GetProcAddress_LoadLibrary_kernel32_dll_VirtualQuery_: resq 1
  1785. align 16, resb 1
  1786. MEMORY_BASIC_INFORMATION
  1787. MEMORY_BASIC_INFORMATION_BaseAddress: resq 1 ;8
  1788. MEMORY_BASIC_INFORMATION_AllocationBase: resq 1 ;16
  1789. MEMORY_BASIC_INFORMATION_AllocationProtect: resd 1
  1790. MEMORY_BASIC_INFORMATION_AllocationProtect_padding: resd 1 ;24
  1791. MEMORY_BASIC_INFORMATION_RegionSize: resq 1 ;32
  1792. MEMORY_BASIC_INFORMATION_State: resd 1
  1793. MEMORY_BASIC_INFORMATION_Protect: resd 1 ;40
  1794. MEMORY_BASIC_INFORMATION_Type: resd 1
  1795. MEMORY_BASIC_INFORMATION_padding: resd 1 ;48
  1796. VirtualQuery__: resq 1
  1797. MEMORY_BASIC_INFORMATION_RegionSize_multipleofMSG: resq 1
  1798. export GetProcAddress_LoadLibrary_kernel32_dll_CreateEventW_
  1799. export GetProcAddress_LoadLibrary_kernel32_dll_SetEvent_
  1800. export SetEvent__
  1801. export CreateEventW__
  1802. GetProcAddress_LoadLibrary_kernel32_dll_CreateEventW_: resq 1
  1803. GetProcAddress_LoadLibrary_kernel32_dll_SetEvent_: resq 1
  1804. SetEvent__: resq 1
  1805. CreateEventW__: resq 1
  1806. export DEVMODEW
  1807. export DEVMODEW_dmDeviceName
  1808. export DEVMODEW_dmSpecVersion
  1809. export DEVMODEW_dmDriverVersion
  1810. export DEVMODEW_dmSize
  1811. export DEVMODEW_dmDriverExtra
  1812. export DEVMODEW_dmFields
  1813. export DEVMODEW_POINTL_x
  1814. export DEVMODEW_POINTL_y
  1815. export DEVMODEW_dmDisplayOrientation
  1816. export DEVMODEW_dmDisplayFixedOutput
  1817. export DEVMODEW_dmColor
  1818. export DEVMODEW_dmDuplex
  1819. export DEVMODEW_dmYResolution
  1820. export DEVMODEW_dmTTOption
  1821. export DEVMODEW_dmCollate
  1822. export DEVMODEW_dmFormName
  1823. export DEVMODEW_dmLogPixels
  1824. export DEVMODEW_dmBitsPerPel
  1825. export DEVMODEW_dmPelsWidth
  1826. export DEVMODEW_dmPelsHeight
  1827. export DEVMODEW_dmDisplayFlags
  1828. export DEVMODEW_dmDisplayFrequency
  1829. export DEVMODEW_dmICMMethod
  1830. export DEVMODEW_dmOCMIntent
  1831. export DEVMODEW_dmMediaType
  1832. export DEVMODEW_dmDitherType
  1833. export DEVMODEW_dmReserved1
  1834. export DEVMODEW_dmReserved2
  1835. export DEVMODEW_dmPanningWidth
  1836. export DEVMODEW_dmPanningHeight
  1837. DEVMODEW
  1838. DEVMODEW_dmDeviceName: resw 32 ;64
  1839. DEVMODEW_dmSpecVersion: resw 1
  1840. DEVMODEW_dmDriverVersion: resw 1
  1841. DEVMODEW_dmSize: resw 1
  1842. DEVMODEW_dmDriverExtra: resw 1 ;72
  1843. DEVMODEW_dmFields: resd 1
  1844. DEVMODEW_POINTL_x: resd 1 ;80
  1845. DEVMODEW_POINTL_y: resd 1
  1846. DEVMODEW_dmDisplayOrientation: resd 1 ;88
  1847. DEVMODEW_dmDisplayFixedOutput: resd 1
  1848. DEVMODEW_dmColor: resw 1
  1849. DEVMODEW_dmDuplex: resw 1 ;96
  1850. DEVMODEW_dmYResolution: resw 1
  1851. DEVMODEW_dmTTOption: resw 1
  1852. DEVMODEW_dmCollate: resw 1 ; 96 + 6
  1853. DEVMODEW_dmFormName: resw 32 ; 160 + 6
  1854. DEVMODEW_dmLogPixels: resw 1 ; 168
  1855. DEVMODEW_dmBitsPerPel: resd 1
  1856. DEVMODEW_dmPelsWidth: resd 1 ; 176
  1857. DEVMODEW_dmPelsHeight: resd 1
  1858. DEVMODEW_dmDisplayFlags: resd 1 ; 184
  1859. DEVMODEW_dmDisplayFrequency: resd 1
  1860. DEVMODEW_dmICMMethod: resd 1 ; 192
  1861. DEVMODEW_dmOCMIntent: resd 1
  1862. DEVMODEW_dmMediaType: resd 1 ; 200
  1863. DEVMODEW_dmDitherType: resd 1
  1864. DEVMODEW_dmReserved1: resd 1 ; 208
  1865. DEVMODEW_dmReserved2: resd 1
  1866. DEVMODEW_dmPanningWidth: resd 1 ; 216
  1867. DEVMODEW_dmPanningHeight: resd 1 ; 216+4=220
  1868. export GetProcAddress_LoadLibrary_user32_dll_EnumDisplaySettingsW_
  1869. export EnumDisplaySettingsW__
  1870. export GetProcAddress_LoadLibrary_user32_dll_SetTimer_
  1871. export SetTimer_uElapse
  1872. export SetTimer__
  1873. export GetProcAddress_LoadLibrary_kernel32_dll_WaitForSingleObject_
  1874. export WaitForSingleObject__
  1875. align 8, resb 1
  1876. GetProcAddress_LoadLibrary_user32_dll_EnumDisplaySettingsW_: resq 1
  1877. EnumDisplaySettingsW__: resq 1
  1878. GetProcAddress_LoadLibrary_user32_dll_SetTimer_: resq 1
  1879. SetTimer_uElapse: resw 1
  1880. align 8, resb 1
  1881. SetTimer__: resq 1
  1882. GetProcAddress_LoadLibrary_kernel32_dll_WaitForSingleObject_: resq 1
  1883. WaitForSingleObject__: resq 1
  1884. export GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTOpenAdapterFromHdc_
  1885. export GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTWaitForVerticalBlankEvent_
  1886. GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTOpenAdapterFromHdc_: resq 1
  1887. GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTWaitForVerticalBlankEvent_: resq 1
  1888. export D3DKMT_OPENADAPTERFROMHDC
  1889. export D3DKMT_OPENADAPTERFROMHDC_hDc
  1890. export D3DKMT_OPENADAPTERFROMHDC_hAdapter
  1891. export D3DKMT_OPENADAPTERFROMHDC_LUID_LowPart
  1892. export D3DKMT_OPENADAPTERFROMHDC_LUID_HighPart
  1893. export D3DKMT_OPENADAPTERFROMHDC_VidPnSourceId
  1894. D3DKMT_OPENADAPTERFROMHDC
  1895. D3DKMT_OPENADAPTERFROMHDC_hDc: resq 1 ;8
  1896. D3DKMT_OPENADAPTERFROMHDC_hAdapter: resd 1
  1897. D3DKMT_OPENADAPTERFROMHDC_LUID_LowPart: resd 1 ;16
  1898. D3DKMT_OPENADAPTERFROMHDC_LUID_HighPart: resd 1
  1899. D3DKMT_OPENADAPTERFROMHDC_VidPnSourceId: resd 1 ;24
  1900. export D3DKMTOpenAdapterFromHdc__
  1901. D3DKMTOpenAdapterFromHdc__: resq 1
  1902. export GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCreateDevice_
  1903. GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCreateDevice_: resq 1
  1904. export D3DKMT_CREATEDEVICE
  1905. export D3DKMT_CREATEDEVICE_hAdapter
  1906. export D3DKMT_CREATEDEVICE_unionpadding
  1907. export D3DKMT_CREATEDEVICE_Flags
  1908. export D3DKMT_CREATEDEVICE_hDevice
  1909. export D3DKMT_CREATEDEVICE_pCommandBuffer
  1910. export D3DKMT_CREATEDEVICE_CommandBufferSize
  1911. export D3DKMT_CREATEDEVICE_CommandBufferSize_padding
  1912. export D3DKMT_CREATEDEVICE_pAllocationList
  1913. export D3DKMT_CREATEDEVICE_AllocationListSize
  1914. export D3DKMT_CREATEDEVICE_AllocationListSize_padding
  1915. export D3DKMT_CREATEDEVICE_pPatchLocationList
  1916. export D3DKMT_CREATEDEVICE_PatchLocationListSize
  1917. export D3DKMT_CREATEDEVICE_padding
  1918. D3DKMT_CREATEDEVICE
  1919. D3DKMT_CREATEDEVICE_hAdapter: resd 1
  1920. D3DKMT_CREATEDEVICE_unionpadding: resd 1 ;8
  1921. D3DKMT_CREATEDEVICE_Flags: resd 1
  1922. D3DKMT_CREATEDEVICE_hDevice: resd 1 ;16
  1923. D3DKMT_CREATEDEVICE_pCommandBuffer: resq 1 ;24
  1924. D3DKMT_CREATEDEVICE_CommandBufferSize: resd 1
  1925. D3DKMT_CREATEDEVICE_CommandBufferSize_padding: resd 1 ;32
  1926. D3DKMT_CREATEDEVICE_pAllocationList: resq 1 ;40
  1927. D3DKMT_CREATEDEVICE_AllocationListSize: resd 1
  1928. D3DKMT_CREATEDEVICE_AllocationListSize_padding: resd 1 ;48
  1929. D3DKMT_CREATEDEVICE_pPatchLocationList: resq 1 ;56
  1930. D3DKMT_CREATEDEVICE_PatchLocationListSize: resd 1
  1931. D3DKMT_CREATEDEVICE_padding: resd 1 ;64
  1932. export D3DKMTCreateDevice__
  1933. export GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTDestroyDevice_
  1934. export D3DKMT_DESTROYDEVICE
  1935. export D3DKMT_DESTROYDEVICE_hDevice
  1936. export D3DKMTDestroyDevice__
  1937. export GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCloseAdapter_
  1938. export D3DKMT_CLOSEADAPTER
  1939. export D3DKMT_CLOSEADAPTER_hAdapter
  1940. export D3DKMTCloseAdapter__
  1941. align 8, resb 1
  1942. D3DKMTCreateDevice__: resq 1
  1943. GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTDestroyDevice_: resq 1
  1944. D3DKMT_DESTROYDEVICE
  1945. D3DKMT_DESTROYDEVICE_hDevice: resd 1
  1946. align 8, resb 1
  1947. D3DKMTDestroyDevice__: resq 1
  1948. GetProcAddress_LoadLibrary_Gdi32_dll_D3DKMTCloseAdapter_: resq 1
  1949. D3DKMT_CLOSEADAPTER
  1950. D3DKMT_CLOSEADAPTER_hAdapter: resd 1
  1951. align 8, resb 1
  1952. D3DKMTCloseAdapter__: resq 1
  1953. export D3DKMT_WAITFORVERTICALBLANKEVENT
  1954. export D3DKMT_WAITFORVERTICALBLANKEVENT_hAdapter
  1955. export D3DKMT_WAITFORVERTICALBLANKEVENT_hDevice
  1956. export D3DKMT_WAITFORVERTICALBLANKEVENT_VidPnSourceId
  1957. D3DKMT_WAITFORVERTICALBLANKEVENT
  1958. D3DKMT_WAITFORVERTICALBLANKEVENT_hAdapter: resd 1
  1959. D3DKMT_WAITFORVERTICALBLANKEVENT_hDevice: resd 1 ;8
  1960. D3DKMT_WAITFORVERTICALBLANKEVENT_VidPnSourceId: resd 1
  1961. export D3DKMTWaitForVerticalBlankEvent__
  1962. align 8, resb 1
  1963. D3DKMTWaitForVerticalBlankEvent__: resq 1
  1964. export ReleaseDC__
  1965. ReleaseDC__: resq 1
  1966. export BITMAPINFO
  1967. export BITMAPINFO_BITMAPINFOHEADER_biSize
  1968. export BITMAPINFO_BITMAPINFOHEADER_biWidth
  1969. export BITMAPINFO_BITMAPINFOHEADER_biHeight
  1970. export BITMAPINFO_BITMAPINFOHEADER_biPlanes
  1971. export BITMAPINFO_BITMAPINFOHEADER_biBitCount
  1972. export BITMAPINFO_BITMAPINFOHEADER_biCompression
  1973. export BITMAPINFO_BITMAPINFOHEADER_biSizeImage
  1974. export BITMAPINFO_BITMAPINFOHEADER_biXPelsPerMeter
  1975. export BITMAPINFO_BITMAPINFOHEADER_biYPelsPerMeter
  1976. export BITMAPINFO_BITMAPINFOHEADER_biClrUsed
  1977. export BITMAPINFO_BITMAPINFOHEADER_biClrImportant
  1978. export BITMAPINFO_RGBQUAD
  1979. export BITMAPINFO_RGBQUAD_rgbBlue
  1980. export BITMAPINFO_RGBQUAD_rgbGreen
  1981. export BITMAPINFO_RGBQUAD_rgbRed
  1982. export BITMAPINFO_RGBQUAD_rgbReserved
  1983. BITMAPINFO
  1984. BITMAPINFO_BITMAPINFOHEADER_biSize: resd 1 ;dd 0x00000028
  1985. BITMAPINFO_BITMAPINFOHEADER_biWidth: resd 1 ; dd 0x00000258  ;8
  1986. BITMAPINFO_BITMAPINFOHEADER_biHeight: resd 1 ; dd 0x00000190
  1987. BITMAPINFO_BITMAPINFOHEADER_biPlanes: resw 1 ; dw 0x0001
  1988. BITMAPINFO_BITMAPINFOHEADER_biBitCount: resw 1 ; dw 0x0020   ;16
  1989. BITMAPINFO_BITMAPINFOHEADER_biCompression: resd 1 ; dd 0
  1990. BITMAPINFO_BITMAPINFOHEADER_biSizeImage: resd 1 ; dd 0       ;24
  1991. BITMAPINFO_BITMAPINFOHEADER_biXPelsPerMeter: resd 1 ; dd 0
  1992. BITMAPINFO_BITMAPINFOHEADER_biYPelsPerMeter: resd 1 ; dd 0    ;32
  1993. BITMAPINFO_BITMAPINFOHEADER_biClrUsed: resd 1 ; dd 0
  1994. BITMAPINFO_BITMAPINFOHEADER_biClrImportant: resd 1 ; dd 0    ;40
  1995. BITMAPINFO_RGBQUAD
  1996. BITMAPINFO_RGBQUAD_rgbBlue: resb 1 ; db 0
  1997. BITMAPINFO_RGBQUAD_rgbGreen: resb 1 ; db 0
  1998. BITMAPINFO_RGBQUAD_rgbRed: resb 1 ; db 0
  1999. BITMAPINFO_RGBQUAD_rgbReserved: resb 1 ; db 0        ;44
  2000. export GetProcAddress_LoadLibrary_kernel32_dll_SetUnhandledExceptionFilter_
  2001. export SetUnhandledExceptionFilter__
  2002. export GetProcAddress_LoadLibrary_kernel32_dll_RaiseException_
  2003. GetProcAddress_LoadLibrary_kernel32_dll_SetUnhandledExceptionFilter_: resq 1
  2004. SetUnhandledExceptionFilter__: resq 1
  2005. GetProcAddress_LoadLibrary_kernel32_dll_RaiseException_: resq 1
  2006. export GetProcAddress_LoadLibrary_kernel32_dll_HeapCreate_
  2007. export HeapCreate__
  2008. export GetProcAddress_LoadLibrary_kernel32_dll_HeapAlloc_
  2009. export HeapAlloc__
  2010. GetProcAddress_LoadLibrary_kernel32_dll_HeapCreate_: resq 1
  2011. HeapCreate__: resq 1
  2012. GetProcAddress_LoadLibrary_kernel32_dll_HeapAlloc_: resq 1
  2013. HeapAlloc__: resq 1
  2014. export GetProcAddress_LoadLibrary_Gdi32_dll_ExtCreateRegion_
  2015. GetProcAddress_LoadLibrary_Gdi32_dll_ExtCreateRegion_: resq 1
  2016. export UpdateLayeredWindow__
  2017. export GetDC_0_
  2018. UpdateLayeredWindow__: resq 1
  2019. GetDC_0_: resq 1
  2020. export UpdateLayeredWindow_psize
  2021. UpdateLayeredWindow_psize: resd 2
  2022. export CreatePolygonRgn_POINT_FullScreen
  2023. export HRGN_FullScreen
  2024. CreatePolygonRgn_POINT_FullScreen: resq 5
  2025. HRGN_FullScreen: resq 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement