Patching CIA Executable

Discussion in '3DS - Tutorials' started by gudenau, Mar 24, 2016.

Mar 24, 2016

Patching CIA Executable by gudenau at 8:21 PM (3,634 Views / 8 Likes) 23 replies

  1. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    I will show you how to patch a CIA's executable, this will allow you to do things like install SaltySD without NTR.

    Requirements:
    • Ctrtool (in tools.zip)
    • 3dstool (Also in tools.zip)
    • makerom (guess where?)
    • Hex editor
    • CIA you want to patch
    • CFW
    • Decrypt9WIP

    Step 1: Decrypt the CIA
    Warning: Spoilers inside!

    Step 2: Extract the CIA
    Warning: Spoilers inside!

    Step 3: Modify the code
    Warning: Spoilers inside!

    Step 4: Repack the CIA
    Warning: Spoilers inside!

    Step 5: Fix Versions (optional, but recommended)
    Warning: Spoilers inside!

    Step 6: Encrypt The CIA
    Warning: Spoilers inside!

    Step 7: Profit
    [​IMG]

    If someone has a capture device, I would love some screenshots of D9!
     

    Attached Files:

    Last edited by gudenau, Mar 24, 2016


  2. TR_mahmutpek

    Member TR_mahmutpek GBAtemp Advanced Fan

    Joined:
    Jul 28, 2015
    Messages:
    614
    Country:
    Turkey
  3. lonzodavis

    Member lonzodavis GBAtemp Regular

    Joined:
    Aug 24, 2015
    Messages:
    101
    Country:
    United States
    Could this work to add music to a smash update.cia?
     
    Last edited by lonzodavis, Mar 26, 2016
  4. DrCrygor07

    Member DrCrygor07 Italian Wario Ware bootleg©

    Joined:
    Sep 4, 2014
    Messages:
    1,665
    Country:
    Italy
    Will it work for ctgp-7?
     
  5. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    Does it change the ROMFS? If so, then no.
     
  6. DrCrygor07

    Member DrCrygor07 Italian Wario Ware bootleg©

    Joined:
    Sep 4, 2014
    Messages:
    1,665
    Country:
    Italy
    Well, it needs layered fs so I think it will not work.
     
  7. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    Yeah, I will try to make a layeredFS patcher for this method later. It will not work at the moment. :-(
     
    DrCrygor07 likes this.
  8. Lycanroc

    Member Lycanroc Midnight Wolf

    Joined:
    May 11, 2014
    Messages:
    1,946
    Country:
    Serbia
    I legit snorted at the screenshot
     
    Last edited by Lycanroc, Mar 24, 2016
  9. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    Thanks!
     
    Lycanroc likes this.
  10. Yudowat

    Member Yudowat That one guy that shows up occasionally

    Joined:
    Jun 12, 2015
    Messages:
    535
    Country:
    Australia
    Anybody else getting
    Code:
    [CIA ERROR] Content 0 Is Corrupt (res = -11)
    [RESULT] Failed to build CIA
    when trying to build the CIA at the end of step 4? I get it every single time I try to build a EUR SaltySD and its driving me insane
     
    Last edited by Yudowat, Mar 24, 2016
  11. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    EUR update BTW. I used the US update.
     
    Yudowat likes this.
  12. Red9419

    Member Red9419 GBAtemp Advanced Fan

    Joined:
    Apr 17, 2014
    Messages:
    504
    Country:
    Antarctica
    Where exactly do i get code-orig.bin? The only file closest to it is code.bin in the exefs folder. On a side note how would i modify it? Hex editor or any dedicated programs?
     
  13. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    When you decompress the code, it will make that file in the working directory.
     
  14. Red9419

    Member Red9419 GBAtemp Advanced Fan

    Joined:
    Apr 17, 2014
    Messages:
    504
    Country:
    Antarctica
    I extracted the files. Hmm does it matter if im on update 1.1.4?
     
  15. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    Did you execute "3dstool -uvf exefs/code.bin --compress-type blz --compress-out code-orig.bin"?
     
  16. Red9419

    Member Red9419 GBAtemp Advanced Fan

    Joined:
    Apr 17, 2014
    Messages:
    504
    Country:
    Antarctica
    Yes. It takes about 2 seconds to input a new command afterwards so im certain it went through, but im not seeing any output.
    Edit: I will restart the whole process and see if it fixes anything.

    — Posts automatically merged - Please don't double post! —

    I re-extracted everything and it seems like i got it now. How would i edit this file now?
    EDIT: Just opened it up in a hex editor. Do i just swap out a characters name hex code with the modified hex?
     
    Last edited by Red9419, Mar 28, 2016
  17. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    No idea, depends on the game.
     
  18. Red9419

    Member Red9419 GBAtemp Advanced Fan

    Joined:
    Apr 17, 2014
    Messages:
    504
    Country:
    Antarctica
    Smash bros. I would like to change the result screen similar to your screenshot
     
  19. gudenau
    OP

    Member gudenau Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,126
    Location:
    /dev/random
    Country:
    United States
    Ah, you need SaltySD and MSBT Editor Reloaded, edit ui/message/melee.msbt
     
  20. Red9419

    Member Red9419 GBAtemp Advanced Fan

    Joined:
    Apr 17, 2014
    Messages:
    504
    Country:
    Antarctica
    Since this is repacking the CIA would the loading times be fixed? I had SaltySD before and tbe loading times were so awful for just some image modifications
     

Share This Page