[Source] Cheat menu plugin demo for NTR CFW

Discussion in '3DS - Flashcards & Custom Firmwares' started by cell9, Jan 19, 2016.

  1. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    if it's in C that you want to convert it:
    Code:
    cheat()
    {
    WRITEU32(0x08550D68, 0x00112233);
    WRITEU32(0x08550D68, 0x44556677);
    WRITEU32(0x08550D68, 0x8899AABB);
    WRITEU16(0x08550D68, 0x0000CCDD);
    }
    Replace (WRITEUX) by whatever your macro for writing is. ;)
     
  2. gamer4lif3

    gamer4lif3 GBAtemp Fan

    Member
    4
    Dec 31, 2015
    United States
    hmm this is for menucheat cheat.plg but i think i get the idea

    if (cheatEnabled[0]) {
    WRITEU32(0x08550D68, 0x00112233);
    WRITEU32(0x08550D68, 0x44556677);
    WRITEU32(0x08550D68, 0x8899AABB);
    WRITEU16(0x08550D68, 0x0000CCDD);
    }
     
  3. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    Yep this works, but i prefer separate code so my functions aren't too long.
    I would have write all of my cheats functions in a deifferent file, and in the gameplg:

    Code:
    if (cheatEnabled[0])
        cheat();
    if (cheatEnabled[1])
        cheat1();
    if (cheatEnabled[2])
        cheat2();
    I think it's easier to read, and when you have to debug it's easier to find where you forgot this or that ;)
     
    Last edited by Nanquitas, Feb 7, 2016
  4. gamer4lif3

    gamer4lif3 GBAtemp Fan

    Member
    4
    Dec 31, 2015
    United States
    i must be doing sumthing wrong all the single codes i enter work but when try these multi address game locks

    if (cheatEnabled[0]) {
    WRITEU16(0x0058799C, 0x00000140);
    }
    if (cheatEnabled[1]) {
    WRITEU16(0xDD000000, 0x00000400);
    WRITEU16(0x198F5077, 0x0000CB40);
    }
    if (cheatEnabled[2]) {
    WRITEU16(0x005879FF, 0x00000063);
    }
    if (cheatEnabled[3]) {
    WRITEU16(0x005879FE, 0x00000063);
    }
    if (cheatEnabled[4]) {
    WRITEU16(0x00587A04, 0x0000001E);
    }
    if (cheatEnabled[5]) {
    WRITEU16(0x20587A00, 0x00000063);
    }
     
  5. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    That's cause you're trying to enter raw gateway code as if they were all address...
    That's not the case, you have to look at how are built the gateway code and translate them into c code.
    The only one code you can enter without convert, are those who begins with 0.

    Code:
    if (cheatEnabled[0]) {
    WRITEU16(0x0058799C, 0x00000140); //May cause some problems but do the job
    }
    if (cheatEnabled[1]) {
    WRITEU16(0xDD000000, 0x00000400); //Wrong
    WRITEU16(0x198F5077, 0x0000CB40); //Wrong
    }
    if (cheatEnabled[2]) {
    WRITEU16(0x005879FF, 0x00000063); //May cause some problems but do the job
    }
    if (cheatEnabled[3]) {
    WRITEU16(0x005879FE, 0x00000063); //May cause some problems but do the job
    }
    if (cheatEnabled[4]) {
    WRITEU16(0x00587A04, 0x0000001E); //May cause some problems but do the job
    }
    if (cheatEnabled[5]) {
    WRITEU16(0x20587A00, 0x00000063); //Wrong
    }
     
    Last edited by Nanquitas, Feb 7, 2016
  6. gamer4lif3

    gamer4lif3 GBAtemp Fan

    Member
    4
    Dec 31, 2015
    United States
    well dang lol that pretty much ends my hopes of making own cheat.plgs.I don't know how to code lol time to buy me a gateway 3ds i think.
     
  7. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    Well with no base in C, yeah it'll be a bit complicated.
    But even if you can't convert all the code you still can convert the simple code.
    Code:
    005879FE FFFFFF63
    ->WRITEU32(0x005879FE, 0xFFFFFF63)
    
    105879FE 0000AA63
    ->WRITEU16(0x005879FE, 0x0000AA63)
    
    205879FE 00000063
    ->WRITEU8(0x005879FE, 0x00000063)
    But for now, yes the gateway menu is the easy way to cheat ;)
     
  8. gamer4lif3

    gamer4lif3 GBAtemp Fan

    Member
    4
    Dec 31, 2015
    United States
    yup no clue lmao thanks for the info though.I am now looking into a gateway 3ds.
     
  9. David Rico

    David Rico Advanced Member

    Newcomer
    1
    Mar 22, 2016
    Colombia
    Hi, i'm new in this, i'm trying to put kid ikarus uprising cheats on mi o3ds but i can't compile the cheat.plg
    Code:
    C:\Users\configDuvan\Downloads\3DS\Ntr CFW\Plugin maker>set PATH=c:\devkitPro\ms
    ys\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System
    32\WindowsPowerShell\v1.0\;C:\Program Files\Skype\Phone\;;C:\Program Files\AllWi
    nnertech\PhoenixSuit\;C:\devkitPro\devkitARM\bin;C:\devkitPro\devkitARM\bin;C:\d
    evkitPro\msys\bin
    
    C:\Users\configDuvan\Downloads\3DS\Ntr CFW\Plugin maker>build.py
    rm: cannot lstat `bin/*.elf': No such file or directory
    source\gameplg.c: In function 'updateMenu':
    source\gameplg.c:55:33: warning: implicit declaration of function 'getCurrentPro
    cessId' [-Wimplicit-function-declaration]
      plgLoaderInfo->gamePluginPid = getCurrentProcessId();
                                     ^
    source\gameplg.c: In function 'freezeCheatValue':
    source\gameplg.c:114:24: warning: large integer implicitly truncated to unsigned
     type [-Woverflow]
       WRITEU16(0x00720C20, 0x0F405900);
                            ^
    source\gameplg.c:4:47: note: in definition of macro 'WRITEU16'
     #define WRITEU16(addr, data) *(vu16*)(addr) = data
                                                   ^
    source\gameplg.c:117:24: warning: large integer implicitly truncated to unsigned
     type [-Woverflow]
       WRITEU16(0x00720CC4, 0x0F40C3878);
                            ^
    source\gameplg.c:4:47: note: in definition of macro 'WRITEU16'
     #define WRITEU16(addr, data) *(vu16*)(addr) = data
                                                   ^
    source\gameplg.c:135:8: error: a label can only be part of a statement and a dec
    laration is not a statement
      TODO: handle your own cheat items
            ^
    source\gameplg.c:135:8: error: unknown type name 'handle'
    source\gameplg.c:135:20: error: expected '=', ',', ';', 'asm' or '__attribute__'
     before 'own'
      TODO: handle your own cheat items
                        ^
    source\gameplg.c:139:1: error: expected expression before 'void'
     void updateCheatEnableDisplay(id) {
     ^
    source\gameplg.c:191:1: error: expected declaration or statement at end of input
    
     }
     ^
    lib\main.o: In function `threadStart':
    D:\3ds\homebrew\gameCheat/source/main.c:19: undefined reference to `gamePluginEn
    try'
    cp: cannot stat `a.out': No such file or directory
    arm-none-eabi-objcopy: 'a.out': No such file
    rm: cannot lstat `*.out': No such file or directory
    El sistema no puede encontrar el archivo especificado.
    
    C:\Users\configDuvan\Downloads\3DS\Ntr CFW\Plugin maker>
    
    Now i don't know what's next to do!
     
  10. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    Hello ! :)

    Post your code if you want that we help you. Without we cannot tell you exactly where are the errors.
    Btw, you should use the WRITEU32 macros instead of the WRITEU8.
     
  11. David Rico

    David Rico Advanced Member

    Newcomer
    1
    Mar 22, 2016
    Colombia
    Ok here is it
    Code:
    void freezeCheatValue() {
        if (cheatEnabled[0]) {
            //Adress, Value?
            WRITEU32(0x000001E8, 0x7F);
            WRITEU32(0x000001E9, 0x96);
            WRITEU32(0x000001EA, 0x98);
        }
        if (cheatEnabled[1]) {
            WRITEU32(0x00720C20, 0x0F405900);
        }
        if (cheatEnabled[2]) {
            WRITEU32(0x00720CC4, 0x0F40C3878);
        }
        if (cheatEnabled[3]) {
            WRITEU32(0x00720B84, 0x00000014);
        }
        if (cheatEnabled[4]) {
            WRITEU32(0x00720B44, 0x00000014);
        }
        if (cheatEnabled[5]) {
            WRITEU32(0x00720B5C, 0x00000014);
        }
        if (cheatEnabled[6]) {
            WRITEU32(0x00720B94, 0x00000014);
        }
        if (cheatEnabled[7]) {
            WRITEU32(0x00720B64, 0x00000014);
        }
        //
        TODO: handle your own cheat items
    }
    
    I've changed the WRITEU16 for the WRITEU32 as you told me but the same error at the time of compile it.
    Thanks for answer :3 :D
     
  12. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    It's not compiling because you didn't comment the "TODO" line. ;)

    You should check your cheats code because the first one will definitely make your 3ds crash. The address which you're trying to write in are not valid.
    Code:
        void freezeCheatValue()
        {
            if (cheatEnabled[0]) {
                //Adress, Value?
                WRITEU8(0x000001E8, 0x7F); //<-- incorrect address, your 3ds will freeze
                WRITEU8(0x000001E9, 0x96); //<-- incorrect address, your 3ds will freeze
                WRITEU8(0x000001EA, 0x98); //<-- incorrect address, your 3ds will freeze
            }
            if (cheatEnabled[1]) {
                WRITEU32(0x00720C20, 0x0F405900);
            }
            if (cheatEnabled[2]) {
                WRITEU32(0x00720CC4, 0x0F40C3878);
            }
            if (cheatEnabled[3]) {
                WRITEU8(0x00720B84, 0x00000014);
            }
            if (cheatEnabled[4]) {
                WRITEU8(0x00720B44, 0x00000014);
            }
            if (cheatEnabled[5]) {
                WRITEU8(0x00720B5C, 0x00000014);
            }
            if (cheatEnabled[6]) {
                WRITEU8(0x00720B94, 0x00000014);
            }
            if (cheatEnabled[7]) {
                WRITEU8(0x00720B64, 0x00000014);
            }
            //    TODO: handle your own cheat items <-- you can delete this line, but do not uncomment it
        }
     
  13. David Rico

    David Rico Advanced Member

    Newcomer
    1
    Mar 22, 2016
    Colombia
    Oh, i got the address from a forum where they said that change that address and put that value with a hex editor, so, i cannot do the same here?
    How do i do to convert the address and the value for a correct compliling and editing?
    Thaks! :)
     
  14. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    I don't understand what you want to do with the firsts codes, give me more details. :)
     
  15. David Rico

    David Rico Advanced Member

    Newcomer
    1
    Mar 22, 2016
    Colombia
    Sure.
    I want to make the plg file for edit kid ikarus uprising, reading about ntr i foud this forum, then i'm using the address posted at this site: https://gbatemp.net/threads/kid-icarus-uprising-weapons-save-hex-editing.380354/
    then for start to do it i get the first thing that apear in there "0x000001E8-1EA 7F 96 98 Max Hearts Pit's" so i puted directly the address in the code (tree address and tree values), but you said me that these address are wrong, so i think i must convert o something like that to mate them correct and compile my fisrt cheat.plg!

    pdta:
    I'm latin, then mi english is not the best xD
     
  16. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    No problem, i'm french so english is not my first language too. :P

    For what you're trying to do, it's impossible. The address in this thread, are for save editing. Which have nothing to do with memory editing.
    If you want to modify this thing you'll have to find the address in the memory where it's stocked.

    On FORT42 there is this code (don't know if it's the one you want):

    65,535 Hearts
    Code:
    WRITEU16(0x00EE9820, 0xFFFF);
     
    David Rico likes this.
  17. David Rico

    David Rico Advanced Member

    Newcomer
    1
    Mar 22, 2016
    Colombia
    Yes! compiled, and yes, it's something like that for what i'm loking, now i'll test on my 3ds and search for codes for memory editing and no save editing xD
    Thak you so much! :D :D :D
     
  18. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    No problem, have fun ! ;)
     
    David Rico likes this.
  19. David Rico

    David Rico Advanced Member

    Newcomer
    1
    Mar 22, 2016
    Colombia
    Perfect!
    It has worked perfectly :D
    Something more xD ... Can you tell me a god database for thoso codes, in fort42 there is only one for the game but seems to be more codes and it is now in mi personal database for codes :D but if is another i'd like to know it :3 :)
    And once again... THANK YOU!
     
  20. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    11
    Sep 29, 2015
    France
    South of France :)
    Unfortunately if another database exists, i don't know about it. There are codes that are in various forums (this one, maxconsole for exemple), but outside of fort42 et maxconsoe cheat website, i don't know any database...
     
Loading...