[Tutorial] How to decompress and repack RPX/RPL files

Discussion in 'Wii U - Hacking & Backup Loaders' started by Pounou, Oct 17, 2015.

  1. Pounou
    OP

    Pounou GBAtemp Regular

    Member
    188
    93
    Sep 4, 2014
    France
    With the help of @Markus95 and @gamesquest1 i have understand how to decompress and repack RPX/RPL files.
    With this you can modify the .elf of rpx/rpl files to inject an other rom or compress it for use with loadiine.

    Disclaimer: In this tutorial you will need makerpl64.exe, i will not share this its Nintendo coprighted ! Plz dont ask for this it's only for people who get the SDK on their hands. All comments about asking download link or something related to the SDK will be deleted. I open this thread like that everybody can try to make things goes faster. I hope the compatibility list will grow every day.

    What you need:
    rpl2elf.exe by Hykem
    makerpl64.exe
    Hex editor

    First step: Convert RPX/RPL files to ELF

    For this we need the tool created by Hykem
    -Download it on the attached files and take the file you want to convert
    In my exemple i take an rpx file "Block.rpx"
    -Put them on the same folder and type on your command invit :
    Code:
    rpl2elf Block.rpx block.elf
    For you replace block by the name of your file

    Now we get the .elf file we will see how to repack them.

    Second step: Repack your file to compress his size

    For this we will use makerpl64.exe, it allows you to set the compression level with -z9 for max compression, and you can also add -s to strip some extra unnecessary leftover stuff off the rpx.

    -Put the elf file in the folder of makerpl64.exe open your command invite and type:
    Code:
    makerpl64 -f -z9 -s xxxx.elf
    Replace the "xxxx" by the name of your file
    -You got now your RPX/RPL file compressed and ready to use with loadiine

    Third step: How to inject a VC rom in your .elf file
    New games confirmed working with loadiine now:
    Sonic boom
    Batman Arkham City - Armored Edition
    Fifa 13

    PS: Big thanks to markus95 and gamesquest1 for all the technicall informations and Hykem for his incredible tool
    Don't forgot to post here if your new compressed rpx file make the game compatible with loadiine i will update your result here
     

    Attached Files:

    Last edited by Pounou, Oct 17, 2015


  2. jeppad

    jeppad Advanced Member

    Newcomer
    84
    24
    Sep 27, 2014
    Gambia, The
    Great Work! That Batman Game (Armored Edition) works with this method too

    Edit: The name of the game is actually:
    Batman Arkham City - Armored Edition
     
    Last edited by jeppad, Oct 17, 2015
  3. Plunt

    Plunt GBAtemp Regular

    Member
    143
    40
    Nov 21, 2010
    Canada
    Ontario
    Thanks for posting the tutorial. I'm sure a lot will find it useful
     
  4. mixelpixx

    mixelpixx Advanced Member

    Newcomer
    85
    65
    Aug 10, 2014
    United States
    y0uR m0mz b0x
    Isn't there a command line option for it to exclude redundancies? Or is that automatic now? (Reduces file size?)

    * i was in process of automating this. if anyone knows any other command line options that are relevant or useful let me know..
     
    Last edited by mixelpixx, Oct 17, 2015
    CableLeecher likes this.
  5. ByteBite

    ByteBite GBAtemp Regular

    Member
    137
    115
    Aug 20, 2013
    Sweden
    This is cool, maybe someone could share before and after figures on these RPX files? Interested in knowing how much the compression can affect them.
     
  6. Skater4599

    Skater4599 GBAtemp Advanced Fan

    Member
    940
    60
    May 29, 2008
    United States
    United States
    Thank you for sharing this! I was hoping a tutorial would be posted :)

    Has anyone found any downside to compressing these? Longer load times or anything?
     
  7. jeppad

    jeppad Advanced Member

    Newcomer
    84
    24
    Sep 27, 2014
    Gambia, The
    Why should there be longer loading times?
    You just "make" the rpx/rpl file smaller so loadiine can load the games
    My english isnt so good, I would like to explain it better for you.
     
    Last edited by jeppad, Oct 17, 2015
  8. gamesquest1

    gamesquest1 Nabnut

    Member
    14,119
    9,455
    Sep 23, 2013
    nope, the decompression will add virtually nothing in terms of load times, as once the game is booted it will run fine then, most of the space saving comes from the -s command which will strip out left over junk from the rpx file
    also FIFA 13 works

    oh and if the rpx doesn't work try adding the -old command, that was required to get sonic boom working, makes the rpx slightly larger but unless i messed up sonic boom didnt work without using -old
     
    Last edited by gamesquest1, Oct 17, 2015
  9. yahoo

    yahoo G͝B͢A͜t͞em҉p̡ R̨e͢g̷ul̨aŗ

    Member
    341
    236
    Aug 4, 2014
    United States
    What was the file size of the rpx for sonic boom before and after compression?
     
  10. gamesquest1

    gamesquest1 Nabnut

    Member
    14,119
    9,455
    Sep 23, 2013
    before 25,287,936
    after 20,768,256

    fifa 13 was
    27,602,688 before
    22,925,046 after

    which afaik is the largest confirmed loading rpx file so far
     
    Last edited by gamesquest1, Oct 17, 2015
    fiveighteen and ByteBite like this.
  11. asper

    asper GBAtemp Advanced Fan

    Member
    610
    306
    May 14, 2010
    United States
    Did makerpl works without installing the green hill compiler? I mean are some of you able to run the 32 or 64bit version of makerpl without the sdk chaintool?
     
  12. dernettemann1983

    dernettemann1983 GBAtemp Regular

    Member
    278
    35
    Mar 7, 2006
    Gambia, The
    i need some help. i have installed cygwin and green hill. i'm getting this error:
    C:\Users....\wiiu\cafe_sdk-2_12_13\cafe_sdk-2_12_13-2
    0150609_en\cafe_sdk\system\bin\tool>makerpl32 -f -z9 -s test.elf
    ***Error: CAFE_ROOT is not defined


    C:\Users...\wiiu\cafe_sdk-2_12_13\cafe_sdk-2_12_13-2
    0150609_en\cafe_sdk\system\bin\tool\makerpl\makerpl32.exe FAILED Error = -1
     
  13. Ackermann

    Ackermann Member

    Newcomer
    11
    0
    Nov 24, 2014
    Cote d'Ivoire
    Mario Party 10 works?
     
  14. wj44

    wj44 GBAtemp Fan

    Member
    477
    354
    Jun 18, 2015
    Gambia, The
    Code:
    SET CAFE_ROOT=C:\Users....\wiiu\cafe_sdk-2_12_13\cafe_sdk-2_12_13-2
     
    Mega-Mew and dernettemann1983 like this.
  15. Bahax FZ

    Bahax FZ GBAtemp Regular

    Member
    157
    171
    Oct 31, 2013
    Brazil
    Suggested games for testing, which has RPX/RPL large files:

    - Assassin's Creed III
    - Assassin's Creed IV
    - Darksiders 2
    - Disney Infinity 2.0
    - Epic Mickey 2
    - Mario Party 10
    - Splinter Cell Blacklist
    - Tekken Tag Tournament 2
    - Watch Dogs
    - Transformers: The Dark Spark
     
    paulloeduardo likes this.
  16. Reecey

    Reecey Mario 64 (favorite game of all time)

    Member
    4,278
    1,109
    Mar 7, 2010
    At Home :)
    where is the makerpl64.exe I have downloaed the sdk files but cannot find it? do you have to extract it or something?
     
    Last edited by Reecey, Oct 17, 2015
  17. mixelpixx

    mixelpixx Advanced Member

    Newcomer
    85
    65
    Aug 10, 2014
    United States
    y0uR m0mz b0x
    Switches for makerpl64.exe

    -zx
    Do not compress (default is to compress). May hamper disassembly of the RPX/RPL file with ELF dump tools. See -s option also.

    -z[1-9] Compression level. Default is 6.

    -f Force as RPX (required to build RPXs).

    -d Deprecated. Set dynamic-only flag in file info.

    -s Strip function symbols that are not imported or exported.

    -new New, smaller RPL symbol table. Default.

    -old Use old larger method for generating the symbol table.

    -h <n> Override the default system heap size with new value <n> in bytes. Default heap size is 32 KB.

    -checknosda Verify that the RPX/RPL does not use a Small Data Area.

    -stack <n> Override the default initial stack size with new value <n> in bytes. Default is 64 KB.

    -l <file> Compatibility for pre-v1.0 RPL Tools. Specify the output import library file (.a).

    -v Print verbose info.

    -warnemptyrela Emit a warning if a relocation section points to the NULL section and has empty relocations.

    -t BUILD_TYPE=<build_type> Embed BUILD_TYPE information into the output file. A string “DEBUG” or “NDEBUG” is assignable to <build_type>. This option is required when the output is an RPX file.

    -nolib
    Disable generation of the import library. Always use this option if preprpl[32|64] is used to build the import library

    -padall <n>
    Pad the TEXT, DATA, LOAD and TEMP sections by <n> percent.

    -sizedata <n> Set data area to <n> bytes. Must also set -sizetext <n> -sizeload <n> -sizetemp <n>.

    -sizetext <n> Set text area to <n> bytes. Must also set -sizedata <n> -sizeload <n> -sizetemp <n>.

    -sizeload <n> Set load area to <n> bytes. Must also set -sizedata <n> -sizetext <n> -sizetemp <n>.

    -sizetemp <n> Set temp area to <n> bytes. Must also set -sizedata <n> -sizetext <n> -sizeload <n>.

    -sizefileinfo <n> FileInfo set to <n> bytes. Can be used independently of other padding options. FileInfo must be at least 96 bytes.

    -dbg_source_root <dir> <dir> is a file path (Windows, Cygwin or mixed). Review all source roots passed to makerpl[32|64] to use the first one that matches up with the input ELF file to create a relative path in the FileInfo. $(CAFE_ROOT)/system is added implicitly by the N*nte*ndo makefile build system and additional paths may be added.
     
    Last edited by mixelpixx, Oct 17, 2015
    dubyadud, I pwned U! and Reecey like this.
  18. gamesquest1

    gamesquest1 Nabnut

    Member
    14,119
    9,455
    Sep 23, 2013
    - Assassin's Creed III (size makes it unlikely to work)
    - Assassin's Creed IV (compatibility list is wrong, there is actually 2 rpl files totalling 50MB+....will test but not hopeful )
    - Darksiders 2 (tested, doesnt compress down enough)

    - Disney Infinity 2.0 (looks likely to work)
    - Epic Mickey 2 (looks likely to work)

    - Mario Party 10 (very unlikley to work due to the sheer size)
    - Splinter Cell Blacklist (tested with update rpx and didnt get it small enough.worth trying, but i doubt it will make much difference)
    - Tekken Tag Tournament 2 (rpx/rpl size looks to be too big, but worth trying)
    - Watch Dogs (rpx/rpl size looks to be too big, but worth trying)

    - Transformers: The Dark Spark (looks "possible" to work but it will be close)
     
  19. Pounou
    OP

    Pounou GBAtemp Regular

    Member
    188
    93
    Sep 4, 2014
    France
    When you finish your test send me the result i will update the list. Thanks for your time
     
    paulloeduardo likes this.
  20. Skater4599

    Skater4599 GBAtemp Advanced Fan

    Member
    940
    60
    May 29, 2008
    United States
    United States

    I was literally just doing the same thing, downloaded the SDK, no files in it, installed the compiler tools, still no joy. I'm thinking I don't have the correct download or something? Let us know if you find an answer for it! Thanks!
     
    paulloeduardo and Reecey like this.