Skip to content
Home > Programming > just more spicy

just more spicy

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #191301

    woowow masm32 for fun 😆 , I alway wonder how to code in asm, here is an example to show message box in asm

    .MODEL FLAT, STDCALL
    OPTION CASEMAP:NONE
    Include masm32includewindows.inc
    Include masm32includekernel32.inc
    Include masm32includeuser32.inc
    IncludeLib masm32libuser32.lib
    IncludeLib masm32libkernel32.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

    .486                      ; create 32 bit code
    .model flat, stdcall      ; 32 bit memory model
    option casemap :none      ; case sensitive
    
    ;     include files
    ;     ~~~~~~~~~~~~~
    include masm32includewindows.inc
    include masm32includemasm32.inc
    include masm32includegdi32.inc
    include masm32includeuser32.inc
    include masm32includekernel32.inc
    include masm32includeComctl32.inc
    include masm32includecomdlg32.inc
    include masm32includeshell32.inc
    include masm32includeoleaut32.inc
    include masm32includemsvcrt.inc
    include masm32includedialogs.inc
    include masm32macrosmacros.asm
    
    ;     libraries
    ;     ~~~~~~~~~
    includelib masm32libmasm32.lib
    includelib masm32libgdi32.lib
    includelib masm32libuser32.lib
    includelib masm32libkernel32.lib
    includelib masm32libComctl32.lib
    includelib masm32libcomdlg32.lib
    includelib masm32libshell32.lib
    includelib masm32liboleaut32.lib
    includelib masm32libmsvcrt.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 😆 😆 my programming language is alway c++ and c# and I will code in asm just for fun to display something like hello world on my screen 😀

    #191304
    Ponies
    Member

    Wowz0r’s Arnt you getting all big’.

    “tear” He’s growing up.

    #191303
    Departure
    Member
    .386
    .model flat, stdcall
    option casemap:none
    include masm32includewindows.inc
    include masm32includekernel32.inc
    includelib kernel32.lib
    include masm32includeuser32.inc
    includelib user32.lib
    
    .data
    MsgCaption      db "Departure Rocks",0
    MsgBoxText      db "Departures Hello World asm Code!",0
    
    .code
    start:
    invoke MessageBox, NULL,addr MsgBoxText, addr MsgCaption, MB_OK
    invoke ExitProcess,NULL
    end start

    Arn’nt I cool, Yes asm is one language I always wanted to get right into, Unfortunly I only know some basic asm coding as I needed to know with reverse Engineering that i have done in the past (basic cracking)

    #191302

    first step go here

    second step go here

    and if you speak French go here

    http://www.asmfr.com/listecodes.aspx?catid=245

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.