woowow masm32 for fun
- Code: Select all
.MODEL FLAT, STDCALL
OPTION CASEMAP:NONE
Include \masm32\include\windows.inc
Include \masm32\include\kernel32.inc
Include \masm32\include\user32.inc
IncludeLib \masm32\lib\user32.lib
IncludeLib \masm32\lib\kernel32.lib
.DATA
MsgCaption DB "First Steps",0
MsgBoxText DB "This is a bare bones exe application.",0
.CODE
Start:
Invoke MessageBox, NULL,Offset MsgBoxText, Offset MsgCaption, MB_OK
Invoke ExitProcess,NULL
End Start
nothing fancy, let try another one, a dialogue with a button and an event click on that button
- Code: Select all
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
; include files
; ~~~~~~~~~~~~~
include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\Comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\shell32.inc
include \masm32\include\oleaut32.inc
include \masm32\include\msvcrt.inc
include \masm32\include\dialogs.inc
include \masm32\macros\macros.asm
; libraries
; ~~~~~~~~~
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\Comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\oleaut32.lib
includelib \masm32\lib\msvcrt.lib
WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
.data?
hInstance dd ?
.code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
mov hInstance, FUNC(GetModuleHandle,NULL)
call main
invoke ExitProcess,eax
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
main proc
Dialog "Bare Bones Dialog", \ ; caption
"MS Sans Serif",10, \ ; font,pointsize
WS_OVERLAPPED or \ ; styles for
WS_SYSMENU or DS_CENTER, \ ; dialog window
2, \ ; number of controls
50,50,150,80, \ ; x y co-ordinates
1024 ; memory buffer size
DlgButton "Cancel",WS_TABSTOP,48,40,50,15,IDCANCEL
DlgStatic "Bare Bones Dialog Written In MASM32", \
SS_CENTER,2,20,140,9,100
CallModalDialog hInstance,0,WndProc,NULL
ret
main endp
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
WndProc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.if uMsg == WM_INITDIALOG
invoke SendMessage,hWin,WM_SETICON,1,
FUNC(LoadIcon,NULL,IDI_ASTERISK)
.elseif uMsg == WM_COMMAND
.if wParam == IDCANCEL
jmp quit_dialog
.endif
.elseif uMsg == WM_CLOSE
quit_dialog:
invoke EndDialog,hWin,0
.endif
xor eax, eax
ret
WndProc endp
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
wowo fun fun fun masm32 can be download freely on google and if you are interested, I will post a link for newbie to asm
btw I dont think you can code in it, it's to complicate for you





