Sun and Moon injection guide

Valentijn edited this page Jun 18, 2017 · 10 revisions

This guide aims to get you set up with the new method of injecting Pokémon in Pokémon Sun and Moon. Make sure that you read the entire guide before starting.

Important note: As of Luma v7.0, you can use IPS patching instead. This method is described below, with the old method being kept up for those running older versions.

Disclaimer

I am not responsible for any sanctions put on you by using this guide, by Nintendo or otherwise. Hacked Pokémon (those with illegal stats/moves/abilites etc.) should not be used in competitive environments. I am not responsible for any damage that happens to your 3DS/save data/copy of the game.

I am also not responsible for any sort of global system bans from general online access. You are always doing this at your own risk.

New method

Index

  • Prerequisites
  • Step 0: Preparation.
  • Step 1: Apply the patches.
  • Credits.

Prerequisites

  • A 3DS with boot9strap installed and running Luma3DS CFW. See here on how to get it set up.
  • The latest IPS release of SMPatcher. Download SMPatcher.IPS.files.x.y.zip (where you replace the x and y with any number)

Step 0: Preparation

  1. Plug your SD card in your PC.
  2. Go to the luma folder on your SD card and create a folder called titles (if this folder already exists, carry on. There's no need to recreate it).
  3. Create a folder inside the titles folder with the following name (this depend on whether you have Sun or Moon installed):

For Sun: 0004000000164800

For Moon: 0004000000175e00

  1. Go into that folder.
  2. Extract the IPS patch you want from the SMPatcher zip to the folder you just created. If you have Sun, use the patches that start with sun and if you have Moon use the patches that start with moon. If you want to disable the outlines use the file that contains no_outlines.
  3. Rename the aforementioned IPS patch to code.ips
  4. Unplug your SD card and put it back in your 3DS.

Step 1: Apply the patches.

  1. Hold select while booting your 3DS.
  2. Make sure that Enable game patching is checked.
  3. Press start to save your configuration.

You can now follow the steps under Injecting with PKHeX to inject Pokémon into your save file. From now on, when updating Luma3DS CFW, make sure that Enable game patching is selected.

Old method

Consider this method to be deprecated. It is kept up for those running older versions of Luma.

It is illegal to share/link to the CIA, code.bin and contents files of Pokémon Sun and Moon.

Click here to unfold the old method

Index (OLD)

  • Prerequisites
  • Step 0: Preparation
  • Step 1: Obtaining a decrypted CIA.
  • Step 2: Patching code.bin
  • Step 3: Cleanup.
  • Credits.

Prerequisites

  • A 3DS with arm9loaderhax installed and running Luma3DS CFW. See here on how to get it set up.
  • The latest release of Decrypt9 by dok9. Note that while the arm9loaderhax guide recommends installing Hourglass9, Decrypt9 has more features, and is generally the superior version.
  • The latest release of SMPatcher by SciresM (Works under mono for Mac/Linux).
  • Mac/Linux users: The latest version of mono. Install it through your package manager. Mac users can use brew.sh as a package manager.
  • The latest release of ctrtool by profi200 (Includes copies for Mac and Linux).
  • A copy of Pokémon Sun and Moon. This guide will work for both the cart version and the digital version.
  • 3 GB free on your SD card.
  • ~12 GB free on your computer.

Linux and Mac users will also likely want to install wine to run PKHeX, but that is beyond the scope of this guide.

Step 0 - Preparation

If you already have Decrypt9 installed, continue to step 1

  1. Put your SD card in your PC.
  2. Go to the luma folder on your sd card, and go into the payloads folder.
  3. Remove start_Hourglass9.bin from the payloads folder.
  4. Copy Decrypt9WIP.bin from the Decrypt9 zip to the payloads folder and name it start_Decrypt9WIP.bin.
  5. If you have a CIA file of Sun and Moon (preferred, since it is much faster), create a folder called files9 on your SD card, and in the files9 folder create a folder called D9Game and copy your CIA file to the D9Game folder. If you have a cart or the digital version, you can skip this step.
  6. Unplug your SD card and put it back in your 3DS.

Step 1 - Obtaining a decrypted CIA.

Before you start this step, make sure that you have the Decrypt9 payload installed. (Should be fine if you followed step 0).

Choose the correct step for your version.

Cart version

  1. Plug in your game card.
  2. Press start while booting your 3DS to enter Decrypt9.
  3. Use the arrow keys to select [Gamecart Dumper Options] and press a to enter the menu.
  4. Use the arrow keys to select [Dump & Decrypt Cart (full)] and press a.
  5. Wait until the dumping is finished, then press a again to return to the menu.
  6. Press start to shutdown your 3DS.
  7. Continue to step 2.

Digital version

  1. Press start while booting your 3DS to enter Decrypt9.
  2. Use the arrow keys to select [Content Decryptor Options] and press a to enter the menu.
  3. Use the arrow keys to select [CIA Builder Options...] and press a to enter the menu.
  4. Use the arrow keys to select `[CIA Builder (SysNAND/decr.) and press a.
  5. This step is a little complicated. When prompted to select a folder, press right once, then use the arrow keys to adjust the folder. When the numbers are correct, press right again, and do the same thing on the last part. In the end the line should look like this:

For Sun: /title/00040000/00164800

For Moon: /title/00040000/00175e00

  1. Press a to start the dumping process.
  2. Wait until the dumping is finished, then press a again to return to the menu.
  3. Press start to turn off your 3DS.
  4. Continue to step 2.

CIA version.

Make sure that you put the CIA file in the D9Game folder as described in step 0!

  1. Press start while booting your 3DS to enter Decrypt9.
  2. Use the arrow keys to select [Content Decryptor Options] and press a to enter the menu.
  3. Use the arrow keys to select [CIA File Options...] and press a to enter the menu.
  4. Use the arrow keys to select [CIA Decryptor (deep)] and press a to decrypt the CIA.
  5. Wait until the decrypting is finished, then press a again to return to the menu.
  6. Press start to turn off your 3DS.
  7. Continue to step 2.

Step 2 - Patching code.bin

Before you start this step, make sure that you have a decrypted CIA (which you got in the previous step), SMPatcher and ctrtool.

  1. Plug your SD card in your computer.
  2. Go into the files9 and then in the D9Game folder, and copy/move the CIA file to a folder on your computer.
  3. Extract the appropriate version for your system of ctrtool from the ctrtool zip into the same folder as your CIA file.
  4. Extract the SMPatcher zip into the same folder as your CIA file.
  5. The following step is dependent on your OS.

Windows users: Hold shift and right click on the folder where your CIA folder is located, and select "Open a command prompt here".

Linux/Mac users: Open a new terminal window and use cd to go the folder where your CIA is located. Then run chmod +x ctrtool to make ctrtool executable.

  1. Run the following command in the terminal window/command prompt (select the correct one for your platform):

Windows: ctrtool.exe --contents=contents {sm}.cia

Linux/Mac: ./ctrtool --contents=contents {sm}.cia

Replace sm.cia with the name of your CIA file.

Two files will be created, both beginning with contents. One of these will be ~3GB, the other ~2MB. Take note of the name of the 3GB file. 7. Run the following command in the terminal window/command prompt (select the correct one for your platform): Replace contents.0000.00000002 with the name of the 3GB file

Windows: ctrtool.exe --exefsdir=. contents.0000.00000002

Linux/Mac: ./ctrtool --exefsdir=. contents.0000.00000002 8. Run the following command in the terminal window/command prompt (Mac/Linux users: add mono before the command): SMPatcher.exe code.bin.

You will now have two patched code.bin files. The code_patched_no_outlines.bin also has the no outlines mod enabled for Sun and Moon. Generally though, unless you're playing on an emulator, you will probably want to use the normal version to avoid visual glitches.

Setting up luma3ds patching

  1. In your luma folder on your SD card, create a folder called code_sections.
  2. Copy over your selected code.bin and give it the following name, depending on your game:

For Sun: 0004000000164800.bin

For Moon: 0004000000175e00.bin

  1. Unplug your SD card and put it back in your 3DS.
  2. Hold select while booting your 3DS to enter the Luma3DS configuration, and enable the Enable region/language emu. and ext. code. If you don't have this option, update your Luma payload.
  3. Press start.

Step 3 - Cleanup.

You can safely remove the following files in your working directory:

  • The contents files.
  • The ctrtool file.
  • The banner.bin and icon.bin file.
  • The SMPatcher.exe file.
  • The decrypted CIA on both your SD card and your computer.

The only file that you should not remove is the code.bin file. If SMPatcher is updated, you can just download SMPatcher and run it again with the same code.bin file to redo the patches. If you do remove the code.bin file you will have to do the entire guide again.

Injecting with PKHeX

  1. Download PKHeX.
  2. Create your Pokémon in PKHeX.
  3. Shift-right click the Pokémon icon and select an empty slot in one of your boxes.
  4. In your game, make the slot you selected is actually empty and open the QR Scanner.
  5. Scan the displayed QR code.
  6. Your Pokémon is in the box you select, overwriting any other Pokémon that was in that slot.

Note that SMPatcher also removes the scan limit of 10 scans each day.

Credits

  • SciresM for creating SMPatcher.
  • AuroraWright for creating Luma3DS and delebile for implementing layeredFS with code.bin patching into Luma3DS.
  • dok9 for creating Decrypt9.
  • profi200 for creating ctrtool.
  • The guys at projectpokemon for creating PKHeX.
  • Special thanks to the /r/3dshacks subreddit and GBATemp for helping me get started with hacking my 3DS. Seriously, you guys are awesome!
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.