|
From: Stephen T. <st...@to...> - 2006-11-17 19:14:20
|
On Fri, 2006-11-17 at 18:42 +0000, Tom Hughes wrote: > Ah, well Windows isn't really my area of expertise I'm afraid, but > it does have memory allocation APIs along the lines of mmap so there > shouldn't be any problem allocating the memory. > > You just need to read the PE header and work out where each section > wants to load, then try and allocate the memory and read it in. > > There are complications though, as if memory serves me right PE code > is not generally position independent (even when in a DLL) so if you > can't load it at the right address you may have to relocate it. > > The same thing does apply to ELF, at least on x86 where the linker > will allow you to put non PIC code in a shared library, but we are > able to use the existing linux dynamic loader to do most of the work > and I don't know if the same thing would be possible on Windows? The library is developed and running on a Linux system. Stephen |