th06 icon indicating copy to clipboard operation
th06 copied to clipboard

Initial Impl of objdiff toolchain

Open Renzo904 opened this issue 1 year ago • 0 comments

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:

  1. Using Ghidra-Delinker-Extension generate a cuff .obj of any class you want(Right Click on the class->Make Selection, then File->Export Program...)
  2. Select COFF relocatable object, check Selection Only, go to options and change Leading Underscore to Do Nothing
  3. Save it under [REPO PATH]/build/objdiff/asm/[ClassName].obj And 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.py and/or fix constructors/destructors names
  • [ ] Update/Create a readme.md with the instructions of setting up the files

Renzo904 avatar Aug 08 '24 09:08 Renzo904