Dolphin, the GameCube and Wii emulator - Forums
Using debug symbols from a game disc - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion)
+--- Thread: Using debug symbols from a game disc (/Thread-using-debug-symbols-from-a-game-disc)



Using debug symbols from a game disc - piconej - 08-19-2014

Hi, I'm currently fiddling around with the code and resources of a Wii game - 'Naruto Shippuuden Gekito Ninja Taisen Special'. The game disc includes a file that looks like it contains some kind of symbolmap. It's called cmd_str.tbl, and the first few bytes look like this:

Code:
00 00 00 19 00 00 00 00 62 61 63 6B 75 70 5F 73
61 76 65 75 70 64 61 74 65 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 01
62 61 63 6B 75 70 5F 6C 6F 61 64 75 70 64 61 74
65

That is, an eight-byte number followed by the string "backup_saveupdate", some zero-padding, another eight-byte number (1 larger than the previous one) followed by the string "backup_loadupdate". It continues like this for ~112kb. Bunch of function names, a number of which are pretty relevant and definitely game-specific.

The format resembles the totaldb.sys file included with Dolphin, but with a rather different range of numbers. Dolphin doesn't appear to do anything if I try to load it as a signature file, though.

I'm very new to using Dolphin for debugging purposes. Does the file follow some kind of standard Wii debug-symbol format? Can Dolphin read it?

Thanks.


RE: Using debug symbols from a game disc - skid - 08-19-2014

It depends on the data. From the extract that you have provided, it does not look like a symbol map that can be used by Dolphin. A usable map would point each symbol to a memory address that is in this range:

0x00003F00 - 0x0132c100
or
0x80003F00 - 0x8132c100 (mirror)

Refer to the memory map of the GC/Wii here:
http://wiibrew.org/wiki/Memory_Map


RE: Using debug symbols from a game disc - piconej - 08-19-2014

(08-19-2014, 10:34 PM)skid Wrote: It depends on the data. From the extract that you have provided, it does not look like a symbol map that can be used by Dolphin. A usable map would point each symbol to a memory address that is in this range:

0x00003F00 - 0x0132c100
or
0x80003F00 - 0x8132c100 (mirror)

Refer to the memory map of the GC/Wii here:
http://wiibrew.org/wiki/Memory_Map

Also the values out the front aren't aligned. But they definitely look like function names. For example:

00 00 00 2C 00 00 00 02 "game_setupdround"

There's also some mathematical functions:

00 00 00 04 00 00 00 0F "i_div"

A closer inspection suggests to me that the first four-byte number is a category - 'game_' functions are 2c, 'i_' are 04, etc. - and the second four-byte number is an index inside that category. Is there any precedent for symbol representation like that in Wii games? I don't have a great deal of experience in the field...


RE: Using debug symbols from a game disc - delroth - 08-20-2014

You realize the file is basically called "command string table" right...?


RE: Using debug symbols from a game disc - piconej - 08-20-2014

(08-20-2014, 01:53 AM)delroth Wrote: You realize the file is basically called "command string table" right...?

Yes, but I'm not sure what you're getting at. The file isn't loaded at runtime as far as I can tell. The strings are definitely function names. The jump to 'some kind of debug data' doesn't seem huge to me, especially given that the disc is littered with leftover dev stuff - .svn directories, batch files for the build process, assets from previous games in the series, empty directories.

I've found a rather long table of pointers to functions in memory while the game's running, maybe the indices point into that table. Or maybe I have no idea what I'm doing.