Jump to content
Sign in to follow this  
theSLAYER

Shiny Rate 100% (for non-shiny locked) via code.bin editing

Recommended Posts

2011-04-04_17-59-48.960_top.png2011-04-04_18-11-37.784_top.png2011-04-04_18-29-11.702_top.png2011-04-04_20-05-06.163_top.png
Images above are from XY, ORAS, SM and USUM, respectively.

Disclaimer
This guide requires a hacked 3DS, and will use Luma3DS LayeredFS to achieve the desired result.
For non-shiny locked entries, this shiny patch will shinify wild encounters, static encounters, gifts, fishing, eggs when received from breeder, and wonder card redemptions.

Note: this ROM patch may affect some event redemptions that were not meant to be shiny. Wonder cards that have preset/fixed PID may get their PID overwritten and end up being shiny. Those specific cases will be illegal. (I experienced this with Ash-Greninja)

Unlike shiny patches of previous generation games, these Pokémon retain their shininess even when transferred to games that do not have the shiny patch.

While PK3DS does have a shiny rate editor, this guide is for people who somehow can't get it to work (maybe computer compatibility issues, unable to extract all the necessary files from the games, etc), or simply doesn't like to use it.

We will not be providing any exefs.bin or code.bin, as linking to or providing data files extracted from ROMs are against our forum's rules.
However do not fear, as the steps regarding how to extract them from your own purchases, are included in this guide.
 

Additional Misc. Info
While it is possible to compile the edited code.bin into a .3DS/.cia, that is not the focus of this tutorial.
Do note that if you're running a version of the game that is updated (i.e you have the update patch installed), you'll have to dump the exefs.bin of the update patch instead. Instructions for this step is included below as well.
If you have the update patch installed, and you use the exefs.bin/code.bin from the main game (instead of the one in the update patch), it will definitely result in a crash when the game is being loaded.


Additionally, this patch will not work on any entries that's shiny locked, and it also won't work on entries that use a different method of generating their PIDs, such as non-legends/non-UB wild Wormhole encounters, Partner Cap Pikachu, Poké Pelago etc.


The 4 easy steps:
1. Extracting the exefs.bin
2. Decompressing exefs.bin to obtain the decompressed code.bin
3. Performing the edit
4. Pasting the code.bin into Luma

 

Extracting the exefs.bin

Spoiler

1. Have GodMode9 on your SD card.
(gm9 folder on SD root, GodMode9.firm in luma/payloads)

2. Hold down the START button while booting 3DS, and launch into GodMode9
image002.png
default screen for the [root] folder

3. On top screen, go to SYSNAND SD, and enter the folder
I am not sure if EMUNAND SD actually appears as an option if you have EMUNAND.
If it does, and your game/update is installed on EMUNAND, then go to that option.

Also, if your only copy of the game is on a cart AND if you play the game without any game updates installed, follow the steps (3a to 3f) in the spoiler below.
Else, ignore the content in the spoiler directly below and go to step (4).

Spoiler

3a. With the cart inserted, top screen, open GAMECART
image.png

3b. Top screen, choose {name}.3ds and press the A button
(not the -priv, trim nor split one)
snap000.png

3c. Bottom screen, NCSD image options...
image.png

3d. Bottom screen, Mount image to drive
image.png

3e. Top screen, open content0.game folder
snap001.png

3f. At this step, exefs.bin can be seen. Skip to step 11 to continue.
snap002.png


4. On top screen, navigate to title, and enter the folder

5. On top screen: if you're playing the game without a game update, navigate to 00040000
If you're playing the game and have a game update installed, navigate to 0004000e
image003.png
inside the title folder.

6. On top screen, navigate to the folder that has the game ID that represents the game you're trying to extract from:

Game Name Game ID
Pokémon X 00055D00
Pokémon Y 00055E00
Pokémon Omega Ruby 0011C400
Pokémon Alpha Sapphire 0011C500
Pokémon Sun 00164800
Pokémon Moon 00175E00
Pokémon Ultra Sun 001B5000
Pokémon Ultra Moon 001B5100

image004.png
Example of hovering over Omega Ruby folder

7. On top screen, enter the content folder
image005.png
example of the inside of Omega Ruby folder

8. On top screen, go to the {some digits}.app that has a larger file size, and press the A button once. Options will appear on the bottom screen.
image006.png
The {some digits}.app can be seen

9. On bottom screen, select NCCH image options...

10. On bottom screen, Mount image to drive
image.png

11. On top screen, navigate down to exefs.bin, and press the Y button once. (This copies the exefs.bin file)
image007.png
Hovering over exefs.bin on top screen, and button options on bottom screen

12. Keep pressing the B button until you get back out into the root folder. (Top screen, shows [root], SDCARD, SYSNAND etc)
image001.png
Back at [root] folder, hovering over SDCARD

13. On top screen, enter SDCARD

14. Choose a folder you want to paste into, then press the Y button once. (This pastes the exefs.bin into the folder you entered)
Bottom screen will ask you if you want to paste the file into this folder. Press the A button once, to confirm.

15. Once pasting is done, hold down both the R bumper/shoulder button and the START button simultaneously, to shutdown the 3DS.

16. Now, take the SD card out of your 3DS and copy the exefs.bin file over onto your Computer.


Decompressing exefs.bin to obtain the decompressed code.bin

Spoiler

1. On your computer, create a CTRtools folder.

2. Download CTRtools and extract it into that folder.

3. Paste the exefs.bin into the CTRtools folder.
Ensure the file is named exefs.bin (all small capitalization)

4. If you're running windows (or if you have Wine on your Linux machine), I've prepared a batch file to go along with this tutorial. Paste it into the same CTRtools folder.
extract exefs.bat
If you're not on windows (or if you don't have Wine on your Linux machine), you can ignore the batch file.

At this stage, the folder will looks like this:
image.png

5. If you're on Windows (or Wine+Linux), run the extract exefs.bat.
If you're not on Windows (or no Wine+Linux), simply use a command window to run:
ctrtool.exe -t exefs --exefsdir=exefs exefs.bin --decompresscode

6. Check that an exefs folder appeared, and there's a code.bin inside that folder.
image.png


Performing the edit

Spoiler

1. Download a Hex Editor. I'll be using the program HxD

2. Open the code.bin in the Hex Editor.

3. Find/Search for this string, in Hex Values/Bytes
String:
21 E2 03 20 92 E1 1C
image.png

4. Once found, modify the closest 0x0A to 0xEA (specifically, it'll be the same distance away, as per seen below)
image.png

5. Now save the code.bin
image.png


Pasting the code.bin into Luma

Spoiler

1. With your 3DS' SD card plugged into your computer, navigate to the folder Luma/titles
If the folder titles doesn't exist, create it inside the Luma folder.

2. Check that the folder that named after your wanted game ID exists. If the folder doesn't exist, create it.

Game Name Full Game ID
Pokémon X 0004000000055D00
Pokémon Y 0004000000055E00
Pokémon Omega Ruby 000400000011C400
Pokémon Alpha Sapphire 000400000011C500
Pokémon Sun 0004000000164800
Pokémon Moon 0004000000175E00
Pokémon Ultra Sun 00040000001B5000
Pokémon Ultra Moon 00040000001B5100

Here's a look at what my folder looks like:
image.png

3. Go into the folder that has your game ID, and paste the edited code.bin into it.
Example:
image.png
 

4. Reinsert the SD card into your 3DS

5. Hold down SELECT button while booting 3DS.
Ensure this option is checked.
image.png


Congratulations, shinies await you!
2011-04-04_20-04-36.971_top.png2011-04-04_16-25-45.668_top.png

 

Original source of this method is from our one and only, @SciresM.
This method was adopted from his tweet back during Pokémon Sun & Moon's release.
It took me a while, but I've come to realize the leading bytes were exactly the same across the 3DS Pokémon games, making this method work for Gen 6 and 7 3DS games.
sciresm shiny.PNG

 


View full tutorial

  • Like 2

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...