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

    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

     

     

    POST TUTORIAL EDIT:
    It appears extracting the .code.bin directly from the exefs folder in GodMode9 works, bypassing the entire requirement of ctrtools

    • Like 1
    • Thanks 2



    User Feedback

    Recommended Comments



    7 minutes ago, Jmscheuer said:

    I typed CD and got this 

    16755806495129164904903531501384.jpg

    Okay I did this. I'm sorry I'm not the best with command prompt. What did I do wrong here 😅

    16755809593191678269757524571752.jpg

     

    Okay I'll post a screenshot my apologies 

     

    Share this comment


    Link to comment
    Share on other sites

    Just now, Jmscheuer said:

    Okay I'll post a screenshot my apologies 

     

    space. you need a space between cd and <directory name>

    Share this comment


    Link to comment
    Share on other sites

    Okay I got it not enough arguments I'm currently in my correct directory

     

     

    Screenshot 2023-02-04 231655.png

    Share this comment


    Link to comment
    Share on other sites

    4 minutes ago, Jmscheuer said:

    Okay I got it not enough arguments I'm currently in my correct directory

     

    Now, what does it say if you paste this?
     

    ctrtool -t exefs --exefsdir=exefs exefs.bin --decompresscode

     

    Share this comment


    Link to comment
    Share on other sites

    @Jmscheuer I'm assuming the previous one gave you not enough arguments.

    Try this

    ctrtool -t exefs --exefsdir=exefs --decompresscode exefs.bin

     

    Share this comment


    Link to comment
    Share on other sites

    2 minutes ago, theSLAYER said:

    @Jmscheuer I'm assuming the previous one gave you not enough arguments.

    Try this

    ctrtool -t exefs --exefsdir=exefs --decompresscode exefs.bin

     

    Exefs had unexpected offset?

    Screenshot 2023-02-04 232127.png

    Share this comment


    Link to comment
    Share on other sites

    12 minutes ago, Jmscheuer said:

    Exefs had unexpected offset?

    Screenshot 2023-02-04 232127.png

    So I had to extract my own to test it, as of now, try this:

    ctrtool -t exefs --decompresscode --exefsdir=exefs exefs.bin

     

    Edit, also, it appears extracting the .code.bin from the exefs in GodMode9 would work too.

    Share this comment


    Link to comment
    Share on other sites

    1 minute ago, theSLAYER said:

    So I had to extract my own to test it, as of now, try this:

    ctrtool -t exefs --decompresscode --exefsdir=exefs exefs.bin

     

    I got the exact same response exefs section had unexpected offset 

    Share this comment


    Link to comment
    Share on other sites

    3 minutes ago, theSLAYER said:

    So I had to extract my own to test it, as of now, try this:

    ctrtool -t exefs --decompresscode --exefsdir=exefs exefs.bin

     

    Edit, also, it appears extracting the .code.bin from the exefs in GodMode9 would work too.

    I did that as well so I have the .code.bin file as well if you think that would work. I tried entering that in HxD and I couldn't find the hex strand from the tutorial 

     

    Share this comment


    Link to comment
    Share on other sites

    2 minutes ago, Jmscheuer said:

    I got the exact same response exefs section had unexpected offset 

    I dumped for me..
    image.png

    Anyhow, try extracting .code.bin from the exefs in GodMode9, as opposed to copying the exefs.bin
    I just tested on Pokemon Moon, ignored all the ctrtool steps.

    Share this comment


    Link to comment
    Share on other sites

    Just now, Jmscheuer said:

    I did that as well so I have the .code.bin file as well if you think that would work. I tried entering that in HxD and I couldn't find the hex strand from the tutorial 

     

    what game are you playing?

    Share this comment


    Link to comment
    Share on other sites

    4 minutes ago, Jmscheuer said:

    Ultra Moon 

    It didn't copy as a .bin file... 

    Screenshot 2023-02-04 234306.png

    Share this comment


    Link to comment
    Share on other sites

    3 minutes ago, Jmscheuer said:

    It didn't copy as a .bin file... 

    Screenshot 2023-02-04 234306.png

    open it in HxD and try finding the pointer

     

    edit: also, try moving those commands around based on what you see in the ctrtool response.

    Share this comment


    Link to comment
    Share on other sites

    15 minutes ago, theSLAYER said:

    open it in HxD and try finding the pointer

    I'm assuming you mean this strain right

    HXDSS.png

     

    11 minutes ago, Jmscheuer said:

    I'm assuming you mean this strain right

    HXDSS.png

    EDIT NEVERMIND I HAD A TYPO

     

     

    8 minutes ago, Jmscheuer said:

    EDIT NEVERMIND I HAD A TYPO

     

    Okay I edited the strain to EA now for putting in the Luma folder will it matter that it's not a .bin file? 

     

    5 minutes ago, Jmscheuer said:

    Okay I edited the strain to EA now for putting in the Luma folder will it matter that it's not a .bin file? 

    Okay I put the file into my 3ds in the Luma folder in the title ID etc and it didn't change the games shiny odds. I think it could have to do with being a wrong file type possible? I have patching enabled in the Luma menu 

    Share this comment


    Link to comment
    Share on other sites

    3 minutes ago, theSLAYER said:

    @Jmscheuer follow the instructions as per the last step, and make sure it is named code.bin

    The game crashed :(

    Share this comment


    Link to comment
    Share on other sites

    Just now, Jmscheuer said:

    The game crashed :(

    do you have a game update installed?

    Share this comment


    Link to comment
    Share on other sites

    1 minute ago, theSLAYER said:

    do you have a game update installed?

    Ahh crap I had it deleted it somehow reinstalled itself... It works thank you!!! 

    Share this comment


    Link to comment
    Share on other sites

    Just now, Jmscheuer said:

    Ahh crap I had it deleted it somehow reinstalled itself... It works thank you!!! 

    No worries. You won't necessarily have to delete the game update, just modify the code.bin from the update instead (I have steps for that too)

    Share this comment


    Link to comment
    Share on other sites

    Hey I'm back. I did the exact process on a gen 6 game extracting the .code file using gm9 and now I cannot find the hex strain using hxd when I search it. Was gen 6 a different set of numbers? 

    Share this comment


    Link to comment
    Share on other sites

    On 2/4/2023 at 1:48 AM, theSLAYER said:

     

    So to make sure I was doing things correctly I pulled my code file from a different gen 7 game and successfully did the edit again however I tried using X, Y(update file), and AS with X and Y unable to find hex strain and AS I found the staring but had no 0A anywhere in sight just like a prior comment on the thread 

    Share this comment


    Link to comment
    Share on other sites

    I was trying to do this but couldn't seem to find the 21 E2 03 20 92 E1 1C  string so i was wondering what i'm supposed to do??

    Share this comment


    Link to comment
    Share on other sites

    How do I get makerom.exe? My extract exefs dose not have .bat at the end. 

    Edited by JaylenGrimm

    Share this comment


    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...