News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Using GDB with Ghidra to edit ROMs. Guide.  (Read 1491 times)

FAST6191

  • Hero Member
  • *****
  • Posts: 3081
    • View Profile
Using GDB with Ghidra to edit ROMs. Guide.
« on: January 22, 2021, 01:54:14 pm »
Stumbled upon this earlier
https://wrongbaud.github.io/posts/ghidra-debugger/

In it the author details using Ghidra (the NSA's open source debugging software https://ghidra-sre.org/ , it and radare https://www.radare.org/r/ then being the open source world's answer to IDA https://www.hex-rays.com/products/ida/ which is very good but very expensive bit of paid software that many hackers use to pull programs apart) to speak to GBD using emulators, and in this case edit not a PC program as most usually do with that but a GBA ROM (and that opens the door to anything with GDB).
GDB is short for gnu debugger ( https://www.gnu.org/software/gdb/ ) which is a somewhat unified means by which many in the open source world and beyond can debug their programs.

Some emulators make a point of speaking to GBD but Ghidra only more recently got proper support for it (there were bridge programs before. Around here (and frankly for myself) not so many seem to use GDB but it can serve as something of a general purpose debugger you can use while you wait for various emulators to grow up and match fceux or the no$ series of debuggers internally.


Emulators that claim support for it.


GBA
mgba was used in the example.

vba and its various forks have had it for a while.

DS
Desmume has support for it

Have not played with others, and don't know what the tool assisted speedrun types are using these days. I imagine you can find it in many emulators though. Hopefully we can get a megadrive/genesis one too as it would be nice to have such things.

MysticLord

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: Using GDB with Ghidra to edit ROMs. Guide.
« Reply #1 on: January 24, 2021, 07:52:30 am »
Found a nice hex editor down that rabbit hole.

https://github.com/WerWolv/ImHex

Multi-platform, open source, designed for reverse engineering. Very nice.

FAST6191

  • Hero Member
  • *****
  • Posts: 3081
    • View Profile
Re: Using GDB with Ghidra to edit ROMs. Guide.
« Reply #2 on: January 24, 2021, 11:23:00 am »
That looked interesting, alas it appears to want all the newest versions of various libraries and my stuff is more on less experimental and more stable.

Still been looking for something to replace Bless with and that very well could be it.

MysticLord

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: Using GDB with Ghidra to edit ROMs. Guide.
« Reply #3 on: January 25, 2021, 01:32:55 am »
I've learned that it's unreasonable to expect software to developers who are keenly interested in the newest shiny thing to care enough for their users to not require it.

edit

To be fair, it's probably not the dev but the devs who maintain the dependencies he uses who are responsible for these requirements.
« Last Edit: January 25, 2021, 03:22:39 am by MysticLord »