Emulator debugging? Cheat/mod creation.

Rydian

Resident Furvert™
OP
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
So with Cheat Engine's debugging functions for PC games I just generally find an address of a value, then use the "what accesses this address" and "what writes to this address" right-click options to find the lines of assembly that do whatever regarding it, so I can edit them as needed. I'm aware this is like setting breakpoints and then halting at the instruction there (CE does more stuff too, like log the two instructions before and after, and the registers at the time of that single one).

So I want to do it with emulators, too. The only one I've been able to figure out is Geiger's SNES9X debug build.

shot.png


I can put in an address as the breakpoint and the emulator/debugger breaks at the instruction that modifies that address (in this case the address is coins, and the opcode is the one that increments the coin amount). It gives me INC $0DBF for the line that does it, so I Googled 6502 assembly to find the NOP is EA, so I added the three GG codes (ROM modification, and it's three bytes in the original line so three modifications) you see in the right window, to stop the number of coins from incrementing when you collect one, and it seems to work. So I'd call this a success for a start.

But that's it. I couldn't figure out how to set breakpoints or things like that in no$sns, and Idunno' which debuggers for other systems (Genesis, NES, GB/C, GBA, DS, etc.) have this kind of workflow geared towards making cheats/modifications.

Any clues?

I'm not familiar with the older-style way of reading/writing/moving memory around or conditional jumps or anything like that, but I suppose I'll just have to Google for guides on that part, once I know which tools to use and how to use them.
 

smealum

growing up sucks.
Member
Joined
May 1, 2006
Messages
635
Trophies
2
Age
31
Location
SF
Website
www.smealum.net
XP
2,516
Country
United States
no$gba's debugger edition (which costs $15) can do that stuff pretty well. you can set standard breakpoints as well as "global memory conditional breaks" (not sure that's exactly what they're called) which allow you to stop execution when a certain piece of memory is modified, or more specifically when it's made bigger/smaller than a given value etc. you can also assemble instructions into memory on the fly which can be pretty handy. this should get you going for both DS and GBA games.
for the DS there's also desmume's GDB hook which I guess could be pretty handy, but I've never tried it myself so I can't really help you with that.
at any rate, if you're serious about doing this kind of thing for GBA/DS games, you'll probably have to learn some ARM assembly. it's generally not very complicated, learning the basics doesn't take very long. I suggest you take a look at TONC's guide if you're interested : http://www.coranac.com/tonc/text/asm.htm
 
  • Like
Reactions: MikeHawke

ichichfly

Well-Known Member
Member
Joined
Sep 23, 2009
Messages
619
Trophies
1
XP
1,075
Country
Gambia, The
So you want something like a plug-in for the Cheat Engine. So you can use the Cheat Engine to debug the games ?
 

Rydian

Resident Furvert™
OP
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
So you want something like a plug-in for the Cheat Engine. So you can use the Cheat Engine to debug the games ?
Nah since CE's just for x86, I was looking for something with a similar workflow. I find a memory address, find the lines of code that read/write, and can modify it.

Most of the tools I've seen are missing some of those steps, assuming you'll be using other programs to do that.

So it looks like SNES and GBA/DS is covered (don't have time now to fiddle around with the DS/GBA stuff, but I know I can take Smealum's word for those), I think NES, Genesis, and maybe GB/C are the only other systems I'd care to do this with. I know about no$GMB/C, but it's interface scares me. :(
 

Rydian

Resident Furvert™
OP
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
Its is theoretically possible to make a plug-in for the CE that connects to the emulator and debug rom (of cause most of the tools won't work).

Add: It would need some time but it should work
Ah. While I can usually search an emulated game's RAM by searching through mapped memory (disabled by default due to being slow), I know that'd need work per-emulator, which is why I assumed I'd be better off getting emulators with this stuff built-in.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Nut on the hill