[Example Plugin] Updated the example plugin to override the OSFatal function.

The new OSFatal function logs the old message, and the calls the "real" OSFatal with a new String.
[General] - Added the .sdata section to the wups.ld
- Added all library_types to the enum
- Updated the wups_loader_entry_t struct to store the needed data
- Simplified the WUPS_MUST_REPLACE macro
- Removed unneeded stuff
This commit is contained in:
Maschell
2018-02-10 14:56:07 +01:00
parent 10c5eccd93
commit b6119fde91
3 changed files with 98 additions and 60 deletions

View File

@@ -11,21 +11,18 @@ WUPS_MODULE_VERSION("v1.0");
WUPS_MODULE_AUTHOR("Maschell");
WUPS_MODULE_LICENSE("BSD");
int func(void);
static int my_func2(void)
{
DECL_FUNCTION(void,OSFatal,char * msg){
InitOSFunctionPointers();
InitSocketFunctionPointers();
log_init();
//log_printf is not working.
log_print("Logging from custom function.\n");
return 43;
log_print(msg);
log_print("\n^--- Someone called OSFatal with this string. Lets modify it. Bye bye =(\n");
real_OSFatal("Does the replacement work?");
return;
}
WUPS_MUST_REPLACE(func,WUPS_LOADER_LIBRARY_GX2, my_func2);
WUPS_MUST_REPLACE(OSFatal,WUPS_LOADER_LIBRARY_COREINIT, OSFatal);