Hi guys been awhile since I was on here.
Just taught i'd post some code to help people understand whats going on behind all the macros etc.




;compile with:
;NASMW.EXE -fobj stack.asm
;link with:
;ALINK.EXE stack.obj -c -oPE

%include "E:\nasm\include\windows.inc"

EXTERN ExitProcess
IMPORT ExitProcess kernel32.dll
EXTERN MessageBoxA
IMPORT MessageBoxA user32.dll

;segment .data USE32

segment .code USE32

..start

push ebp            ;make room for the string
mov ebp,esp
sub esp,24

mov , byte 0
mov , byte 0
mov , byte "!"       
mov , byte "O"
mov , byte "L"
mov , byte "L"
mov , byte "E"
mov , byte "H"      ;start of the string

lea edi,           ;locate address of string

mov ,dword MB_OK
mov ,edi       
mov ,edi         
mov ,dword 0   
call

add esp,16

mov esp, ebp ; takedown stack frame
pop ebp

sub esp,4            ;make room for our exitcode status
mov ,dword 0    ;exitprocess will exit with the 0 good

call

Posted on 2006-11-30 11:37:48 by gavin