Hi, all!
64 bit simple window size of exe-file 848 bytes
build.bat
cls
set pelleasm=\poasm_new
set filename=%1
if exist %filename%.exe del if exist %filename%.exe
if exist %filename%.rc (
%pelleasm%\bin\porc /I%pelleasm%\include %filename%.rc
%pelleasm%\bin\poasm /I%pelleasm%\include /AAMD64 %filename%.asm
%pelleasm%\bin\polink /SUBSYSTEM:WINDOWS /ALIGN:16 /MERGE:.data=.text ^
/LARGEADDRESSAWARE:NO /LIBPATH:%pelleasm%\lib /BASE:0x400000 ^
/STUB:%pelleasm%\bin\stubby.exe %filename%.obj %filename%.res
del %filename%.res
) else (
%pelleasm%\bin\poasm /I%pelleasm%\include /AAMD64 %filename%.asm
%pelleasm%\bin\polink /SUBSYSTEM:WINDOWS /ALIGN:16 /MERGE:.data=.text ^
/LARGEADDRESSAWARE:NO /LIBPATH:%pelleasm%\lib /BASE:0x400000 ^
/STUB:%pelleasm%\bin\stubby.exe %filename%.obj
)
del %filename%.obj
SimpleWnd.asm
include win64a.inc
extern __imp_ExitProcess:qword
extern __imp_DefWindowProcA:qword
extern __imp_DispatchMessageA:qword
extern __imp_GetMessageA:qword
extern __imp_RegisterClassExA:qword
extern __imp_CreateWindowExA:qword
.code
start:
sub esp,30h+sizeof MSG
msg equ rsp+sizeof MSG
xor ebx,ebx
mov eax,10027h
mov esi,IMAGE_BASE
db 0BFh
dd ClassName ;mov edi,offset ClassName
push rax ;hIconSm
push rdi ;lpszClassName
push rbx ;lpszMenuName
db 68h
dd COLOR_WINDOW;hbrBackground
db 68h
dd 10003h ;hCursor
push rax ;hIcon
push rsi ;hInstance
push rbx ;cbClsExtra & cbWndExtra
db 68h
dd WndProc
db 68h
dd SIZEOF WNDCLASSEXA
mov ecx,esp
call __imp_RegisterClassExA
push rbx
push rsi ;rsi=400000h
shl esi,9 ;rsi=CW_USEDEFAULT
push rbx
push rbx
push rsi
push rsi
push rsi
push rsi
mov r9d,WS_OVERLAPPEDWINDOW or WS_VISIBLE
mov r8,rdi ;offset ClassName
mov edx,edi ;offset ClassName
xor ecx,ecx
sub esp,20h
call __imp_CreateWindowExA
lea edi,msg
.WHILE (1)
xor r9,r9
xor r8,r8
xor edx,edx
mov ecx,edi
call __imp_GetMessageA
mov ecx,edi
call __imp_DispatchMessageA
.ENDW
;--------------------------------
WndProc:
cmp edx,WM_DESTROY
jnz @f
xor ecx,ecx
call __imp_ExitProcess
@@:
jmp __imp_DefWindowProcA
;data-------------------------------
ClassName db "WndClass",0
END start