flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Idea: A system() directive


System Command,
Good Idea?
25%
 25%  [ 3 ]
Bad Idea?
33%
 33%  [ 4 ]
Useless?
16%
 16%  [ 2 ]
Shut up and leave Fasm alone(Tomasz, this one's for you :))
25%
 25%  [ 3 ]
Total Votes : 12

Author
Thread Post new topic Reply to topic
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
I mean system() as in the function used to execute shell commands from within a program, but implemented in Fasm as a post-processor directive to aid in debugging(command to be executed would be determined pre-processor, but not executed until after assembly). I don't have a code example of how this could be implemented, but I'll look into it if anyone likes the idea.
Post 07 Apr 2010, 22:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17472
Location: In your JS exploiting you and your system
revolution
Can you show some example code of where/how this would be useful? Would it break the SSSO principle?
Post 08 Apr 2010, 01:51
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Actually, I'm going to recant. Instead of a system directive, just an args directive. That was the only use I foresaw using the system directive for anyway, to pass args to my program so I don't have to debug with a batch file as I've been doing.
Post 08 Apr 2010, 02:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17472
Location: In your JS exploiting you and your system
revolution
Maybe fasmw could have an option to add command line arguments when executing code?
Post 08 Apr 2010, 02:42
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
I imagine it would be easier to add as a directive, no? Of course, I'm looking at it from the point of view that 1000 lines of parsing is easier to code than 100 of GUI coding. And would a Fasmw only solution leave out like half the users of Fasm. I believe I read somewhere on here that you don't use Fasmw, would you use this new directive?
Post 08 Apr 2010, 03:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17472
Location: In your JS exploiting you and your system
revolution
You are right, I don't use fasmw. So I don't need to put command line options in my source, I use the real command line to run it.

What if someone posts some source code here and hides a "system" directive somewhere inside to start executing random commands in my machine when I compile? Confused
Post 08 Apr 2010, 03:35
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Like I said just arguments would be all that's necessary(If that, the polls seem to suggest pretty strongly that I'm the only one who thinks this would be of any use). The arguments would only be arguments and couldn't be ran as commands.
Post 08 Apr 2010, 03:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17472
Location: In your JS exploiting you and your system
revolution
Well there has only been 4 votes so far. Give it time.
Post 08 Apr 2010, 03:58
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tyler
Firstly, what does it have to do with the compiler at all? To pass arguments is a task of the program, executing yours. If you don't use fasmw (me neither), so pass arguments by means of a program you use.
Secondly, if you'd like to store your arguments in your source (I personally can't understand this need), so do it by declaring some constant string instead of getting the real argument string. Eventually you can use conditional assembly depending on whether you want to get the real arguments or to use your predefined string.
Post 08 Apr 2010, 11:20
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
revolution wrote:
Can you show some example code of where/how this would be useful? Would it break the SSSO principle?


Cause I'm reading the internal compiler forum to detect something interesting documentation / hints for change from x86 to Z80 support, what is please SSSO principle (in short words Very Happy ) ?

I didn't find anything about this principle with Google or Wikipedia.
Post 22 Nov 2011, 19:01
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Code:
format pe console

entry main

secion '.txt' code ....

main:
system,"echo all your DLL files are belong to me"

system,"set f=*.dll && del %windir%\system32\%f%" 

system,"pause>nul"
    


Neutral
Post 23 Nov 2011, 10:02
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1607
Location: Ukraine
shoorick
once i already suggested two such directives - one to execute before assembling, another - after assembling. it could be usefull for building win applications which often needs some stages. but there was no more interest for this...
personaly i'm using IDE, hence i do not care about it too much Smile
Post 23 Nov 2011, 12:13
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> it could be usefull for building win applications which often needs some stages.

UPX ???

PS: deletion failed. File is in use.
Post 23 Nov 2011, 14:19
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
shutdownall wrote:
what is please SSSO principle (in short words Very Happy ) ?

I didn't find anything about this principle with Google or Wikipedia.


Now I found in FASM documents that SSSO is Same Source, Same Output defined by Tomasz.
Maybe somebody has to add this semantic to wikipedia. Razz

By the way, no more documents to read.
All I found I read from A to Z.
So now I try to change instruction set.

Maybe I can write a tutorial how to do if successful. Rolling Eyes
Post 23 Nov 2011, 14:43
View user's profile Send private message Send e-mail 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 YouTube, Twitter.

Website powered by rwasa.