Whether you’re interested in how the dataminers get their information, or you’re one of the people trying to rebuild the game in Unity, I think this information will be useful to you. I spent a lot of time figuring this out and researching the internal structure for myself over the last couple of days, and while this does not directly allow us to edit the code, this could be a huge boon to remaking the game in a clean project in Unity, and our research of the ROM itself.
As far as my assumptions heading into this tutorial, I will assume that you have a hacked Nintendo Switch – I know that many of you don’t have one, and while you can do this without a hacked Switch, that requires you to have a keys.txt that is illegal to share, and access to the BDSP nsp or xci and a program to dump them. I don’t want to consistently be fielding and rejecting questions of how to get those files.
You will need:
Instructions:
So yeah, if you enjoy tinkering with stuff, and want to tell us about cool stuff you find in the code, there it is. I found an interesting calendar of days that make eggs hatch faster and make Pokemon appear more or less frequently. It's not super relevant so I'm not going to share it here, but this will let more of you join in with the leaks.
EDIT:
Based on info from Falo, I will be updating this as I research Ghidra and dnSpy.
As far as my assumptions heading into this tutorial, I will assume that you have a hacked Nintendo Switch – I know that many of you don’t have one, and while you can do this without a hacked Switch, that requires you to have a keys.txt that is illegal to share, and access to the BDSP nsp or xci and a program to dump them. I don’t want to consistently be fielding and rejecting questions of how to get those files.
You will need:
- NXDumpTool
- A computer
- Asset Studio GUI
- IL2CPP Dumper
Instructions:
- Acquire NXDumpTool.nro and place it in the folder with your other nro files. On your switch, run the homebrew (preferably not in applet mode, you can run it in a native mode by holding “R” as you launch a game file so that your Switch can access more of your RAM and dump the game faster)
- Locate your game, make sure to dump it with the update, and dump both romfs and exefs. Start the dump.
- When it is finished, move the files over to your computer.
- Open IL2CPP Dumper, it will ask you for an il2cpp binary file, this will be “main” (not main.npdm) in the exefs folder.
- Next, it will ask you for global-metadata. This will be located in romfs>Data>Managed>Metadata.
- Let it run, you will now have a “dummyDLL” folder. Within this folder is a file called Assembly-CSharp.dll, this file is the key we were going for. This is basically the key to accessing all of the internal code of the game.
- Next, open Asset Studio. I’m going to give you guys free reign to explore the game’s code, but for now, I am going to show you a small example of what we have just unlocked.
- Go to File, click load file, locate your dump, go to romfs, data, then select resources.assets.
- Go to the tab labeled “Asset List”, sort by name, and locate “PokemonData”. Select it. It will open a popup asking you for a folder. Navigate to your DummyDLL folder, and press ok.
- If you did not have the assembly-csharp.dll we just got, it would just show you a reference to where in the NSO (“main” from earlier, basically the Switch’s exe file) that information is located, and you would not be able to read anything. But now that you have pointed it to our fake DLL, it will unpack all of that information for you and you can read all of the code in plain text. That said… some of it is in Japanese. But it’s definitely something!
So yeah, if you enjoy tinkering with stuff, and want to tell us about cool stuff you find in the code, there it is. I found an interesting calendar of days that make eggs hatch faster and make Pokemon appear more or less frequently. It's not super relevant so I'm not going to share it here, but this will let more of you join in with the leaks.
EDIT:
Based on info from Falo, I will be updating this as I research Ghidra and dnSpy.
Last edited by The_Time_Is_Nigh,