flat assembler
Message board for the users of flat assembler.
Index
> Linux > How do I execute other program from a Linux program |
Author |
|
2 08 May 2007, 04:15
Code: format elf executable mov eax,0xB mov ecx,args mov edx,0 mov ebx,arg0 int 0x80 mov eax,1 int 0x80 arg0: db '/bin/ls',0 arg1: db '-l',0 args: dd arg0,arg1,0 ;this program is designed to have the same effect ;as entering "/bin/ls -l" at the terminal |
|||
08 May 2007, 04:15 |
|
2 08 May 2007, 04:27
I noticed that after it executes the other program,it only returns to the OS instead of going back to the original program that called it! Any way to make it go back?
|
|||
08 May 2007, 04:27 |
|
LocoDelAssembly 08 May 2007, 16:13
Unix has a different approach, you can't do the CreateProcess of Windows but change the process image with another. However you are allowed to duplicate your process and later making one of them execute the desired program. Read about sys_fork/sys_vfork.
PS: Use the child process to execute the program, using the current will kill the child after program termination. |
|||
08 May 2007, 16:13 |
|
asmcoder 09 Apr 2009, 14:26
[content deleted]
Last edited by asmcoder on 14 Aug 2009, 14:52; edited 1 time in total |
|||
09 Apr 2009, 14:26 |
|
drhowarddrfine 09 Apr 2009, 20:23
Just google for 'man execve' for the manpage.
|
|||
09 Apr 2009, 20:23 |
|
pelaillo 13 Apr 2009, 14:39
See this thread http://board.flatassembler.net/topic.php?t=9279 Console output after intern program execution.
|
|||
13 Apr 2009, 14:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.