Stripped down a bare 64 bit Window, set the PE file alignment to 64 and ended up with a working EXE file of 1920 bytes. If I remembered how to write a DOS stub, you could get it down a little further but I have not done one for years. Only 3 crapheap AV scanners did not like it but no garrantee it will work on all 64 bit Windows versions.
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm64\include64\masm64rt.inc
.code
classname db "Win64",0
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
entry_point proc
call main
.exit
entry_point endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
main proc
LOCAL wc :WNDCLASSEX
LOCAL hInstance :QWORD
mov hInstance,rvcall(GetModuleHandle,0)
mov wc.cbSize, SIZEOF WNDCLASSEX
mov wc.style, CS_BYTEALIGNCLIENT or CS_BYTEALIGNWINDOW
mov wc.lpfnWndProc, ptr$(WndProc)
mov wc.cbClsExtra, 0
mov wc.cbWndExtra, 0
mrm wc.hInstance, hInstance
mov wc.hIcon, 0
mov wc.hCursor, rvcall(LoadCursor,0,IDC_ARROW)
mrm wc.hbrBackground, 0
mov wc.lpszMenuName, 0
mov wc.lpszClassName, ptr$(classname)
mov wc.hIconSm, 0
rcall RegisterClassEx,ptr$(wc)
lea r11, classname
invoke CreateWindowEx,WS_EX_LEFT or WS_EX_ACCEPTFILES, \
r11, r11, \
WS_OVERLAPPEDWINDOW or WS_VISIBLE,\
250,150,800,600,0,0,hInstance,0
call msgloop
ret
main endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
msgloop proc
LOCAL msg :MSG
LOCAL pmsg :QWORD
mov pmsg, ptr$(msg) ; get the msg structure address
jmp gmsg ; jump directly to GetMessage()
mloop:
; rcall TranslateMessage,pmsg ; not needed here
rcall DispatchMessage,pmsg
gmsg:
xor r11, r11
test rax, rvcall(GetMessage,pmsg,r11,r11,r11) ; loop until GetMessage returns zero
jnz mloop
ret
msgloop endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
WndProc proc hWin:QWORD,uMsg:QWORD,wParam:QWORD,lParam:QWORD
LOCAL hDC :QWORD
LOCAL ps :PAINTSTRUCT
LOCAL rct :RECT
.switch uMsg
.case WM_CREATE
xor rax, rax
ret
.case WM_PAINT
rcall BeginPaint,hWin,ptr$(ps)
mov hDC, rvcall(GetDC,hWin)
mov rct.left, 25
mov rct.top, 25
mov rct.right, 100
mov rct.bottom, 50
invoke DrawText,hDC,"How D",-1,ptr$(rct),DT_SINGLELINE
rcall ReleaseDC,hWin,hDC
rcall EndPaint,hWin,ptr$(ps)
.case WM_CLOSE
rcall PostQuitMessage,NULL
.endsw
rcall DefWindowProc,hWin,uMsg,wParam,lParam
ret
WndProc endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end
comment #
--------------------------------------
3 x crapheap AV scanners on VirusTotal
--------------------------------------
Cylance Unsafe
SecureAge Malicious
Trapmine Malicious.moderate.ml.score
#