Jump to content

Pokemon XD: Gale of Darkness - Psy_commando's utility and research notes

Recommended Posts

Hello again !

I recently did a lot of work on PMD2, but before that I was working on a script to make some deep modifications to Pokemon xD at runtime, directly in the RAM of the emulator.

It got put on hold, given I use cheat engine as backend for the lua script that powers the whole thing, and the UI editor is very finicky and keeps crashing when I'm editing list views, and given I'm using a ton of them, its getting a little tedious.. I'm still trying to find out whether I can still use Cheat Engine as backend but used from another language such as C# or something where I can make a separate UI easily..

Its really not polished and it still has its share of bugs. And this far the actual editor can only list pokemon in the party, and in the 8 first pc boxes(I doubt its even possible to ever use more than that tbh..). However, it does list a lot of data that is invisible to the player, such as PID, SID, IVs, EVs, etc..

Right now, it works only on a x64 setup, x64 Windows OS + x64 dolphin. x64 Cheat Engine.. But I was in the process of implementing a detection for that and to use the proper addresses for an x32 setup. However, its really not that complicated to change the addresses in the script to their x32 equivalents..

PPXD Memedit


For x64 setups only right now..
Unless you want to manually edit it in the script, which is still possible !

Don't expect too much of it.
I'm mainly only releasing it so others can pick it up and improve on it, because it will probably be a while before I put good progress into it !

This thing can basically read straight from the dolphin emulator's memory data for each pokemons in the player's party, and in the pc boxes. It shows normally invisible details about pokemons, such as PID, SID, IVs, and EVs.

These guys have helped me a lot with the data they've published :

Eventually it will allow modifying those things ! Along with editing the actual data for pokemon species, moves, typing, etc.. This far most of the in-memory data for those has been figured out, and the only thing left to do is to build a proper UI to edit those, and a proper way to save changes and load them easily later on..

How to use:

You need to have Cheat Engine x64, and Dolphin x64 installed on your computer for this to work ! I currently have CE 6.3.x

Dolphin uses a certain technique to access/manage memory, and the "MEM_MAPPED" option in the Cheat Engine's Scan Settings must be turned on !

1. First extract everything to the same directory. Double click on the .CT file. Cheat Engine should load it. At the popup say yes to loading the script.

Right now the script doesn't auto-start when loaded with Cheat Engine, because its still kinda glitchy and having access to the Cheat Engine UI can help !

2. So, in the Cheat Engine window, got to the menu, then Table->PDXMainWindow->Restore and Show.

This should popup the main window of the memeditor.

3. Then, make sure dolphin x64, is running with the game loaded, and click on the button named "attach to dolphin". It should freeze for less than a second, and a message saying "process already attached"(my code is still glictchy, but it actually attached the process correctly) will popup in the box at the bottom.

4. Then, given I didn't find the static pointers to the player's party and PC boxes, you need to input your trainer's name exactly as you entered it in the game inside the player name box. Then if you changed the name of your first pc box, enter the name you gave it in the second box, then click "analyze memory". This should take a second or so, and if it found the player party and the pc boxes it will list those in the box along with their addresses..

5. Once it worked, you can either click on "Party Pkmns" to see a list of the pokemon currently in your party, or PC Boxes to see a list of pokemons in your pc boxes. The other options are not guaranteed to work as off now, or won't do anything at all.

*NOTE: the "auto-refresh" checkbox and the "switch to battle party" button don't work at all yet.


- Version 0.1 pre-pre-pre-alpha :

Research Notes:

Those are the interesting part ! They are strictly about RAM editing, given I haven't managed to decompress anything on the game disc.. I couldn't find out what compression it used or if tools existed for it..

But the notes contains details on how to modify most values for each individual pokemons, and how to edit specie wide data, or even edit single moves' data !

They're a work in progress though, and still not very clean and
100% accurate..

So any contributions anyone can make to them would be greatly appreciated !

Even if, right now I'm mainly focusing on reversing PMD2, I figured it was better to share those than have them on my hdd doing nothing useful !

Here they are :

On a side note, I was really surprised at how sturdy the game is even if you enter completely invalid things ! I never even managed to freeze or crash the game once when working on finding out those things ! Things like replacing an entire pokemon block with ones everywhere !

I made really weird and dumb things, such as have a pokemon evolve like shedinja, and creates a copy of itself of its pre-evo specie ! And then that evolved, and gave basically a copy of itself at each levels

I hope this will be useful to someone !

Link to comment
Share on other sites

Aren't 32bit versions of Dolphin discontinued now?

I doubt it.. But, honestly I mainly use dolphin 64 bits now anyways, so... I wouldn't exactly shed a tear if it was the case.. Less work for me! :P

Should try out Dolphin's dev/debug version, which can allow you to see the RAM at actual offsets.

With that you can edit a PKM's data; structure is a few posts above the linked ^ :)

I posted a link to that thread in my post..

And I used dolphin in debug mode before, while making this and writing those notes. Without it I couldn't have converted the offsets properly. I even wrote about it in the notes I linked..

Also, I'm not sure if you've noticed, but I kinda added a good amount of new findings to the research those guys made.. And, the point of the script is to be more convenient and quicker than looking at raw data in memory.. And also being a good starting point for anyone looking to make something similar to what I did.

I'm not sure why you're posting that, though.. I'm guessing you're trying to help, but on the other hand, the way you brought it sounds kinda patronizing.. As if implying something like : "silly you, these guys have the only actual, good offsets, and the debugger is much better than your stuff" :,(

Of course, I'm over-dramatizing, and I'm not pissed, sad, or anything, but I'll admit it kinda stung a little when I read that.. :tongue:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...