flat assembler
Message board for the users of flat assembler.

Index > Windows > compile error

Author
Thread Post new topic Reply to topic
xellos



Joined: 31 Oct 2010
Posts: 4
xellos
i have this code

Code:

include 'c:\fasm\include\win32ax.inc'

.code

        start:
                invoke  MessageBox,HWND_DESKTOP,"Hi! I'm the example program!",invoke GetCommandLine,MB_OK
                invoke  ExitProcess,0

.end start
                  


when i try to compile it i get the error write failed

the code is the hello example so it needs to work
Post 31 Oct 2010, 19:28
View user's profile Send private message Reply with quote
xellos



Joined: 31 Oct 2010
Posts: 4
xellos
oke i got the .bin file but how to make an exe ?
Post 31 Oct 2010, 19:52
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
add at 1st line
format PE GUI ; for gui
format PE console ; for console
Post 31 Oct 2010, 20:14
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Code:
format pe gui 4.0
entry start

include 'c:\fasm\include\win32ax.inc'

section '.text' code executable readable
proc start
                invoke  MessageBox,HWND_DESKTOP,"Hi! I'm the example program!",invoke GetCommandLine,MB_OK
                invoke  ExitProcess,0
enp

    


Somebody else will have to show you how to import MsgBox and ExitP, b/c I can't remember and I don't have any of my old sources to look at.


Last edited by Tyler on 31 Oct 2010, 23:34; edited 1 time in total
Post 31 Oct 2010, 21:01
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17669
Location: In your JS exploiting you and your system
revolution
xellos wrote:
when i try to compile it i get the error write failed
Write failed is usually because you already have the program running. So presumably you already have the messagebox displaying the text. Just press "okay" to close the program and then you can recompile it and write a new exe to the disk.
Post 31 Oct 2010, 23:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.