Can someone tell me how to decrypt 3ds backups on(N3DS only)

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by xdarkmario, Sep 17, 2015.

  1. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    Ok so i am having a hard time decrypting 3ds backups on my n3ds ver 9.0.
    there are a bunch og confusing guides that explain on how to decrypt on a O3ds and a n3ds in one guide and they keep cross referencing to things that saying skip this if you new or old 3ds and do this but not if your 7.x+ or such

    this dosent help and dosent work
    https://github.com/citra-emu/citra/wiki/Decryption

    can someone tell me how do i go about this for ONLY a n3ds with a sysnand of 9.0

    heres where i am now, i have downloaded a decrypt9 from in here
    https://gbatemp.net/threads/release-3ds_ctr_decryptor-void.370684/
    (https://mega.nz/#!7dIGgJKL!RL1rkYMlpz1gV-EDQZSRc5WGWYU-r86iD_3GwONSQvg)
    but idk if that version works for me.

    i made a ncchinfo.bin and rom backup on on the root.
     
  2. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    If you just want to decrypt roms to try and run on Citra (i assume that's what you wanna do seeing as you linked to citra related stuff, correct me if I'm wrong).
    You can just use Decrypt9's rom decryption feature. (don't believe this is in archshift's version yet).
    So use this one https://github.com/Shadowtrance/Decrypt9/releases/tag/v2.1

    If you need any help, just let me know where you run into trouble and I'll try help. :)
     
  3. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    well im decrypting 1 because im just curious about the contents of roms, maybe rom edits and 2 i may convert my .3ds files to cia one day.

    i had this version of decrypt9 before, it gives a error with ncchinfo.bin saying wrong version.
     
  4. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    It shouldn't give that error if you use the ncchinfo_gen script that comes with it.
     
  5. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    it still does, it says wrong version ncchinfo.bin
    NCCH Padgen failed (with old ncchinfo)

    the ncchinfo_gen.py that came with the app can't generate a ncchinfo it gives a error

    Code:
    Parsing NCSD in file "Tomodachi Life[C2].3ds":
      Parsing Main NCCH
        NCCH Offset: 00004000
        Product code: CTR-P-EC6E
        Partition number: 0
        KeyY: 39BA9A2F7DCF1533D32466E83970079E
        Title ID: 000400000008C300
        Format version: 2
        Uses 7.x NCCH crypto
    
    Traceback (most recent call last):
      File "C:\Users\xdark\Downloads\decrypt9\scripts\ncchinfo_gen.py", line 282, in <module>
        result = parseNCSD(fh)
      File "C:\Users\xdark\Downloads\decrypt9\scripts\ncchinfo_gen.py", line 138, in parseNCSD
        result = parseNCCH(fh, header.offset_sizeTable[i].offset * mediaUnitSize, i, reverseCtypeArray(header.titleId), 0)
      File "C:\Users\xdark\Downloads\decrypt9\scripts\ncchinfo_gen.py", line 183, in parseNCCH
        data = data + parseNCCHSection(header, ncchSection.exheader, 0, 0, 1, tab)
      File "C:\Users\xdark\Downloads\decrypt9\scripts\ncchinfo_gen.py", line 225, in parseNCCHSection
        titleId = struct.unpack('<Q',(bytearray(header.programId[:8])))[0]
    struct.error: unpack requires a string argument of length 8
     
  6. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    Yeah it will fail if you're using an old version of the script with a newer version of decrypt9. That's normal.
    As for the other issue, I've no idea what the cause is. What python version do you have installed?
     
  7. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    Python 2.7
     
  8. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    Anyone know what that error means? That is what's stopping me from decrypting roms.
    Also is there a way to skip or generate ncchinfo on the system itself?
     
  9. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    No idea what the deal is with that error. the script works fine for me.
    But you can skip the whole xorpad (ncchinfo) thing if you want to and just decrypt the rom directly with the "rom decryption" option in decrypt9.
     
  10. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    that gives a (could not open work directory) error
    wheres the work directory? it says working directory is /decrypt9 but i already have that folder there..
     
  11. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    Should be /Decrypt9 on sd root, then inside that should be /D9titles roms go in there for the rom decryption option.

    Read the README.txt!! -.-
     
    xdarkmario likes this.
  12. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    thanks, looks like its working! its at
    decrypting RomFS 18%

    readme didnt say anything about that, btw im using the MSET methoid
     
  13. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    Ah my bad, thought I'd put that in the readme. guess i didn't.
    Yeah it takes a little while depending on game size.
    Once it's done it won't look like anything has happened but it is decrypted and then you can extract it on pc (try the tool in the 2nd link in my sig).
     
  14. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    ok its done, but how do i tell its decrypted? perhaps by the way that all timestamps are gone?
    and in your 3ds rom tools how do i extract the files of that .3ds file into windows readable files
    clicking the 3 buttons do nothing, makes one folder with the name of the rom and inside that are 3 folders

    decrypted
    encrypted
    unpacked

    and inside of those are always empty even after i click
    extract exheadder, extractexefs and extract romfs
    the buttons do nothing. i even ran as administrator and as windows 8 and windows 7 compatibility
     
  15. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    hmm... yeah i think the timestamps disappear after it's decrypted on the 3ds.
    As for extracting it, it should be as simple as opening the rom with the browse button, then pressing each extract button, then each unpack button after that.
    Then all the extrtacted files will be in the unpacked sub folder of the game folder.

    Some people have had issues with that version of ctrtool not working for them for some reason (not sure why) and apparently this version worked for them. https://gbatemp.net/attachments/ctrtool-rar.10457/ so maybe try replacing ctrtool.exe with that one and see how you go.
     
    xdarkmario likes this.
  16. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom
    yep that fixed it.
    and for future references how would i recompile it back to a .3ds or .cia?
     
  17. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    To rebuild it back to a .3ds file this i believe should do the trick https://gbatemp.net/threads/release-3ds-builder.388858/
    To cia, would probably be a rebuild to .3ds then convert to cia job i think.
     
    xdarkmario likes this.
  18. xdarkmario
    OP

    xdarkmario Philosopher

    Member
    1,331
    310
    Dec 30, 2010
    United States
    Mushroom Kingdom