Avoid destroying the contents of registers. Or the program will die.
If you are adding your own code in Ghidra, you will, of course, need to install a jump out from the factory programme code into your code.
A common method is to override mov instructions, as they update registers with new values and these registers can be freely used in your own code (e.g. mapswitching).
In this example, overwriting two movs with the ‘J My_code’ command allows us to use the d15 and a2 registers.
One thing to keep in mind - we need to put the piece of original code we ‘destroyed’ at the very end of our program, so that the d15 and a2 registers regain their correct factory content.
If we need more registers (in fact, we always need them), having one data register and one address register is enough to store another in RAM and rebuild their contents at the end.
It is essential to remember this, reverse-engineering geeks. 😉
Nov 15
/
Thomas

We are a Car Tuning Academy centred around the Thomas Teaches Tuning project. We will teach you how to chip-tune your cars from the basics to the master level.
We will also teach you how to reverse-engineer ECUs and add your code to them.
Copyright © 2025
FEATURED LINKS
Crypto Accepted
I accept settlements in USDT, BNB and BTC.
Please contact me if you are interested in this payment method.
Please contact me if you are interested in this payment method.