[Release] ExInjector - Inject original exheaders into repacked roms

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by piratesephiroth, Nov 8, 2014.

  1. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    This solves about 90% of all compatibility problems with repacked roms, since issues usally come from exheader settings.
    You don't need to waste time tweaking RSF files anymore. Get any good RSF file and you just have to set the obvious settings, like BasicInfo, CardInfo and Options. Leave the rest as is and build with any -desc template.
    Inject the original exheader and you always get a flawlessly repacked rom.

    It can also make any rom work from the SD and spoof firmware requirements as if the game was made for v4.0 (won't make the most recent games work though).

    It's a command line tool but double clicking the exe will also work.

    This method was originally discovered by ground, but it takes a bit of work to be done manually, so I made this crappy thing.
    I also added a new feature: it can make any game work from the SD card, but only if your rom isn't encrypted.

    It works via command line, so you can include it into your batch scripts but you can also double click the exe and it will ask you for the files.

    (Remember you need to extract the exheader with ctrtool. If you dump it with 3DSExplorer it won't work)

    Update 1:
    Now it checks if it's a retail rom;
    Doesn't use msg.exe anymore;

    Update 2:
    Supports NCCH files.
    Changed bat example because -ccitocia option is buggy (thanks VerseHell)

    Update 4:
    Supports firmware spoofing, so more games can run on the CFW's 4.X NAND.
    Any game that works with Gateway's firmware spoofing should work in the CFW as well.
    Thanks, Riku, for the idea.

    Update 5:
    Only offfer fw spoofing if the selected rom requires it.

    Update 6:
    Fixed some little stuff and disable exheader's "SD App" flag if the "-sd" switch isn't used

    Example:
    here's what I used to repack Animal Crossing into a functional CIA file:
    Code:
    ..\makerom -f ncch -target t -desc ecapp:3 -rsf gw.rsf -exefslogo -romfs extracted\xored_romfs.bin -exheader extracted\xored_exheader.bin -code extracted\exefs\code.bin -icon extracted\exefs\icon.bin -banner extracted\exefs\banner.bin -alignwr -o ANIMALTEST.CXI
    ..\exinjector -rom ANIMALTEST.cxi -exheader extracted\xored_exheader.bin -sd -fwspoof
    ..\makerom -f cia -target t -content ANIMALTEST.cxi:0:0 -o ANIMALTEST.cia
    
     

    Attached Files:

    Last edited by piratesephiroth, Oct 16, 2015


  2. kyogre123

    kyogre123 Mexican Pride

    Member
    2,919
    1,260
    Sep 23, 2013
    Mexico
    I'll be testing the ship out of this after I get back home.
     
  3. PieFace

    PieFace Advanced Member

    Newcomer
    59
    31
    Aug 4, 2014
    United States
    Can this be used also when the rom is encrypted and the .cia is rebuilt from the extracted binaries?
     
  4. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    If the rom is encrypted we can't edit the exheader directly without resigning it. So it will only work as a CIA if the encrypted rom can already run from the SD.
     
  5. PieFace

    PieFace Advanced Member

    Newcomer
    59
    31
    Aug 4, 2014
    United States
    Oh I see what your saying. I didn't read the first command all the way. So it builds the .3ds with the template exheader from makerom, then injects the actual exheader, then does -ccitocia.

    Edit: I don't have my 3ds on me at the moment, will try when I get home. :)
     
  6. Searinox

    Searinox <3

    Member
    1,734
    160
    Dec 16, 2007
    Romania
    Can this also work with .csu files?
     
  7. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    Yes. csu, cci and 3ds are the same thing.
     
  8. Riku

    Riku GBAtemp Regular

    Member
    281
    526
    May 3, 2009
    United States
    When using command
    Code:
    exinjector -rom MARIOTEST.3DS -exheader xored_exh.bin -sd
    It throws this:

    [​IMG]
     
  9. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    lol is your windows broken or what.
    where's your msg.exe?

    I'll edit it to handle that exception.
     
  10. Riku

    Riku GBAtemp Regular

    Member
    281
    526
    May 3, 2009
    United States
    Also, is it possible to change kernel version without touching signature? It would be nice having ability to change kernel version so SDK5 games could work on 4.5 fw.
     
  11. PieFace

    PieFace Advanced Member

    Newcomer
    59
    31
    Aug 4, 2014
    United States
    Ok, when running it just says "ERROR Could not read exheader file!" I am 99.9% certain that the file name is correct and that the exheader is valid
     
  12. pLaYeR^^

    pLaYeR^^ GBAtemp Fan

    Member
    400
    37
    Sep 18, 2014
    Australia
    Same here.
     
  13. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    Try using the GUI interface to see if you get the same result.
     
  14. pLaYeR^^

    pLaYeR^^ GBAtemp Fan

    Member
    400
    37
    Sep 18, 2014
    Australia
    I selected my original rom and my original exheader.bin but after nothing happened...
     
  15. PieFace

    PieFace Advanced Member

    Newcomer
    59
    31
    Aug 4, 2014
    United States
    LOL so it worked, but I accidentally clicked the exefs.bin :yaysp:
    Time to rebuild the rom :rofl:

    Edit: It let me use my exefs.bin, but not my exheader.out.bin?
     
  16. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    You should select your REPACKED rom and your ORIGINAL exheader.
     
  17. pLaYeR^^

    pLaYeR^^ GBAtemp Fan

    Member
    400
    37
    Sep 18, 2014
    Australia
    What means repacked?
     
  18. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    Repacked means the rom you rebuilt with makerom

    You can't convert a retail rom to CIA. You have to extract the data and rebuild it with makerom.
     
    pLaYeR^^ likes this.
  19. pLaYeR^^

    pLaYeR^^ GBAtemp Fan

    Member
    400
    37
    Sep 18, 2014
    Australia
    I accidentally injected my orginal exheader in my original .3ds rom. I havent made a backup of it. Can i use the rom or need i to dump it again?
     
  20. piratesephiroth
    OP

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    LOL you'll have to dump it again.

    I'm gonna add a check for retail roms too.
     
    Margen67 and pLaYeR^^ like this.