[Semi-working] NFS2ISO2NFS - convert nfs to iso and back

Discussion in 'Wii U - Hacking & Backup Loaders' started by sabykos, Jan 4, 2017.

  1. sabykos
    OP

    sabykos GBAtemp Regular

    Member
    226
    371
    Jun 10, 2013
    Gambia, The
    NFS2ISO2NFS is a simple program to convert .nfs files to .iso files and vice versa. .nfs files are files that are contained in Wii eShop games. With this tool you can revert them into a working .iso file.

    Usage:
    I recommend placing the .exe file in the content folder of a Wii eShop game and just use the command
    Code:
    nfs2iso2nfs -dec -wiikey "pathToWiiCommonKeyFile"
    to convert -nfs files to iso. For converting .iso files to .nfs you need the command "-dec"

    Quick overview of the commands:

    Code:
    -dec  Decrypt .nfs files to an .iso file.
    -enc  Encrypt an .íso file to -nfs files
    -key <file>  Location of AES key file. Default: code\\htk.bin.
    -wiikey <file>  Location of Wii Common key file. Default: wii_common_key.bin.
    -iso <file>  Location of .iso file. Default: game.iso.
    -nfs <file>  Location of .nfs files. Default: current Directory.
    -keep  Don't delete the files produced in intermediate steps.
    Note:
    This does not mean that Wii VC injection is working! There is still an 8 byte part of the EGGS header, which is unknown. This program fills this part just with zeros. However, @JaGoTu10 hasn't found any code in the WiiVC's fw.img that checks those 8 bytes, so setting them all zero *might* work.

    Another problem are the nfs files themselves. Those are somewhat special. They cant be replaced with ftpiiU everywhere and their permissions cant be displays with wupserver. Deleting them and reuploading the same files results in an restart of the console, if the WiiVC game is started. Repacking them didnt work for me neither.

    So, you see, nothing special here. But I thought it would be better to publish this program than to keep it to myself. And please don't be too harsh on my coding skills. This is pretty much my first project. Also, this program isnt tested very thouroughy. It builds working isos of Super Mario Galaxy 2 and Kirby's Return to Dreamland, but I can not guarantee that it works for every game. It should.

    I want to thank the following people

    @JaGoTu10 for all his research concerning OSv1 and Wii VC games, especially for figuring out parts of the EGGS header
    @Falo for his research concerning the encryption of nfs files
    @AboodXD for pointing me in the right direction once or twice
    And all the poeple that worked on WiiBrew Wiki

    https://github.com/sabykos/nfs2iso2nfs
    https://github.com/sabykos/nfs2iso2nfs/releases

    EDIT: As always I forget some important parts: YOu need the Wii Common key to use this program. Look for it in the net and either put it in the source code and compile the program or pit it in some file and use the -wiikey command.
     
    Last edited by sabykos, Jan 5, 2017


  2. ItsKipz

    ItsKipz l33t hax0r

    Member
    1,592
    926
    Sep 9, 2016
    United States
    The C: drive
    If this is used to repack an iso to nfs files, will it install properly?
     
  3. jose1209

    jose1209 Member

    Newcomer
    27
    17
    Jul 2, 2007
    Burkina Faso
    thanks !


    FSHAX A fairly simple patch that allows anything to access the entire Filesystem (as far as I know).
    does this not help swapping the nfs files ?
     
  4. SupremeDevice

    SupremeDevice Newbie

    Newcomer
    7
    1
    Jan 5, 2017
    United States
    Edit: I initially had an error but trying again produced a working iso file from SMG2
     
    Last edited by SupremeDevice, Jan 5, 2017
  5. sabykos
    OP

    sabykos GBAtemp Regular

    Member
    226
    371
    Jun 10, 2013
    Gambia, The
    Well as I said, there are some problems left:

    • There is a byte that is 0x9 around adress 0x10000 in the decrypted nfs files. No one knoew why it's there and if it's always 0x9. Assuming it is always 0x9, I could add that easily.
    • There are 0x8 bytes in the header that are unknown. They *seem* to be a hash of some sort, no one knows. Jogatu didn't find any codes that reads those byte. My program sets them zero. This might oder might not work.
    • How to install those. the packager program (forgot its name) doesnt have any rules for the files inside the code folder. So if someone wants to write rules for those, and repack the nfs files generated by program: Go ahead, try it. It might work work, but most likely the nfs files won't be like they should. As I said theres something strange about them concerning permissions. If someone wants to download the encrpted packages of an WiiVC and take a look wahta rules are applied and if something special about how the nfs files are stored, please go ahead and do it. It might be the key to WiiVC injection.
    If those three things are figured out, we have WiiVC injection working.

    Well deleted the nfs files on my system and uploaded the originals back to the system and gave them all permissions. THats basically what this patch does to them. And well, it dodn't work.

    Was it an error, because you made somthing wrong, or was it a bug. If its the latter, please provide more information.
     
    zeldaism likes this.
  6. victormr21

    victormr21 GBAtemp Fan

    Member
    472
    52
    Dec 29, 2015
    Thanks you so much Sabykos!
    One thing, if you will update the program in the future, change the files name because if we use -keep option will there are 3-4 files and maybe its a bit difficult know what is the correct, for example use, hif_finally, hif_correct.... Or implement the split function like HxD and split them in 256.000KB parts...
    Bye and thanks again!
    EDIT: Is "hif_unpack.nfs" the file we have to split? I did it and it gave me 18 parts, when the original game are 14 parts... I also did it manually and it gave me 14 parts....
    Because if i dont use the -keep option it only gives me an incomplete hif_000000.nfs
    NUSPacker don´t work without new rules, but you can use Wii U Installer Packer v5
     
    Last edited by victormr21, Jan 5, 2017
  7. leseratte

    leseratte GBAtemp Regular

    Member
    132
    15
    Jun 2, 2012
    Gambia, The
    Does anyone know if it is possible to convert Wii savegames to WiiU-Wii-VC savegames? Do the VC games store the savegame in the WiiU or in the vWii?

    And does the WiiU game ID or the Wii ticket tmd ID determine which savegame is used?
     
    Last edited by leseratte, Jan 5, 2017
  8. Ryuzaki_MrL

    Ryuzaki_MrL Furry Addict

    Member
    731
    707
    Jun 23, 2015
    Brazil
    It's stored on vWii using the Wii game's title ID. I've transferred my SMG2 savefile from my Wii to the Wii U VC version by using ftpiiu-everywhere.
     
  9. ShadowOne333

    ShadowOne333 GBAtemp Guru

    Member
    6,334
    3,937
    Jan 17, 2013
    Mexico
    One step in the right direction!
    I'm sure this will be of great help for those interested, and we might soon enough have Wii VC injections working, and who knows, even vWii with Gamepad soon too!

    Thanks sabykos!
     
  10. leseratte

    leseratte GBAtemp Regular

    Member
    132
    15
    Jun 2, 2012
    Gambia, The
    Ah, thats great.

    Now, has anyone actually successfully converted a Wii ISO to a VC and installed it?
     
    CatmanFan likes this.
  11. huma_dawii

    huma_dawii GBAtemp Maniac

    Member
    1,177
    400
    Apr 3, 2014
    United States
    Key Largo, Florida
    I need proof of someone injecting Wii VC! xD
     
    CatmanFan likes this.
  12. jesus96

    jesus96 Advanced Member

    Newcomer
    58
    22
    Sep 2, 2015
    Mexico
    Soon™
     
  13. CatmanFan

    CatmanFan TrashTemp Advanced Fan

    Member
    799
    194
    Aug 14, 2016
    Morocco
    Stately West Manor
    Can we convert scrubbed/trimmed ISOs to .nfs with this?
     
  14. Vaamo

    Vaamo Newbie

    Newcomer
    9
    3
    May 23, 2016
    How are you getting the NFS files from the Wii U? It fails when I try to transfer them over FTP using FTPiiU_Everywhere.
     
  15. VinsCool

    VinsCool Non Compos Mentis

    Member
    GBAtemp Patron
    VinsCool is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,392
    26,392
    Jan 7, 2014
    Canada
    Dreams and Thoughts
    Downloaded from one of the multiple nus downloader and decrypted the content with CDcrypt.
     
  16. JohnathanMonkey

    JohnathanMonkey GBAtemp Advanced Fan

    Member
    577
    185
    Apr 26, 2013
    United States
    I keep getting this error message when trying to decrypt SMG2 to ISO.

    Code:
    http://imgur.com/a/A2IiK
    Encrypting causes the same thing. Am I doing something wrong?

    Code:
    http://imgur.com/a/69SGR
     
    Last edited by JohnathanMonkey, Jan 6, 2017
  17. sabykos
    OP

    sabykos GBAtemp Regular

    Member
    226
    371
    Jun 10, 2013
    Gambia, The
    Nope, that looks like a bug. As I said, I hevent tested the program thouroughly. Can you tell me, which game youre trying to decrypt?

    — Posts automatically merged - Please don't double post! —

    This is planned for the future. Thing is, right now ISO2NFS ist pretty useless, since we cant inject the files. If I this changes or I have some free time, I'll try to add it.
     
  18. AboodXD

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,597
    1,333
    Oct 11, 2014
    Not under a rock.
    Someone needs to compare an original ISO with an NFS->ISO.
    They must be different in something, because an NFS->ISO doesn't work on Wii but works on Dolphin...
     
    FlappyFalco likes this.
  19. JohnathanMonkey

    JohnathanMonkey GBAtemp Advanced Fan

    Member
    577
    185
    Apr 26, 2013
    United States
    It's Super Mario Galaxy 2. I tried running it as admin, same error.

    This is exactly what I am trying to do!

    I just bought Metroid Other (US) and tired it, just to have another game, and it doesn't want to work either but I get a different message.
     
    Last edited by JohnathanMonkey, Jan 6, 2017
  20. Ryuzaki_MrL

    Ryuzaki_MrL Furry Addict

    Member
    731
    707
    Jun 23, 2015
    Brazil
    I've dumped my copy of Mario Kart Wii to ISO and tried converting into NFS files, but the output was only a single 92 MB nfs file.
    Here is the console log:
    Warning: Spoilers inside!

    Tried with my own dump and with a downloaded dump.