flat assembler
Message board for the users of flat assembler.

Index > Windows > Arguments and return code

Author
Thread Post new topic Reply to topic
snifit



Joined: 10 Dec 2004
Posts: 12
Location: Sweden
snifit 11 Dec 2004, 12:38
I've recently started to learn fasm and i must say I like it, just have a two questions for you:

How do i get the command line parameters? Searched the forums and found something when using com executables, but can't figure it out when using "format PE console".

The last question is about the program's return code. Does it return the content of eax to the system when doing the 'ret' command?

Thanks in advance.
Post 11 Dec 2004, 12:38
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 11 Dec 2004, 14:12
Welcome snifit, some answers to your questions:
For PE consoles, you can use GetCommandLine api, then eax points to full command line.
For PE programs, the returned code is the argument given to ExitProcess call.
Post 11 Dec 2004, 14:12
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 11 Dec 2004, 15:12
pelaillo wrote:
For PE consoles, you can use GetCommandLine api, then eax points to full command line.


AFAIK, GetCommandLine API function works for GUI PE applications as well.

Of course some parsing of the command line, obtined this way have to be provided.
There are several procedures for this task, discussed on the forum.

Regards.
Post 11 Dec 2004, 15:12
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
snifit



Joined: 10 Dec 2004
Posts: 12
Location: Sweden
snifit 11 Dec 2004, 15:36
Ah didn't know about that API.
Thanks this help solved my problem.
Post 11 Dec 2004, 15:36
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.