Emulator debugging? Cheat/mod creation.

Discussion in 'Computer Programming, Emulation, and Game Modding' started by Rydian, Mar 20, 2013.

Mar 20, 2013
  1. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    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.

    [​IMG]

    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.
     
    Zetta_x likes this.
  2. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Bump?
     
  3. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Bump again?

    Come on, nobody? Are all the hackers/modders really gone now?
     
  4. smealum

    Member smealum growing up sucks.

    Joined:
    May 1, 2006
    Messages:
    626
    Location:
    SF
    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
     
  5. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Thanks!
     
  6. ichichfly

    Member ichichfly GBAtemp Advanced Fan

    Joined:
    Sep 23, 2009
    Messages:
    618
    Country:
    Germany
    So you want something like a plug-in for the Cheat Engine. So you can use the Cheat Engine to debug the games ?
     
  7. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    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. :(
     
  8. ichichfly

    Member ichichfly GBAtemp Advanced Fan

    Joined:
    Sep 23, 2009
    Messages:
    618
    Country:
    Germany
    You can overwrite the disassembler function
     
  9. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    What do you mean?
     
  10. ichichfly

    Member ichichfly GBAtemp Advanced Fan

    Joined:
    Sep 23, 2009
    Messages:
    618
    Country:
    Germany
    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
     
  11. Rydian
    OP

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    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.
     

Share This Page