Homebrew PKMN-NTR: Real-time memory editing program for Pokémon games [WIP]

Stoned

Well-Known Member
Member
Joined
Mar 26, 2014
Messages
2,766
Trophies
2
Age
45
XP
4,445
Country
Germany
For rng is better to collect eggs instead of rejecting them

Okay. Have you a little Tutorial for me to calculate the mass of eggs that i have to recive?

Example

Frames 6
Used 32

When i only Recive egg´s i have to Recive 6 Egg´s?
 

RustInPeace

Samurai Cop
Member
Joined
Oct 13, 2014
Messages
5,944
Trophies
1
Age
31
XP
5,187
Country
United States
Last edited by RustInPeace,
  • Like
Reactions: Real.96

Real.96

Well-Known Member
Member
Joined
Sep 14, 2015
Messages
1,055
Trophies
0
Age
28
XP
965
Country
Italy
I'm trying out jackmax's build, working very well. Maybe add a bot for the mascot legends, because you can escape from battle, and the Lunala/Solgaleo's data changes, meaning no need to soft reset. But you have to walk 1-3 steps forward after escaping or ending the battle.

Also for the Tapus won't be really difficult. Maybe the "problem" can the the Ultra Beast
 

drgoku282

Well-Known Member
OP
Member
Joined
Oct 16, 2014
Messages
427
Trophies
0
Age
31
XP
724
Country
Mexico
Hi there, I've been less active these days due holidays.

I've merged jackmax on my fork, they're the same now, I'll try to work on soft-reset the next few days. When implemented at least for tapus will be ready for a stable update. I'd need testing savefile for solgaleo/lunala. Probably there will not have ultrabeast support.

About the rng egg issue, I need to understand it better to see what can be done. Meanwhile I can add a field to dump the egg seed.
 

Real.96

Well-Known Member
Member
Joined
Sep 14, 2015
Messages
1,055
Trophies
0
Age
28
XP
965
Country
Italy
Hi there, I've been less active these days due holidays.

I've merged jackmax on my fork, they're the same now, I'll try to work on soft-reset the next few days. When implemented at least for tapus will be ready for a stable update. I'd need testing savefile for solgaleo/lunala. Probably there will not have ultrabeast support.

About the rng egg issue, I need to understand it better to see what can be done. Meanwhile I can add a field to dump the egg seed.

You're the best man! :D

For the ultrabeast it won't be possible? You can make the bot use sweet scent until it found the Ultrabeast and then softreset. Maybe we can prepare the party with the first pokemon with 1 level less than the ultrabeat and active the Max Repel, in that way it will battle surely the ultrabeast
 
Last edited by Real.96,

jackmax

Member
Newcomer
Joined
Oct 19, 2016
Messages
5
Trophies
0
Age
31
XP
60
Country
Poland
Hi everyone! It's me. Just a few random thoughts on my new update and history of PKMN NTR:
Finding the trade offset was really simple - I used PKHeX to make a few Pokemon with conspicuous encryption constants (like 0xABCDEF12), then used my second 3DS to show them during a trade, dumped the memory and used a hex editor to search for that constant in the dump.
To find the opponent was easy with PokeDigger. I could have found it by hand, but that would have been tedious - I would have to look through the dump manually and try to decrypt anything that looked like Pokemon data. But I'd had the idea for PokeDigger for a long time and decided to make it.
The default settings in PokeDigger - start addr. 0x32500000, size 0x00100000 allow you to dump some cool stuff - Pokemon from your trade partner, battle opponent/ally (incl. online battles). There's one more interesting start offset - 0x32A00000. It contains some kind of a "cache", you'll find multiple copies of your party and your opponent's party during an online battle there. Interestingly, during a trade it contains copies of Pokemon your trade partner has shown previously, not just the one they are showing now.
As I said in my commit message, dumping "helper" Pokemon in an SOS Battle isn't supported. I just can't find them in memory - I've searched from 0x31000000 to 0x35000000 and found nothing. Maybe they're kept in memory unencrypted (PokeDigger only looks for encrypted data). I'll see what I can do about that, please tell me if that's a high priority.
I'm not really interested in bots for the game and that's why I didn't work on them.

Here's some history that you may or may not be interested in:
I fist found PKMN NTR in October. I quickly realised this was an awesome tool, but it was slow, unreliable and had some bugs in it. I downloaded the source code to try to fix it and it kinda led me down a rabbit hole. The code by fa-dx was awful, obviously slapped together quickly until it sort-of worked. One weekend I decided to rewrite the program's code until it made sense. Here's a few highlights of my journey:
  • Despite the IronPython dependency, I could barely find any Python code in the program. Eventually I realised that Python was originally used by NTRClient as an interpreter that interfaced with native C# code used for network connectivity. But PKMN NTR, despite being written in C#, didn't use that netcode directly - instead, it launched Python commands and observed the log file to see their results. So instead of C# GUI talking to C# netcode talking to C# GUI we had C# GUI talking to IronPython (passing commands as strings) talking to C# netcode printing commands to the log observed by C# GUI. I had to modify the netcode to allow it to write received data to memory and call events instead of relying on temp files and text logs.
  • The netcode could only listen for a single response to a dump request at a time. If you issued two dump requests quickly, the netcode would only react to the second one. When I fixed this bug, dumping from trades stopped working - as it turned out, the code searching for trade Pokemon found two results (I suspect unintentionally), issued two requests quickly, but only expected one response. When two responses would arrive, it caused an exception, because the program tried to open the same file for writing twice.
  • The code for checking the updates had an interesting bug in it - if the update host was pingable, but the .xml file with update definition was not present or malformed, the program would close immediately. So if fa-dx ever loses interest and deletes the .xml file from his host, all PKMN NTR versions with this bug won't launch if you have an Internet connection.
 
Last edited by jackmax,

RustInPeace

Samurai Cop
Member
Joined
Oct 13, 2014
Messages
5,944
Trophies
1
Age
31
XP
5,187
Country
United States
As I said in my commit message, dumping ally Pokemon in an SOS Battle isn't supported. I just can't find them in memory - I've searched from 0x31000000 to 0x35000000 and found nothing. Maybe they're kept in memory unencrypted (PokeDigger only looks for encrypted data). I'll see what I can do about that, please tell me if that's a high priority.
I'm not really interested in bots for the game and that's why I didn't work on them.
[/SPOILER]

I think it's a priority >.>, a lot of my time on Sun has been dedicated to SOS chaining, and with the prospect of chaining for 5+ IV Dittos, such a feature would be nice. Also less of a burden for HA scouting and whatnot. Either way, the opponent dumping is a huge step forward, thanks for implementing that!
 
  • Like
Reactions: Real.96

Real.96

Well-Known Member
Member
Joined
Sep 14, 2015
Messages
1,055
Trophies
0
Age
28
XP
965
Country
Italy
Hi everyone! It's me. Just a few random thoughts on my new update and history of PKMN NTR:
Finding the trade offset was really simple - I used PKHeX to make a few Pokemon with conspicuous encryption constants (like 0xABCDEF12), then used my second 3DS to show them during a trade, dumped the memory and used a hex editor to search for that constant in the dump.
To find the opponent was easy with PokeDigger. I could have found it by hand, but that would have been tedious - I would have to look through the dump manually and try to decrypt anything that looked like Pokemon data. But I'd had the idea for PokeDigger for a long time and decided to make it.
The default settings in PokeDigger - start addr. 0x32500000, size 0x00100000 allow you to dump some cool stuff - Pokemon from your trade partner, battle opponent/ally (incl. online battles). There's one more interesting start offset - 0x32A00000. It contains some kind of a "cache", you'll find multiple copies of your party and your opponent's party during an online battle there. Interestingly, during a trade it contains copies of Pokemon your trade partner has shown previously, not just the one they are showing now.
As I said in my commit message, dumping ally Pokemon in an SOS Battle isn't supported. I just can't find them in memory - I've searched from 0x31000000 to 0x35000000 and found nothing. Maybe they're kept in memory unencrypted (PokeDigger only looks for encrypted data). I'll see what I can do about that, please tell me if that's a high priority.
I'm not really interested in bots for the game and that's why I didn't work on them.

Here's some history that you may or may not be interested in:
I fist found PKMN NTR in October. I quickly realised this was an awesome tool, but it was slow, unreliable and had some bugs in it. I downloaded the source code to try to fix it and it kinda led me down a rabbit hole. The code by fa-dx was awful, obviously slapped together quickly until it sort-of worked. One weekend I decided to rewrite the program's code until it made sense. Here's a few highlights of my journey:
  • Despite the IronPython dependency, I could barely find any Python code in the program. Eventually I realised that Python was originally used by NTRClient as an interpreter that interfaced with native C# code used for network connectivity. But PKMN NTR, despite being written in C#, didn't use that netcode directly - instead, it launched Python commands and observed the log file to see their results. So instead of C# GUI talking to C# netcode talking to C# GUI we had C# GUI talking to IronPython (passing commands as strings) talking to C# netcode printing commands to the log observed by C# GUI. I had to modify the netcode to allow it to write received data to memory and call events instead of relying on temp files and text logs.
  • The netcode could only listen for a single response to a dump request at a time. If you issued two dump requests quickly, the netcode would only react to the second one. When I fixed this bug, dumping from trades stopped working - as it turned out, the code searching for trade Pokemon found two results (I suspect unintentionally), issued two requests quickly, but only expected one response. When two responses would arrive, it caused an exception, because the program tried to open the same file for writing twice.
  • The code for checking the updates had an interesting bug in it - if the update host was pingable, but the .xml file with update definition was not present or malformed, the program would close immediately. So if fa-dx ever loses interest and deletes the .xml file from his host, all PKMN NTR versions with this bug won't launch if you have an Internet connection.

First of all thanks a lot for everything you're doing! You and drgoku282 are making a really great job!

For the SOS opponent dumping: i think that it will be really useful, with this the app will be perfect and completed!
 

RustInPeace

Samurai Cop
Member
Joined
Oct 13, 2014
Messages
5,944
Trophies
1
Age
31
XP
5,187
Country
United States
Nothing is working for me I am trying the soft reset feature and it keeps saying reconnect to pps when i already am

You're not supposed to reconnect to PSS, assuming you're using the Gen 6 features. Disable PSS, save the game afterwards. Having the resume box unticked and running the SR bot would've done that for you.
 
  • Like
Reactions: Real.96

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: @BakerMan I bet your mom found out you watching those kind of vids on your 3ds again, and put a...