ROM Hack How to find pointers on NTR Debugger memory dumps? (NTR CFW)

Nanquitas

Well-Known Member
Member
Joined
Sep 29, 2015
Messages
2,345
Trophies
0
Age
29
Location
South of France :)
XP
3,324
Country
France
Thanks, I appreciate it!
I've been learning to use the debugger for a bit now, and so far I can do some basic stuff; like change the number of coins currently obtained (or in my case, number of stars in Kirby Triple Deluxe); but some things I can't really change for whatever reason. For example, I wanted to edit the percentage damage in Smash (a float value, I believe) or the state of having the Final Smash (probably a boolean). Even after finding the address, editing it does nothing at all. After reading through this, I guess it's because of those dynamic pointers, so learning how to deal with those pesky pointers and multi-level pointers would be a huge help to me, as well as any others who's trying this out. :)

It can also be because the game rewrite the real value right after you modified.
A plugin can "freeze" the value because it'll overwrite the legit value with the cheated one at every loop.
 

omegapirate

Well-Known Member
OP
Newcomer
Joined
May 25, 2012
Messages
47
Trophies
0
XP
98
Country
Mexico
For anyone interested, I attached in this post the final edition to the code of the pointer + offset I found.

This is for Puzzle & Dragons Z + Puzzle & Dragons: Super Mario Bros. Edition (USA) and it changes the attack points of all 6 monsters while one a course. The game crashes once you leave a course with the ntr menu option checked so you have to uncheck it once you leave the course and check it once you start a course. It changes the attack of all of your allies to 0x00FFFFFF which basically you kill all enemies in 1 blow xD.

Annoying that you have to disable the menu option after finishing a course, but it's still not a game breaker ;)
 

Attachments

  • gameplg.zip
    2 KB · Views: 97

Nanquitas

Well-Known Member
Member
Joined
Sep 29, 2015
Messages
2,345
Trophies
0
Age
29
Location
South of France :)
XP
3,324
Country
France
I thought of some modifications for your code that should auto-deactivate the cheats when the pointer change:
Code:
void    disableCheat(u32 index)
{
    cheatEnabled[index] = 0;
    updateCheatEnableDisplay(index);
}

void    atk_all_monsters()
{
    static    u32        pointer = 0;
       
    if (pointer == 0)
        pointer = READU32(0x08121FBC));
    if (READU32(0x08121FBC) != pointer)
    {
        pointer = 0;
        disableCheat(0);
    }
    if (pointer != 0)
    {
        WRITEU32(pointer - 0x5F0, 0x00FFFFFF);
        WRITEU32(pointer - 0x4C8, 0x00FFFFFF);
        WRITEU32(pointer - 0x3A0, 0x00FFFFFF);
        WRITEU32(pointer - 0x278, 0x00FFFFFF);
        WRITEU32(pointer - 0x150, 0x00FFFFFF);
        WRITEU32(pointer - 0x28, 0x00FFFFFF);
    }
}

// freeze the value
void    freezeCheatValue()
{
    if (cheatEnabled[0])
    {
        atk_all_monsters();
    }
}

You can modify it according to the change of the pointer it it's not working. ;)
 
  • Like
Reactions: omegapirate

omegapirate

Well-Known Member
OP
Newcomer
Joined
May 25, 2012
Messages
47
Trophies
0
XP
98
Country
Mexico
Absolutely makes total sense. Ill give a shot; i think it should work but we'll see.

I thought of some modifications for your code that should auto-deactivate the cheats when the pointer change:
Code:
void    disableCheat(u32 index)
{
    cheatEnabled[index] = 0;
    updateCheatEnableDisplay(index);
}

void    atk_all_monsters()
{
    static    u32        pointer = 0;
      
    if (pointer == 0)
        pointer = READU32(0x08121FBC));
    if (READU32(0x08121FBC) != pointer)
    {
        pointer = 0;
        disableCheat(0);
    }
    if (pointer != 0)
    {
        WRITEU32(pointer - 0x5F0, 0x00FFFFFF);
        WRITEU32(pointer - 0x4C8, 0x00FFFFFF);
        WRITEU32(pointer - 0x3A0, 0x00FFFFFF);
        WRITEU32(pointer - 0x278, 0x00FFFFFF);
        WRITEU32(pointer - 0x150, 0x00FFFFFF);
        WRITEU32(pointer - 0x28, 0x00FFFFFF);
    }
}

// freeze the value
void    freezeCheatValue()
{
    if (cheatEnabled[0])
    {
        atk_all_monsters();
    }
}

You can modify it according to the change of the pointer it it's not working. ;)
 

omegapirate

Well-Known Member
OP
Newcomer
Joined
May 25, 2012
Messages
47
Trophies
0
XP
98
Country
Mexico
I thought of some modifications for your code that should auto-deactivate the cheats when the pointer change:
Code:
void    disableCheat(u32 index)
{
    cheatEnabled[index] = 0;
    updateCheatEnableDisplay(index);
}

void    atk_all_monsters()
{
    static    u32        pointer = 0;
     
    if (pointer == 0)
        pointer = READU32(0x08121FBC));
    if (READU32(0x08121FBC) != pointer)
    {
        pointer = 0;
        disableCheat(0);
    }
    if (pointer != 0)
    {
        WRITEU32(pointer - 0x5F0, 0x00FFFFFF);
        WRITEU32(pointer - 0x4C8, 0x00FFFFFF);
        WRITEU32(pointer - 0x3A0, 0x00FFFFFF);
        WRITEU32(pointer - 0x278, 0x00FFFFFF);
        WRITEU32(pointer - 0x150, 0x00FFFFFF);
        WRITEU32(pointer - 0x28, 0x00FFFFFF);
    }
}

// freeze the value
void    freezeCheatValue()
{
    if (cheatEnabled[0])
    {
        atk_all_monsters();
    }
}

You can modify it according to the change of the pointer it it's not working. ;)


I fixed one line as you forgot the {} xD

but still it should have worked but for some reason it didn't :/

first i activated the cheat on the course selection and the game didn't crash; then i entered a course and the cheat seemed to work fine and all until the end of the course but when entering a second course while the cheat is activated, it game a "nintendo an error occurred" black screen :/

I read the whole code twice and there doesn't seem to be any errors. Perhaps is just the way the memory works?

EDIT: I just reread the code twice and I think the problem has to do with the fact that technically we are disabling the cheat while the cheat is enabled xD

I mean it's like the cheat is "disabled" while the cheat in the cheat menu is activated xD

Guess I'll stick to the previous working code while I find a way to make it happen.
 
Last edited by omegapirate,

Nanquitas

Well-Known Member
Member
Joined
Sep 29, 2015
Messages
2,345
Trophies
0
Age
29
Location
South of France :)
XP
3,324
Country
France
Ah ? Where ?

You mean the cheat was activated before you launch the course ? It's probably normal, you should activate it only when you're on a course, maybe the pointer when you're not on a course, refer to a protected zone memory, or it point to 0x0.

Edit:
Nope, it has nothing to do with enabling/disabling the cheat. It's cause you're writing on a restrictive memory zone.

Plus, the display menu has nothing to do with the cheat. It's like a television, you can shutdown or not your tv, it won't shutdown the studios that are broadcasting the shows.

Check the value stocked by the pointer variable to see where it point exactly ;)
 
Last edited by Nanquitas,

omegapirate

Well-Known Member
OP
Newcomer
Joined
May 25, 2012
Messages
47
Trophies
0
XP
98
Country
Mexico
Ah ? Where ?

You mean the cheat was activated before you launch the course ? It's probably normal, you should activate it only when you're on a course, maybe the pointer when you're not on a course, refer to a protected zone memory, or it point to 0x0.

I changed 0 to 12349 to see if that could be the problem but still the 3ds crashes once i enter the second stage. Guess i will stick to the previous code once i find a way to do it. Kinda annoying but its better xD
 

Nanquitas

Well-Known Member
Member
Joined
Sep 29, 2015
Messages
2,345
Trophies
0
Age
29
Location
South of France :)
XP
3,324
Country
France
I don't understand what you changed...

All you have to do, is to disable the cheats and monitor the pointer.
An idea to monitor the change of the pointer:
Code:
void    monitor(u32 addr, char *text)
{
    char buf[40];

    xsprintf(buf, "0x%08X = 0x%08X %s", addr, READU32(addr), text);
    addCheatMenuEntry(buf);
    updateMenu();
}

void    disableCheat(u32 index)
{
    cheatEnabled[index] = 0;
    updateCheatEnableDisplay(index);
}

void    atk_all_monsters()
{
    static    u32        pointer = 0;

    if (pointer == 0)
    {
        pointer = READU32(0x08121FBC);
        monitor(0x08121FBC, "(== 0)");
    }       
    if (READU32(0x08121FBC) != pointer)
    {
        monitor(0x08121FBC, "(!=)");
        pointer = 0;
        //disableCheat(0);
    }
    /*if (pointer != 0)
    {
        WRITEU32(pointer - 0x5F0, 0x00FFFFFF);
        WRITEU32(pointer - 0x4C8, 0x00FFFFFF);
        WRITEU32(pointer - 0x3A0, 0x00FFFFFF);
        WRITEU32(pointer - 0x278, 0x00FFFFFF);
        WRITEU32(pointer - 0x150, 0x00FFFFFF);
        WRITEU32(pointer - 0x28, 0x00FFFFFF);
    }*/
}

// freeze the value
void    freezeCheatValue()
{
    if (cheatEnabled[0])
        atk_all_monsters();
}
 

Spewpa

Member
Newcomer
Joined
Mar 2, 2016
Messages
20
Trophies
0
Age
26
XP
72
Country
Venezuela
Hey, can someone please lend me a hand? I'm trying to dig into Animal crossing Happy Home Designer furniture count but I mostly have no idea of what I am doing or what to search for. Any help would be appreciated :c
 

omegapirate

Well-Known Member
OP
Newcomer
Joined
May 25, 2012
Messages
47
Trophies
0
XP
98
Country
Mexico
Hey, can someone please lend me a hand? I'm trying to dig into Animal crossing Happy Home Designer furniture count but I mostly have no idea of what I am doing or what to search for. Any help would be appreciated :c

Sure i can help you eventhough i dont have that game.

Tell me what exactly you are trying to do.

@Nanquitas I will gladly give it a shot!
 
General chit-chat
Help Users
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
  • Iron_Masuku @ Iron_Masuku:
    Hello
  • Vetusomaru @ Vetusomaru:
    @SylverReZ find me ONE community that is free of drama and politics. even video games forums (like this one) have politics section. and for some reason gamers still take consoles/brands wars seriously. even as a kid i never took the console wars bait despite being a nintendo kid.
  • Vetusomaru @ Vetusomaru:
    one of the reasons i deleted all my social media accounts, reddit account (although i was rarely using it) etc was to get away from this shit.
  • SylverReZ @ SylverReZ:
    @Vetusomaru, Sadly, not all communities like to play nice. Forums are pretty much dying despite Discord amongst other social media being available.
  • Vetusomaru @ Vetusomaru:
    i only kept my twitter accounts and only because many of the artists i like share their art only/mostly at twitter.
  • Vetusomaru @ Vetusomaru:
    lots of discord groups (even the big ones) are also dead for some reason.
  • SylverReZ @ SylverReZ:
    Twitter is way too shittier.
  • Vetusomaru @ Vetusomaru:
    that's why i added some firefox addons to block shit like twitter trends.
  • SylverReZ @ SylverReZ:
    Discord, on the other hand, moderation tends to not be very nice in video game communities from what I had experienced.
  • Vetusomaru @ Vetusomaru:
    nah, discord is also a shithole. discord is good only if you have your own community with your own rules. or if you re lucky to find some groups that arent shitholes.
  • Vetusomaru @ Vetusomaru:
    as about forums, when i recently revisited some old forums i used to be regular and seeing how immature most members still are i was like "Yeap. Nothing of value has been lost.". Unfortunately it's the good, comfy forums that ended up dead or shut down, especially because of internet centralization.
    Vetusomaru @ Vetusomaru: as about forums, when i recently revisited some old forums i used to be regular and seeing how...