looking for a dlopen()-like code which takes file image

From: Michael Y (michael.yeeNOSPAM_at_rogers.com)
Date: 01/20/05


Date: Thu, 20 Jan 2005 14:55:57 -0500

Hi,

I'm looking for user-level code akin to dlopen() which takes file image
bytes, instead of a file path. For example:

void *dlopen(unsigned char *image, int mode);

This would be very similar to "userland exec", an execve()-like
implementation which takes image bytes instead of the file path:

void ul_exec(void *ELF_buf, int argc, char **argv, char **envp);

For details on userland exec, see
http://lists.netsys.com/pipermail/full-disclosure/2004-January/015143.html

How would this be implemented? mmap()'ing the segments, relocations,
opening dependencies, etc. are things that need to performed. I'm hoping
any good documents or source code out there would be more helpful than
looking directly at the dlopen() implementation.

Thanks.



Relevant Pages

  • Re: Windows or Linux?
    ... File.pathSeparator (or it's peer, File.pathSeparatorChar) are more ... '\' char is an escape char in a quoted string. ... the '\' char when building a file path, you need to escape it as ...
    (comp.lang.java.programmer)
  • Re: UNIX env var parsing in C
    ... > I wanted to write a function that gets the file path as an argument. ... > env varaibles and returns plain string with the values of env variabels ... char *getenv; ...
    (comp.lang.c)