General Info | |
Interface: RExecModFile Files: rexecmodfile.h Last change: 23/03/2003 Author: Luiz Henrique Shigunov |
Description
Structures Executable module file format |
Functions | |
0x00 - Close - Close a module file 0x09 - CheckFormat - Check for a valid executable module 0x01 - GetModuleInfo - Get informations about a module 0x02 - GetUsedFunc - Get informations about a used function 0x03 - GetUsedFuncReloc - Get informations about a used function relocation |
0x04 - LoadCode - Load module's code 0x05 - LoadData - Load module's data 0x06 - LoadROData - Load module's RO data 0x07 - Open - Open a module file 0x08 - OpenFD - Open a module file |
This page describes the RExecModFile interface which provides access to executable module files.
The executable module file reader gets module data, code, data, used functions, relocations, etc.
typedef struct { char md5[16]; const char *comment; unsigned int codeSize; unsigned int roDataSize; unsigned int dataSize; unsigned int stackSize; } RExecModFile_ModuleInfo;
comment is the file comment, codeSize the code size in bytes, roDataSize the read only data size in bytes, dataSize the initialized and uninitialized data size in bytes and stackSize the stack size in bytes like a power of 2 (12 = 4096 bytes, 14 = 16384 bytes, etc).
typedef struct { const char *interface; const char *imp; unsigned int function; unsigned int prop; } RExecModFile_UsedFuncInfo;
prop can be:
typedef struct { RExecModFile_UsedFuncInfo function; unsigned int offset; unsigned int prop; } RExecModFile_UsedFuncRelocInfo;
prop is 0 or:
All names can't be changed because they are the original name, not a copy.
int RExecModFile_Close(RExecModFile_File *file);
This function closes file.
int RExecModFile_CheckFormat(void *buf, unsigned int size);
This function checks whether buf which size has a valid executable module header.
buf must contain the start of the executable module.
int RExecModFile_GetModuleInfo(RExecModFile_File *file, RExecModFile_ModuleInfo *info);
This function gets informations about module file.
In case of success, info will be filled with the informations.
int RExecModFile_GetUsedFunc(RExecModFile_File *file, unsigned int n, RExecModFile_UsedFuncInfo *info);
This function gets informations about the n function used by file.
n starts with 0.
In case of success, info will be filled with the informations.
int RExecModFile_GetUsedFuncReloc(RExecModFile_File *file, unsigned int n, RExecModFile_UsedFuncRelocInfo *info);
This function gets informations about the n used function relocation used by file.
n starts with 0.
In case of success, info will be filled with the informations.
int RExecModFile_LoadCode(RExecModFile_File *file, unsigned int start, unsigned int size, void *where);
This function loads code from file.
size bytes of code starting at start are going to be loaded.
start is relative to the start of code and 0 is the first byte of code.
int RExecModFile_LoadData(RExecModFile_File *file, unsigned int start, unsigned int size, void *where);
This function loads data from file.
size bytes of data starting at start are going to be loaded.
start is relative to the start of data and 0 is the first byte of data.
Uninitialized data are initialized with zero.
int RExecModFile_LoadROData(RExecModFile_File *file, unsigned int start, unsigned int size, void *where);
This function loads RO data from file.
size bytes of RO data starting at start are going to be loaded.
start is relative to the start of RO data and 0 is the first byte of RO data.
int RExecModFile_Open(const char *pathname, RExecModFile_File **file);
This function opens the module file pathname.
In case of success, file will contain file ID.
int RExecModFile_OpenFD(FSManager_Handle *fd, int prop, RExecModFile_File **file);
This function opens the module file fd, which must have been opened by the Open function of the FSManager interface.
prop must be zero or:
If this function fails fd won't be closed.
In case of success, file will contain file ID.