flat assembler
Message board for the users of flat assembler.

Index > Windows > MZÇ processed: MZÇ error: illegal instruction.

Author
Thread Post new topic Reply to topic
newbieFasm



Joined: 19 Apr 2022
Posts: 1
newbieFasm
format PE console
entry start

include 'win32a.inc'

;===============================
section '.text' code readable executable

start:
inc eax
inc eax
push 0
call [ExitProcess]

;========================
section '.idata' import data readable

library kernel,'kernel32.dll'

import kernel,\
ExitProcess,'ExitProcess'

i am having an error that says like this after running the exe file (fasm filename.exe) "MZÇ processed: MZÇ error: illegal instruction.


Description:
Filesize: 10.92 KB
Viewed: 386 Time(s)

error.PNG


Post 19 Apr 2022, 08:17
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3387
Location: vpcmipstrm
bitRAKE
fasm is intended to process source code and not .EXE file. The first parameter on command line is source file name.
Post 19 Apr 2022, 08:20
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18472
Location: In your JS exploiting you and your system
revolution
Code:
C:\> fasm increment.asm    
Post 19 Apr 2022, 09:01
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 480
Location: Russia
macomics
Code:
copy increment.asm increment.exe
fasm increment.exe    
Post 19 Apr 2022, 12:26
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 742
Location: Adelaide
sinsi
macomics wrote:
Code:
copy increment.asm increment.exe
fasm increment.exe    

Haven't tested but that should fail, since FASM has increment.exe open as source but shouldn't be able to write to increment.exe without an error.
If it did then you've just lost your source code Smile

/s
Post 20 Apr 2022, 06:01
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18472
Location: In your JS exploiting you and your system
revolution
sinsi wrote:
macomics wrote:
Code:
copy increment.asm increment.exe
fasm increment.exe    

Haven't tested but that should fail, since FASM has increment.exe open as source but shouldn't be able to write to increment.exe without an error.
If it did then you've just lost your source code Smile
In PREPROCE.INC:
Code:
;...
        call    read
        call    close
;...    
After reading the source the file is closed. So it should be fine to overwrite your source if you want to. Smile
Post 20 Apr 2022, 06:09
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.