LanHikari22 / C-ROM-Linker

This is a C ROM Linker that essentially takes a relocatable combined object file of a C project and injects all global variables and functions from the object file into the ROM file! You can compile and link your C project directly into a game ROM! This is currently only supporting the ARM7TDMI architecture.
1 stars 0 forks source link

To be developed: Interceptor functions #7

Open LanHikari22 opened 6 years ago

LanHikari22 commented 6 years ago

Interceptor functions that inject into the ROM both their logic AND and where they are to be called. They intercept other functions by adding assembly code for their execution inside the calling function. When they are executed, they contain the assembly code that has been overwritten from the caller function to call them. This way, they wouldn't corrupt the calling function. Their original content would be directly after the overwritten content.

In the C file, an interceptor function takes the form of: intercept_() For example: void intercept_08040000(); Would declare that the intercepting logic be executed at the address 0x40000 in ROM, and the actual location of the function would be located by the linker.