NTR 3.0 Plugin/Cheat Creation

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by EllioneDHunter, Aug 10, 2015.

  1. EllioneDHunter
    OP

    EllioneDHunter GBAtemp Regular

    Member
    116
    50
    Aug 5, 2015
    United States
    Killinois
    For the life of me, I can't seem to understand how to create a cheat.plg to use on my games. I know that I should be able to convert code from ARCode but there's no easy way to do it. I'm not a coder but I can read lines enough to follow a tut but there's not really one out there. I have Python installed, 9.5 emuN+NTR 3.0, and programmer's notepad and I don't know how I would sort the codes and compile it into a cheat.plg.
    Here are the codes, I just don't know how it should be positioned in programmer's notepad.
    Warning: Spoilers inside!
     
    Margen67 likes this.
  2. DarkFlare69

    DarkFlare69 GBAtemp Psycho!

    Member
    4,765
    2,619
    Dec 8, 2014
    United States
    Ohio
    A good tutorial is somewhere in my liked posts... long lost.
     
    Margen67 likes this.
  3. dfsa3fdvc1

    dfsa3fdvc1 GBAtemp Regular

    Member
    215
    94
    Jan 3, 2015
    Albania
  4. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,800
    535
    Sep 20, 2005
    those are fcram address not virtual memory address, which ntr uses
    any code address above 03xxxxxx won't work on ntr
    you will need a fcram dump and a 00100000 memory region dump from ntr if you want to convert them to work on ntr

    here's FEA source code from thinhvnn, it's already using virtual memory address
    http://gbatemp.net/threads/ntr-cfw-3-0.393710/page-17#post-5598164
     
  5. samiam144

    samiam144 Régulier

    Member
    2,872
    936
    Aug 19, 2007
    Canada
  6. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,800
    535
    Sep 20, 2005
    it needs a separate .plg for displaying text in ntr menu, znote or something, for game notes, guides, etc..
     
    samiam144 likes this.
  7. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,164
    9,523
    Sep 23, 2013
    tbh i just searched ram dumps with cheat engine and made my own codes with beyond the labyrinth, can take a few tries finding which memory region contains what it is your looking for, but once you find it most of the other stuff you would want to mod will be stored nearby
     
  8. dfsa3fdvc1

    dfsa3fdvc1 GBAtemp Regular

    Member
    215
    94
    Jan 3, 2015
    Albania
    How do you use Cheat Engine with the Ram Dumps? I get that you'd use the NTR Debugger to create a RAM dump when a value changes to narrow down results but how do you use Cheat Engine's features with these dumps? The only way I've ever used CE before is hooking into a process.

    Oh, and what part of memory on the 3DS do you dump? What addresses are game data? I know the NTR debugger has kernel access and can be dangerous. (I guess this wouldn't be an issue with just reading but just to be safe)

    Thanks.
     
  9. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,164
    9,523
    Sep 23, 2013
    so thats a rough guide, but for example when i was making the beyond the lab codes i was doing it more like
    data(0x08000000, 0x00522000, filename='p1-500hp-p2-600hp-p3-700hp.bin', pid=0x29)
    loose hp
    data(0x08000000, 0x00522000, filename='p1-400hp-p2-500hp-p3-600hp.bin', pid=0x29)
    loose more hp
    data(0x08000000, 0x00522000, filename='p1-300hp-p2-400hp-p3-500hp.bin', pid=0x29)

    from there i can use the open file function on cheat engine to do searches like the good old action replays and search for more than one offset with each dump, so first i find P1's HP, then P2's, then player 3's etc etc

    PS once you have the offset, say for example P1 HP is 0x921a4 in cheat engine you add this to the base offset of your dump so the final offset would be 0x80921a4, from there you can test it out before adding it to your plugin by using the write command eg

    write(0x80921a4, (0x0F, 0x27), pid=0x29)
     
    Last edited by gamesquest1, Aug 11, 2015
  10. dfsa3fdvc1

    dfsa3fdvc1 GBAtemp Regular

    Member
    215
    94
    Jan 3, 2015
    Albania
    Awesome man. If possible could you attach your Beyond the Labyrinth plugin in a reply? I started playing that as well. The combat is pretty tedious though but I'm for some reason still interested in it.

    I suppose I could make the cheat myself thanks your fantastic post but no reason to re-invent the wheel, lol.
     
  11. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,164
    9,523
    Sep 23, 2013
    heres the link
    https://gbatemp.net/threads/transla...ond-the-labyrinth.379598/page-11#post-5602953
     
    dfsa3fdvc1 likes this.
  12. dfsa3fdvc1

    dfsa3fdvc1 GBAtemp Regular

    Member
    215
    94
    Jan 3, 2015
    Albania
    Awesome man. I'm gonna have to add a Wait Time resetter. I used 4 max charge attacks in a row setting my wait time to 99 for all characters. I had to no joke wait 4 minutes till I could attack again.
    Even with cheats this game is tedious as hell.
     
  13. MichiS97

    MichiS97 "Leftist snowflake milennial"

    Member
    GBAtemp Patron
    MichiS97 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,376
    777
    Jun 14, 2011
    Germany
    Munich
    Just because it's kinda on topic, could somebody please explain how to deal with dynamic addresses?
     
  14. PandaMayFire

    PandaMayFire GBAtemp Regular

    Member
    287
    86
    Jan 24, 2015
    United States
    Well I was interested in creating some of these, but now I see this is beyond me. I don't have enough experience for this kind of stuff :wacko:
     
  15. metallichatte

    metallichatte Member

    Newcomer
    21
    4
    May 25, 2015
    France
    hello,

    someone have a cheat plugin for monster hunter 4 (eur ),please ?

    i try by myself but no result ( big noob ! )

    or if someone have a good tutorial with step by step for create a cheat plugin
     
  16. MichiS97

    MichiS97 "Leftist snowflake milennial"

    Member
    GBAtemp Patron
    MichiS97 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,376
    777
    Jun 14, 2011
    Germany
    Munich
    Well just play around a little bit, you'll get the hang of it, I promise ;)
     
  17. NicEXE

    NicEXE GBAtemp Fan

    Member
    397
    124
    Dec 6, 2009
    Cyprus
    Basically you need to do a ram dump (or several to get greater understanding of where your value is stored) with NTR, you need to find the offset you want to modify and you are doing it using this syntax:
    <offset> <value>
    each should be 16 bytes (prepend with 0s if necessary)
     
  18. MichiS97

    MichiS97 "Leftist snowflake milennial"

    Member
    GBAtemp Patron
    MichiS97 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,376
    777
    Jun 14, 2011
    Germany
    Munich
    You will always need several RAM dumps, only one won't give you an exact result and you'd need to try hundreds of different addresses if you're not unlucky.

    What you said about the 16 bytes thing is wrong, what you mean is 16 bits = 2 bytes and that is also not quite the case. When you're using the NTR debugger alone to modify your RAM aka write data to the RAM you need to write at least 2 bytes. Say if you'd want to write the value 0x02 to the address 0x00001234, you have to write a value to 0x000001233 or 0x00001235 as well since you need at least two bytes. Now, simply taking the value 0x00 for the second byte is a bad idea since this could overwrite crucial data for the game with a wrong value and therefore potentially mess up your save file. What you should do is read what value is stored at the address before or after the address you want to write to. Let's say you want to write to the address 0x00001234 again. Read the value at address 0x00001233 by using the command "data(0x00001233, 0x1, pid=0x??). The first number in the parentheses is the address you want to read, the second is the length, you only want to read this one value so it's 0x1 (the 0x is needed to show that the value is in hexadecimal, you have to put it there), the pid is something you have to find out yourself with the command "processlist()". Now you have the value of the address 0x00001233, let's say it's 0x5 for our example, and obviously you know which value you want to write to 0x00001234, let's say it's 0x63 or 99 in decimal for our example. To put that into the RAM of the 3DS you need to use the command "write(0x00001233, (0x5, 0x63), pid=0x??). This command will write the correct value to 0x00001233 which should be the same as it was anyway and it will write your desired value 0x63 to your desired offset 0x00001234.

    Now how would you add this to your cheat plugin?
    In the function responsible for the cheats you'd just have to add "WRITEU8(0x00001234, 0x63);" and that would be it. The WRITEU8 function writes 8 bits (= 1 byte) to the address specified by the first entry in the parentheses. The value you want to write is specified by the second argument in the parentheses, here it's 0x63. You can also right the value in decimal so the command would look like this: WRITEU8(0x00001234, 99);

    If you'd like a more detailed explanation on how to write cheat plugins and how to find offsets with NTR Debugger I'd be glad to help you :)
     
  19. metallichatte

    metallichatte Member

    Newcomer
    21
    4
    May 25, 2015
    France
    editing a cheat.plg is possible ? (example:for replace an arcode inside a japan cheat.plg for an usa or european converted arcode)
     
  20. MichiS97

    MichiS97 "Leftist snowflake milennial"

    Member
    GBAtemp Patron
    MichiS97 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,376
    777
    Jun 14, 2011
    Germany
    Munich
    No, sadly this is not possible. You'd need to have the source code of the plugin you want to edit to do that. However, there is a source code for the cheat plugin for A Link Between Worlds out there. It would be very easy to put the codes you want in there.