Relocation support for MIPS R4000 for the MSCoffLoader #9458
|
So, I want to implement a CoffRelocationHandler for the MSCoffLoader when the processor is a MIPS R4000 but I don't know where to start or how big of a task it will be. For some context, I'm exploring some old windows programs and a partial compilation, and ghidra could not load the object files: "No COFF relocation handler for machine type 0x166" Can you direct me to a start point? |
Replies: 1 comment 1 reply
|
Take a look at this class as a starting point: https://github.com/NationalSecurityAgency/ghidra/blob/master/Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/coff/relocation/X86_64_CoffRelocationHandler.java As long as your new class name ends with I am not sure if you know how to develop a Ghidra Extension so I will leave things here for now. |
Take a look at this class as a starting point: https://github.com/NationalSecurityAgency/ghidra/blob/master/Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/coff/relocation/X86_64_CoffRelocationHandler.java
As long as your new class name ends with
...CoffRelocationHandler, Ghidra will automatically pick it up as a relocation handler. You'll need to implement thecanRelocation()method such that it only returns true if thefileHeaderindicates it's MIPS R4000.I am not sure if you know how to develop a Ghidra Extension so I will leave things here for now.