linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steve Graegert" <graegerts@gmail.com>
To: "Jørgen P. Tjernø" <jorgen@devsoft.no>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: execve-type memory-based function, possible?
Date: Mon, 23 Oct 2006 13:33:32 +0200	[thread overview]
Message-ID: <6a00c8d50610230433t6f41b04dr13b57c0fd9e7cb99@mail.gmail.com> (raw)
In-Reply-To: <453C975C.1010402@devsoft.no>

On 10/23/06, "Jørgen P. Tjernø" <jorgen@devsoft.no> wrote:
> Jørgen P. Tjernø wrote:
>  > [ .. a lot of stuff .. ]
>
> It might've been a bit unclear, so here goes:
>
> I'm thinking something like if you read the contents of the file
> "/bin/ls" into a buffer, and then want to execute that.
> Wouldn't that require that you allocate the memory, do relocation, set
> the correct memory page protection (to execute for code, etc), etcetera?

Jørgen,

(now I got it)  Looks like you'd want to implement some kind of
userland exec.  In this case the following archive will be useful:
http://www.graegert.com/code/ul_exec-v1.1.tar.gz.  Although quite
dated it illustrates basic concepts.

If you have questions about the code or the general approach, feel
free to contact me privately.

	\Steve

--

Steve Grägert <steve@graegert.com>
Jabber    xmpp://graegerts@jabber.org
Internet  http://eth0.graegert.com, http://blog.graegert.com
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2006-10-23 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23  9:19 execve-type memory-based function, possible? "Jørgen P. Tjernø"
2006-10-23 10:20 ` "Jørgen P. Tjernø"
2006-10-23 11:33   ` Steve Graegert [this message]

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=6a00c8d50610230433t6f41b04dr13b57c0fd9e7cb99@mail.gmail.com \
    --to=graegerts@gmail.com \
    --cc=jorgen@devsoft.no \
    --cc=linux-c-programming@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;
as well as URLs for NNTP newsgroup(s).