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 19 Apr 2022, 08:17
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: 3439 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: 4073
Location: vpcmpistri
bitRAKE 19 Apr 2022, 08:20
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: 20445
Location: In your JS exploiting you and your system
revolution 19 Apr 2022, 09:01
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: 1040
Location: Russia
macomics 19 Apr 2022, 12:26
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: 794
Location: Adelaide
sinsi 20 Apr 2022, 06:01
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: 20445
Location: In your JS exploiting you and your system
revolution 20 Apr 2022, 06:09
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.