General Info

Interface: RSysModFile
Files: rsysmodfile.h
Last change: 29/07/2002
Author: Luiz Henrique Shigunov
Description
Structures
System module file format
Functions

0x00 - Close - Close a module file
0x01 - GetFuncsInfo - Get informations about functions
0x02 - GetImpInfo - Get informations about implementations
0x03 - GetInterInfo - Get informations about interfaces
0x04 - GetModuleInfo - Get informations about a module

0x05 - GetUsedFunc - Get informations about a used function
0x06 - GetUsedFuncReloc - Get informations about a used function relocation
0x07 - LoadCode - Load module's code
0x08 - LoadData - Load module's data
0x09 - Open - Open a module file

Description

This page describes the RSysModFile interface which provides access to system module files.

The system modules file reader provides informations about system modules files, including module data, code, data, functions, used functions, relocations, etc.

Structures

typedef struct {
    unsigned int codeStart;
    unsigned int prop;
} RSysModFile_FunctionInfo;

typedef struct {
    const char *name;
} RSysModFile_ImpInfo;

typedef struct {
    const char *name;
    unsigned int nFunctions;
} RSysModFile_InterInfo;

typedef struct {
    char md5[16];
    const char *comment;
    void *phase0Start;
    void *phase1Start;
    void *shutdown;
    unsigned int codeSize;
    unsigned int dataSize;
    unsigned int version;
    unsigned int prop;
} RSysModFile_ModuleInfo;

typedef struct {
    const char *interface;
    const char *imp;
    unsigned int function;
} RSysModFile_UsedFuncInfo;

typedef struct {
    const char *interface;
    const char *imp;
    unsigned int function;
    unsigned int offset;
    unsigned int prop;
} RSysModFile_UsedFuncRelocInfo;

All names can't be changed because they are the original name, not a copy.

0x00 - Close

Syntax

int RSysModFile_Close(RSysModFile_File *file);

Properties

Description

This function closes file.

Return value

0x01 - GetFuncsInfo

Syntax

int RSysModFile_GetFuncsInfo(RSysModFile_File *file, unsigned int interface, unsigned int imp, RSysModFile_FunctionInfo *info);

Properties

Description

This function gets informations about all functions from implementation imp from interface from file.

info must be an array with at least the same number of positions as the number of functions from interface.

If all goes ok, info will be filled with the informations.

Return value

0x02 - GetImpInfo

Syntax

int RSysModFile_GetImpInfo(RSysModFile_File *file, unsigned int interface, unsigned int imp, RSysModFile_ImpInfo *info);

Properties

Description

This function gets informations about implementation imp from interface from file.

interface is the same number used on GetInterInfo.

If all goes ok, info will be filled with the informations.

Return value

0x03 - GetInterInfo

Syntax

int RSysModFile_GetInterInfo(RSysModFile_File *file, unsigned int interface, RSysModFile_InterInfo *info);

Properties

Description

This function gets informations about interface from file.

interface is the same number used on GetFuncInfo.

If all goes ok, info will be filled with the informations.

Return value

0x04 - GetModuleInfo

Syntax

int RSysModFile_GetModuleInfo(RSysModFile_File *file, RSysModFile_ModuleInfo *info);

Properties

Description

This function gets informations about module file.

If all goes ok, info will be filled with the informations.

Return value

0x05 - GetUsedFunc

Syntax

int RSysModFile_GetUsedFunc(RSysModFile_File *file, unsigned int n, RSysModFile_UsedFuncInfo *info);

Properties

Description

This function gets informations about the n function used by file.

n starts with 0.

If all goes ok, info will be filled with the informations.

Return value

0x06 - GetUsedFuncReloc

Syntax

int RSysModFile_GetUsedFuncReloc(RSysModFile_File *file, unsigned int n, RSysModFile_UsedFuncRelocInfo *info);

Properties

Description

This function gets informations about the n used function relocation used by file.

n starts with 0.

If all goes ok, info will be filled with the informations.

Return value

0x07 - LoadCode

Syntax

int RSysModFile_LoadCode(RSysModFile_File *file, unsigned int start, unsigned int size, void *where, void *codeStart, void *dataStart);

Properties

Description

This function loads code from file.

dataStart is a pointer to the start of module's data, codeStart is a pointer to the start of module's code and where is where code is going to be loaded.

dataStart and codeStart are used to make relocations on code.

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.

Return value

0x08 - LoadData

Syntax

int RSysModFile_LoadData(RSysModFile_File *file, unsigned int start, unsigned int size, void *where, void *codeStart, void *dataStart);

Properties

Description

This function loads data from file.

dataStart is a pointer to the start of module's data, codeStart is a pointer to the start of module's code and where is where data is going to be loaded.

dataStart and codeStart are used to make relocations on data.

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.

Return value

0x09 - Open

Syntax

int RSysModFile_Open(const char *pathname, RSysModFile_File **file);

Properties

Description

This function opens module file pathname.

If all goes ok, file will contain file ID.

Return value