encounter / objdiff

A local diffing tool for decompilation projects
Apache License 2.0
77 stars 13 forks source link

ARMv4T (GBA) and ARMv6K (3DS) support #75

Closed AetiasHax closed 2 weeks ago

AetiasHax commented 2 weeks ago

I've implemented support for v4T (GBA) and v6K (3DS) and tested with agbcc and armcc. Both compilers emit the .ARM.attributes section, which makes it possible to auto-detect the ARM version being used. Parsing the section was more complicated than I was hoping, so I developed a new crate called arm-attr to do the magic for us.

Since mwcc (DS compiler) doesn't emit the attributes section, the ARM version falls back to v5TE when no version info is found. If needed, there's a dropdown in "Arch Settings" to override any auto-detection.

agbcc sets the LSB for Thumb symbols, which meant that all Thumb code was shifted over by one byte and got displayed wrong. To solve this, I've added ObjArch::symbol_address which is called when resolving symbols, and ObjArchArm overrides the default behavior by clearing the LSB.

encounter commented 2 weeks ago

Thanks a ton for this work!