ldr_exports

ldr_exports —

Synopsis




gboolean    captive_kernel_exports          (void);
gboolean    captive_kernel_patches          (void);
gboolean    captive_ModuleList_add_builtin  (const gchar *FullName_utf8,
                                             ...);
gboolean    captive_ModuleList_patch        (const gchar *FullName_utf8,
                                             ...);

Description

Details

captive_kernel_exports ()

gboolean    captive_kernel_exports          (void);

Export complete libcaptive modules to reactos. It is done by *.def files used by dlltool(1) of Mingw32 compiler suite. We use native host OS compiler and we also have just a limited set of functions over reactos itself. We use our captive_ModuleList_add_builtin() to simulate PE headers exporting our symbols; this export simulation is invocated from this function.

This function is generated automatically from exports.captivesym file by captivesym.pl script.

Multiple calls of this function are forbidden. See also captive_kernel_patches().

Returns : TRUE if the export was successful.

captive_kernel_patches ()

gboolean    captive_kernel_patches          (void);

Patches W32 libraries by libcaptive functions. It is done by *.def files used by dlltool(1) of Mingw32 compiler suite. We use native host OS compiler and we also have just a limited set of functions over reactos itself. We use our captive_ModuleList_patch() to modify existing module function tables generated from captive_ModuleList_add_builtin().

This function is generated automatically from exports.captivesym file by captivesym.pl script.

Multiple calls of this function are forbidden. See also captive_kernel_exports().

Returns : TRUE if the export was successful.

captive_ModuleList_add_builtin ()

gboolean    captive_ModuleList_add_builtin  (const gchar *FullName_utf8,
                                             ...);

Adds simulated built-in module to ModuleListHead module list. It can be used for the functionality of reactos/ntoskrnl/ldr/loader.c/LdrInitModuleManagement(). libcaptive does not support Ordinals - we just pretend liner (0-based) Ordinal numbers of the functions in given @... stdargs order.

FullName_utf8 : String to fill in PMODULE_OBJECT->FullName.
... : (const gchar *sym_name,void *sym_val) symbol list terminated by NULL.
Returns : TRUE if the module was successfuly added.

captive_ModuleList_patch ()

gboolean    captive_ModuleList_patch        (const gchar *FullName_utf8,
                                             ...);

Patches existing FullName_utf8 module to use for function named sym_name pointer to the handler sym_val. If patchpoint is not NULL it gets assigned the original pointer value (used for pass keyword in exports.captivesym).

Put here 0xF4 'hlt' instead of 0xCC 'int $0x3; breakpoint' as 'hlt' will generate handled SIGSEGV instead of SIGTRAP which is used by gdb(1) during debugging. See also libcaptive/ps/signal.c/ sigaction_SIGSEGV().

FullName_utf8 : String to find PMODULE_OBJECT by FullName.
... : (const gchar *sym_name,void (*sym_val)(void),struct captive_ModuleList_patchpoint *patchpoint) symbol list terminated by NULL.
Returns : TRUE if the module was successfuly added.