romfs redirection and disassembly question

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by Bastani, Apr 14, 2016.

  1. Bastani
    OP

    Bastani Advanced Member

    Newcomer
    74
    60
    Mar 13, 2016
    Canada
    Is it hard to write code to the code.bin to make it access the romfs from the update instead of the game itself? how do you even begin to mount it?

    I've seen different code for games but they already initialized their own update patch directory.
    The game itself has a dlc that has a romfs but to just compile all the contents together seems like a real pain.

    Also are there any programs there that can convert the code.bin into assembly code or anywhere that I can check to see the assembly functions for the 3DS so I can translate the functions? Maybe then I can figure out how to mount a second romfs.
     
  2. NCDyson

    NCDyson Hello Boys...

    Member
    271
    113
    Nov 9, 2009
    United States
    according to 3dbrew:
    As far as making the game mount and utilize it goes, you may have to study the differences between the code.bin from a game and the code.bin from an update to see how to make that work.
     
  3. Bastani
    OP

    Bastani Advanced Member

    Newcomer
    74
    60
    Mar 13, 2016
    Canada
    Do you think it's possible to take something like layeredfs and make it run from the code.bin and either get it to read from the romfs or the SD itself?
     
  4. NCDyson

    NCDyson Hello Boys...

    Member
    271
    113
    Nov 9, 2009
    United States
  5. GalladeGuy

    GalladeGuy Freeze Kirby :3

    Member
    2,588
    2,652
    Oct 28, 2015
    United States
    Use the latest version of IDA Pro. Start it up, open code.bin and select ARM (Little-Endian) as the processor type. Then press "edit" on the toolbar and then select all. Then, click on the little thing on the toolbar that says "code" and then "force". It'll take a while, but when its done you'll have some ARM Assembly code that you can copy into a file for safe keeping.
     
    DesuIsSparta likes this.
  6. NCDyson

    NCDyson Hello Boys...

    Member
    271
    113
    Nov 9, 2009
    United States
    patchrom includes a python script to convert a code.bin to an elf file by reading the section info from the exheader to load in ida, which I've found works pretty well.
    Alternatively http://github.com/smealum/ctr/tree/master/idaloader is a firm/ncch loader for ida, but it requires idapython and a module called construct.
     
    Last edited by NCDyson, Apr 16, 2016
  7. Bastani
    OP

    Bastani Advanced Member

    Newcomer
    74
    60
    Mar 13, 2016
    Canada
    @NCDyson @GalladeGuy Thank you guys, I'll make sure to take a look at it once I have the time, but this is really helpful :)
     
    GalladeGuy likes this.