th06
th06 copied to clipboard
Initial Impl of objdiff toolchain
First implementation of a objdiff toolchain
How it works:
It uses the Ghidra-Delinker-Extension to generate .obj files with the original asm. Since that extensions doesn't support decorated names for the symbols, we have to rename the decomp ones from MSVC decorated names, to just the Function name using both nm and objcopy. Right now its "usable", but in my opinion its nowhere near to complete, i dont think it should be merged now.
The major problem are the differences marked in functions calls and diffable variables, which are not linked yet and thus, are null
The steps to make it work are:
- Using Ghidra-Delinker-Extension generate a cuff .obj of any class you want(Right Click on the class->
Make Selection, thenFile->Export Program...) - Select
COFF relocatable object, checkSelection Only, go to options and changeLeading UnderscoretoDo Nothing - Save it under
[REPO PATH]/build/objdiff/asm/[ClassName].objAnd with the build toolchain set up you should be good to go to just open objdiff and click build.
TODO:
- [x] Create a ExportDelinker.java ghidra's script that automatically generates all the necessary objects files
- [x] Find a better way to deal with MSVC Decorated Names at
generate_objdiff_objs.pyand/or fix constructors/destructors names - [ ] Update/Create a readme.md with the instructions of setting up the files