Fix wrong MemoryImage address given to the elf interpreter

This commit is contained in:
Alex
2023-03-20 05:17:35 +02:00
parent 6492da3237
commit 45cd4bb13c
5 changed files with 39 additions and 30 deletions

View File

@ -62,6 +62,7 @@ namespace Execute
Vector<String> NeededLibraries;
void *MemoryImage;
void *VirtualMemoryImage;
/* This should be deleted after copying the allocated pages to the thread
Intended to be used only inside BaseLoad.cpp */
@ -71,6 +72,12 @@ namespace Execute
Vector<AuxiliaryVector> auxv;
};
struct MmImage
{
void *Phyiscal;
void *Virtual;
};
BinaryType GetBinaryType(void *Image);
BinaryType GetBinaryType(char *Path);
@ -94,9 +101,9 @@ namespace Execute
* @param pV Memory::Virtual object to use
* @param ElfFile ELF file loaded in memory (FULL FILE)
* @param Length Length of @p ElfFile
* @return void* The Memory Image
* @return The Memory Image (Physical and Virtual)
*/
void *ELFCreateMemoryImage(Memory::MemMgr *mem, Memory::Virtual &pV, void *ElfFile, size_t Length);
MmImage ELFCreateMemoryImage(Memory::MemMgr *mem, Memory::Virtual &pV, void *ElfFile, size_t Length);
uintptr_t LoadELFInterpreter(Memory::MemMgr *mem, Memory::Virtual &pV, const char *Interpreter);