Memory/Source Code Help

Discussion in 'NDS - ROM Hacking and Translations' started by Kholdy, May 25, 2017.

  1. Kholdy
    OP

    Kholdy Newbie

    Newcomer
    5
    0
    Jan 4, 2017
    United States
    I'm trying edit a rom so classes are unlocked at the start of the game. So far, I've found an AR code that lets me do that.

    5213C5A4 E5941008
    0213DF38 EBFD1C64
    0213DF50 EBFD1C5E
    D0000000 00000000

    This edits the memory locations 0213DF38 and 0213DF50 with 32-bit values, and I confirm this work by editing them in manually using the Memory Viewer. However, is it possible to translate this editing into the source code of the rom?

    EDIT: Fortunately I have already found a workaround for this. There is a program called DSATM that converts AR codes into ARM.
     
    Last edited by Kholdy, May 25, 2017
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,355
    9,148
    Nov 21, 2005
    Yes, but depending upon the method you ultimately use it might not be that easy.

    What game is it? If we can't look at it to see what it is then we are more limited in what we can do directly, and will have to go more theoretical.
    If you are not familiar with decoding DS cheats then
    http://doc.kodewerx.org/hacking_nds.html

    Still.
    1) Should get the job done but maybe not the most elegant.
    DSATM.
    A tool that converts cheats to be always run in a game.
    http://gbatemp.net/threads/ds-auto-trainer-maker-dsatm.80540/
    Download
    https://filetrip.net/nds-downloads/utilities/download-dsatm-5-1-f31528.html

    2) That location in the memory may well be the binary of the game when it is loaded into memory. If it is then you can edit the ARM9.bin file and overwrite the relevant section.
    NDSTS among other things ( http://www.no-intro.org/tools.htm ) will tell you where the binary is loaded into memory, and from there you can work out where in the binary that would fall (if the binary is loaded to 2100000 then the cheat 0213DF38 will fall 3DF38 into the uncompressed binary.
    Possible trip up would be compression, though it is easy enough to solve as the compression method used for DS games is well known and handled by loads of tools. Crystaltile2 may say it is compressed when it is not but will handle it (click the DS icon on the far right, find arm9.bin and right click it, decompress will be an option).

    3) You either recreate what DSATM does or do something a bit closer to the game.
    Gamesharks, action replays and the like edit memory, they do it by hooking the game and writing a value to memory and that way the game never lets you run out of bullets or whatever. DSATM will do much like this but automated, you can do it too if you want.
    Said memory locations will also be the point of reference for the game code. It is all well and good having something force a health value to be some positive value, however if you mod the game such that the game never checks the health, or never does anything "negative" with the results then even better.