Rebuilding games for 4.x?

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by WulfyStylez, Feb 14, 2015.

  1. WulfyStylez
    OP

    WulfyStylez SALT/Bemani Princess

    Member
    1,149
    2,609
    Nov 3, 2013
    United States
    As I understand it, a couple of things currently cause games to not boot on 4.x.
    First, 5.0 added the ability for games to store the CXI logo near the cleartext part of the NCCH header rather than in ExeFS. Say we rebuild ExeFS with the logo in it.
    7.0 introduced a new encryption method, encrypting RomFS and everything except what NS needs in ExeFS with a different key. Obviously we can decrypt this, re-encrypt it the old way, and disable the flag that enables this new encryption.
    Finally, there are checks on version, but they only seem to go as far as checking the plaintext region of the header (correct me if I'm wrong). These checks could be bypassed by putting spoofed data here (lower version numbers to 4.x-happy ones.

    After everything, there's still a fairly significant chance that some titles will require dependencies from newer SDK versions. This is unavoidable, and those titles just won't work. If we're lucky, though, many games won't have newer dependencies. The 360 and PS3 scene get away with running newer titles on older libraries a lot, might be similar here.

    My question is, given a game is processed like I mentioned above and we get lucky with code running on the older SDK version, shouldn't this be theoretically completely possible?
     
  2. hippy dave

    hippy dave Butts Butts Megabutts

    Member
    2,587
    1,802
    Apr 30, 2012
    Sure. Try it and see :)
     
  3. AtlanticBit

    AtlanticBit Yeh, fuck this

    Member
    365
    189
    Jan 15, 2015
    Poland
    DEEP IN SPACE
    pls try doing this with ssb </sarcasm>
    but srsly i hope this works
     
  4. ChrisX930

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Hope it works :)
     
  5. WulfyStylez
    OP

    WulfyStylez SALT/Bemani Princess

    Member
    1,149
    2,609
    Nov 3, 2013
    United States
    There's a lot of dicking around with the exheader needed to get newer games to boot, it seems. I'll look into it more later. It still seems possible at this point, for some titles at least.
     
    ChrisX930 likes this.
  6. WulfyStylez
    OP

    WulfyStylez SALT/Bemani Princess

    Member
    1,149
    2,609
    Nov 3, 2013
    United States
    An update: It is technically possible and works for some titles.
    That being said, it requires so much manual work (exheader dependencies need to be patched down, etc) and is on such a case-by-case basis that I can't consider it to be comfortably working. Games generally need to use very basic SDK libraries - ones that don't change much. Puyo Puyo Tetris worked fine on 4.5.

    I'm going to leave this idea at that, and I'll be picking back up on another project that accomplishes the same means and then some. It's far too early to announce anything yet, but if anyone else is super familiar with ARM assembly, has a lot of free time, and knows/is willing to learn 3DS-specific technical stuff, PM me so I can get you in a relevant group. (Please don't bother me if don't meet those, though.) Thanks to anyone who's interested!!
     
  7. Ericss

    Ericss GBAtemp Fan

    Member
    465
    212
    Sep 1, 2010
    United States
    I'm not savvy on ARM assembly, but I wish you good luck. This should be useful for both CFW and GW users (as that means being able to take screenshots and use plugins on recent games with NTR CFW).
     
  8. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,269
    8,743
    Oct 27, 2002
    France
    Engine room, learning
    with ROM tool, Games have a required Kernel version.
    Do you know what's its purpose?

    chance are that it's used to tell which SDK functions it requires, right? probably the minimum system version required to run the game. but the version don't match system menu versions numbering.

    Majora's mask : Req. Kernel Version: 2.39-0
    Mario kart 7 : Req. Kernel Version: 2.31-40
    Monster hunter 4 : Req. Kernel Version: 2.44-5

    maybe one specific title version? NATIV_FIRM?
     
  9. WulfyStylez
    OP

    WulfyStylez SALT/Bemani Princess

    Member
    1,149
    2,609
    Nov 3, 2013
    United States
    It's actually something that aims to supersede both GW and the current hacky "CFW". Don't get hype yet, though. I'm still on the stage of taking notes on other payloads and such. It'll be a while, even longer if I end up not being able to find some other people to collaborate with.

    Those values come from the plaintext region of the NCCH, as well as a bunch of version references and dependencies in the exheader. Patching those locations to lower versions, along with doing the stuff with decryption and logo data I mentioned in my first post, allowed a couple basic games to run on 4.5.

    EDIT: oh, and 'what sdk functions are required' also come from a long list near the beginning of the exheader. They've got versions too.
     
    Cyan likes this.
  10. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,269
    8,743
    Oct 27, 2002
    France
    Engine room, learning
    I didn't check exheader format yet.
    I guess I'll take a look, thanks.
     
  11. lisreal2401

    lisreal2401 GBAtemp Fan

    Member
    496
    208
    Jun 4, 2013
    United States
    Interesting. My question is - is this any different from the firmware spoofing tools we already have? I was also under the impression the games that don't work spoofed, simply don't work due to SDK dependencies being changed. The game used in your example (Puyo Tetris) which is 6.2, works using spoof tools already. I suppose a good test subject would be Theatrhythm Curtain Call. JPN version works spoofed with regular tools, but the US/EUR version don't. JPN is 6.2, US/EUR is 7.x. I can't imagine any 7.x SDK libraries were introduced in the English version, so it must the tools unable to patch out 7.x encryption. 6.X and under SDK all seem to work without a hitch in my experience.