Giter Site home page Giter Site logo

lanhikari22 / c-rom-linker Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4.43 MB

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.

Batchfile 3.53% Python 4.97% Java 61.92% Makefile 6.90% C 22.64% C++ 0.04%

c-rom-linker's People

Contributors

lanhikari22 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

c-rom-linker's Issues

To be developed: Snapshot Functions

They take the form:
void snap<NUM_SNAPS>_<ABS_ROM_ADDR>();
An example:
void snap10_08040000();

What this does, is that it is going to intercept at 0x08040000 (0x40000 in ROM), 10 times, for 10 different assembly instructions.
When intercepting, the logic at that instruction has to be modified to include branching logic. This must be accounted for to determine where the next instruction is, so that another intercept occurs there.

Basically, for every one instruction run in a function, it will be intercepted by the logic in the snapshot function. This can be useful to view a (almost complete) state view of the intercepted function. This can be very useful for diagnostics.

Static variables and function static variables are not supported

This is because they are treated differently in the combined relocatable object file.
They do not have a type OBJECT like other global variables. They have a type of NOTYPE.
Further, function static variables also have a strange syntax to their naming. .4158 for example, or something similar. That needs to be decoded to figure out how to deal with those variables.

To be developed: Interceptor functions

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_<ABS_ROM_ADDR>()
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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.