Linux assembly list
 help / color / mirror / Atom feed
From: Brian Raiter <breadbox@muppetlabs.com>
To: linux-assembly@vger.kernel.org
Subject: Re: Example of execve
Date: Tue, 29 Apr 2003 14:39:58 -0700	[thread overview]
Message-ID: <16046.61742.822990.119167@eidolon.muppetlabs.com> (raw)
In-Reply-To: <20030429193112.27027.qmail@web11406.mail.yahoo.com>

> Can anyone give me an example of how can i implement
> the execve syscall under asm, because I don't know how
> to pass arrays as parameters.

You don't pass arrays per se to execve(). execve() takes pointers to
arrays. Just construct the array somewhere in your data
segment. Simple example:

section .data

str1:	db	"foo", 0
str2:	db	"bar", 0
str3:	db	"baz", 0
array:	dd	str1, str2, str3, 0

section .text

	push	str1		; filename
	push	array		; argv
	push	dword 0		; envp
	call	execve

b

  reply	other threads:[~2003-04-29 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-29 19:31 Example of execve Slack Traq
2003-04-29 21:39 ` Brian Raiter [this message]
2003-04-29 22:57 ` Gigi Sullivan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16046.61742.822990.119167@eidolon.muppetlabs.com \
    --to=breadbox@muppetlabs.com \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox