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

sabykos

Well-Known Member
OP
Member
Joined
Jun 10, 2013
Messages
283
Trophies
1
Age
36
XP
729
Country
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,

jose1209

Well-Known Member
Member
Joined
Jul 2, 2007
Messages
117
Trophies
1
XP
708
Country
Burkina Faso
thanks !

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.


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 ?
 

sabykos

Well-Known Member
OP
Member
Joined
Jun 10, 2013
Messages
283
Trophies
1
Age
36
XP
729
Country
Gambia, The
If this is used to repack an iso to nfs files, will it install properly?
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.

Edit: I initially had an error but trying again produced a working iso file from SMG2

Was it an error, because you made somthing wrong, or was it a bug. If its the latter, please provide more information.
 
  • Like
Reactions: zeldaism

victormr21

Well-Known Member
Member
Joined
Dec 29, 2015
Messages
565
Trophies
0
XP
498
Country
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,

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,872
Country
Germany
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,

Ryuzaki_MrL

Green Thunder
Member
Joined
Jun 23, 2015
Messages
781
Trophies
0
Age
26
XP
2,051
Country
Brazil
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?

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.
 

Vaamo

Member
Newcomer
Joined
May 23, 2016
Messages
15
Trophies
0
Age
34
XP
262
Country
How are you getting the NFS files from the Wii U? It fails when I try to transfer them over FTP using FTPiiU_Everywhere.
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,623
Trophies
5
Location
Another World
Website
www.gbatemp.net
XP
25,478
Country
Canada
How are you getting the NFS files from the Wii U? It fails when I try to transfer them over FTP using FTPiiU_Everywhere.
Downloaded from one of the multiple nus downloader and decrypted the content with CDcrypt.
 

JohnathanMonkey

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
633
Trophies
1
Age
37
XP
754
Country
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,

sabykos

Well-Known Member
OP
Member
Joined
Jun 10, 2013
Messages
283
Trophies
1
Age
36
XP
729
Country
Gambia, The
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
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?

--------------------- MERGED ---------------------------

Can we convert scrubbed/trimmed ISOs to .nfs with this?
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.
 

JohnathanMonkey

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
633
Trophies
1
Age
37
XP
754
Country
United States
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?

It's Super Mario Galaxy 2. I tried running it as admin, same error.

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...

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,

Ryuzaki_MrL

Green Thunder
Member
Joined
Jun 23, 2015
Messages
781
Trophies
0
Age
26
XP
2,051
Country
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:
+++++ ISO2NFS +++++

Searching for AES key file...
AES key file found!
Wii common key not found in source code. Looking for file...
Wii Common Key file found!

Read partition table...

Number of 1. partitions: 3
Partition info table offset: 0x40020
Number of 2. partitions: 0
Partition info table offset: 0x0
Number of 3. partitions: 0
Partition info table offset: 0x0
Number of 4. partitions: 0
Partition info table offset: 0x0

Data partition at offset: 0xf800000

Partition size: 0x105da8000
Write game partition 0...
256 MB processed...
512 MB processed...
768 MB processed...
1024 MB processed...
1280 MB processed...
1536 MB processed...
1792 MB processed...
2048 MB processed...
2304 MB processed...
2560 MB processed...
2816 MB processed...
3072 MB processed...
3328 MB processed...
3584 MB processed...
3840 MB processed...
4096 MB processed...

Generating EGGS header...
Packing nfs...
Packing 3 parts...
Delete zero segment 0 of size 0x0
Writing data segment 0 of size 0x8000
Delete zero segment 1 of size 0x38000
Writing data segment 1 of size 0x10000
Delete zero segment 2 of size 0xf7b0000
Writing data segment 2 of size 0x5dc8000

Writing EGGS header...
Encrypting hif.nfs...


Building hif_000000.nfs...

Tried with my own dump and with a downloaded dump.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: I agree.