samedi 15 décembre 2012

MessageBox in ASM

by Jochen my bro :)
FASM versions

MessageBox Simple :

format pe gui 4.0
include 'win32ax.inc'

szMes db 'Message',0
szCap db 'Caption',0

start:
        invoke MessageBoxA,0,szMes,szCap,MB_OK
        invoke ExitProcess, 0
.end start

MessageBox with import's :

entry main
include 'win32ax.inc'

; Simple MessageBox with Import's ;)

main:
invoke MessageBox,0,'MessageBox with Imports','lpCaption',MB_OK
invoke ExitProcess, 0
exit:

data import

library kernel32,'kernel32.dll', user32,"USER32.DLL"


import user32, MessageBox, 'MessageBoxA'
import kernel32, ExitProcess, 'ExitProcess'

end data

MessageBox Dynamic:

format pe gui 4.0
entry x
include 'win32ax.inc'

 ; Dynamic MessageBox 1Kb :)

x:
       stdcall [LoadLibraryA], 'user32.dll'
       stdcall [GetProcAddress], eax, 'MessageBoxA'

        push MB_OK
        push lpCaption
        push lpText
        push 0
        call eax
quit:
        invoke ExitProcess,0

 data import
         library kernel32,"kernel32.dll"
         include "%include%/api/kernel32.inc"
         lpCaption db 'FASM RuLE!',0
         lpText    db 'Dynamic MessageBox',0
 end data
               


Aucun commentaire:

Enregistrer un commentaire