How can I slice my .code in sections ?

Discussion in '3DS - Homebrew Development and Emulators' started by Mrrraou, Oct 28, 2015.

  1. Mrrraou
    OP

    Mrrraou GBAtemp Advanced Maniac

    Member
    1,869
    2,167
    Oct 17, 2015
    France
    I want to slice a .code from a ExeFS and I have the exheader. I tried to read myself the values with an hex editor (with the help of the Citra source code) to get size and location of sections. But it seems that the values I retrieved are incorrect. Would someone please help me with that ?

    EDIT: Structure of the NCCH Extended Header (Exheader): http://3dbrew.org/wiki/Exheader
     
    Last edited by Mrrraou, Oct 28, 2015
  2. VegaRoXas

    VegaRoXas GBAtemp Regular

    Member
    290
    158
    Mar 29, 2015
    Gambia, The
    I think you should just be able to extract everything using ctrtool.
    Or by using my tool :P
     
  3. Mrrraou
    OP

    Mrrraou GBAtemp Advanced Maniac

    Member
    1,869
    2,167
    Oct 17, 2015
    France
    Your tool is about editing romfs/exefs, but I'm talking here about the .code located in the exefs. ctrtool can't do that (as far as I know).
     
  4. VegaRoXas

    VegaRoXas GBAtemp Regular

    Member
    290
    158
    Mar 29, 2015
    Gambia, The
    Well you can extract the exefs to get the icon, banner, logo and the code!
    You can use ctrtool -t exefs --exefsdir=exefs --decompresscode yourexefs.bin.
    If you don't feel like doing this, use my tool. It just does that for you lol
     
  5. Mrrraou
    OP

    Mrrraou GBAtemp Advanced Maniac

    Member
    1,869
    2,167
    Oct 17, 2015
    France
    I have the .code file. I just want to slice it in sections, to get the .text, the .data and the .rodata.
     
  6. VegaRoXas

    VegaRoXas GBAtemp Regular

    Member
    290
    158
    Mar 29, 2015
    Gambia, The
    Ahh ok. I can't help you, sry :/