Page 1 of 1

memory and shared library

Posted: Tue Feb 17, 2009 11:26 am
by jtlb
Is it possible to make chunk of memory accessible only by a given shared library but not by the application linked against this library?

Re: memory and shared library

Posted: Tue Feb 17, 2009 12:00 pm
by JohnnyTheDon
Using the conventional method of implementing shared libraries (mapping the library into the applications address space) it is kind of difficult. One way I can think of is keeping the shared library mapped out until a call to it is made, and then making some kind of jump gate to map in the library.

Something like this:

Code: Select all

_libfunc_x:
     call mapInLib
     jmp libfunc_x
The library would then have to map out the memory region you are tyring to protect before it returns