kinnay / Wii-U-Debugger

Wii U debugger with breakpoints and more
GNU General Public License v3.0
18 stars 2 forks source link

[Feature Request] Add Memory / Watch Breakpoints #1

Open SuperMarioDaBom opened 5 years ago

SuperMarioDaBom commented 5 years ago

How feasible would it be to add memory / watch breakpoints? (Meaning breakpoints that get tripped whenever a read / write is performed to the specified area in memory.) It'd be very helpful tool for game reverse engineering.

kinnay commented 5 years ago

Memory watchpoints are quite difficult to implement. There are two ways to do this:

salmon0123 commented 4 years ago

I can verify that the DABR is functional on my kiosk Wii U; if I call OSSetDABR() with the appropriate arguments, the Wii U crashes when the read/write breakpoint is hit. I can then go through the crash logs and find the ASM address which triggered the read/write. It's tedious, but at least working.

The function does not do anything on my retail Wii U, however. Getting the DABR working on retail would probably require a patch to the PPC kernel. As mentioned here, the syscall for setting the DABR doesn't even do anything if it sees a certain flag is set. There are probably even more checks to patch out once the DABR exception is actually taken.

I've done tests before to write patches to the kernel, to no avail. But I'm sure would be theoretically possible to get the DABR working...

kinnay commented 4 years ago

Thanks, that's good to know. The debugger already has functions that let me write directly to physical memory, so it shouldn't be difficult to patch away the check in the kernel.