• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Game Modifications › Cheats, Hacks, & Game Patches v
« Previous 1 ... 5 6 7 8 9 ... 19 Next »

Finding my way around Debug Mode
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Finding my way around Debug Mode
07-06-2020, 12:41 PM
#1
Hysteria
Unregistered
 
Hope this is the right subforum for this  Angel

I'm trying to learn my way around Dolphin's debug mode - particularly so I can learn a bit more about how my favourite games are put together, and maybe develop a patch or two for a few minor bugs and issues that exist. Thanks to this tool's logger, I've already found a few issues with one particular game that I didn't know existed - they don't seem to cause any obvious problems, so to speak, but they're still issues.

Unfortunately, I'm not finding too many resources on Dolphin's debug mode, so it's all very much me experimenting blind at the moment. I've gone and generated a symbol map for the game's primary DOL file out of Ghidra and applied that to Dolphin, and I'm going from there. Right now I'm hoping to identify what a given function broadly does, and then rename it in the symbol file to match.

Running 5.0-12219 - When I run the game, I get the current callstack and the symbols sections populated, however nothing shows up in the Function Calls or Function Callers sections. I'm rather hoping the Function Calls section will turn out to be an ordered list of every function the game has called up until current time - that would be very helpful to me, to see what's called upon, say, loading a new area, etc. Does something like that exist?

--

I've also tried 4.0.2, as I've heard some debug functionality exists in that version that isn't in 5.0. However, it's not running too well for me yet - it once gave me a stack overflow for resizing a column, and the game itself regularly fails to boot due to audio issues. I've put this version aside for the moment, though if 4.0 is worth pursuing, I'll have to experiment with Dolphin's config to see if I can get past that.
Reply
07-08-2020, 06:36 AM
#2
Modception Offline
Junior Member
**
Posts: 18
Threads: 0
Joined: May 2020
I'm not sure what a symbol map made with Ghidra looks like, could you post an example for dolphin? Do you load the symbol map into dolphin?

If you want to change ASM code, I suggest using: https://github.com/TheGag96/CodeWrite/releases

The function calls/callers is generated when I do. Symbols -> generate symbols from -> symbol database.
Function calls are other functions that are called from the current function (bl, branch links).
I think function callers is a list of branch links that point to the current function.
Callstack is a list of every function above the current function, that will be returned to and is the closest thing you'll get to a list of "every function the game has called up until current time".

There is a function recorder being worked on: https://github.com/dolphin-emu/dolphin/pull/8732

I would keep working with the newer versions of Dolphin.
Find
Reply
07-12-2020, 01:52 PM
#3
Hysteria
Unregistered
 
Thanks for the info Cool

The Ghidra symbol map didn't seem to be 100% compatible with Dolphin right off the bat. As I recall, it came with the .data section layout, but not with the .text section layout.

Code:
.data section layout
  8000c000 000040 8000c000  4 FUN_8000c000     Global
  8000c040 389fd0 8000c040  4 FUN_8000c040     Global
  8000c178 00001c 8000c178  4 FUN_8000c178     Global
  8000c194 0000c0 8000c194  4 FUN_8000c194     Global
  8000c254 000020 8000c254  4 FUN_8000c254     Global
  8000c274 000034 8000c274  4 FUN_8000c274     Global

I honestly can't remember if this caused the load of the symbol map to fail, or if it was just obvious from reading it during use that there was something missing - but in either case, to fix it, I just made Dolphin generate a symbol map of its own. This map included the missing .text section - all I had to do then was plug in Ghidra's version of the .data section into the file, and I had the best of both worlds.

Thanks for the info on the function calls/callers, and the function recorder being worked on. I think that'd be very helpful to me. I'm sure given time I'd be able to make sense of the output given to me from Dolphin, and work with Ghidra to work out what the function in question actually does - but I'm really short on time at the moment Sad It's gonna be slow-going for a little while, lol.
Reply
07-13-2020, 03:48 PM
#4
Modception Offline
Junior Member
**
Posts: 18
Threads: 0
Joined: May 2020
Strategically inserting nop and blr can help you figure out what a piece of code does. blr the start of a function to prevent it from running, nop a bl to skip a function call, nop arithmetic, etc.

It would be nice if there was an inline assembler to change instructions easily. Can do it with codewrite and memory editing though.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode