Nanook / NKitv1

MIT License
91 stars 22 forks source link

I can't figure out why ConvertToISO is not working (recovery data present) #13

Closed Tobiaqs closed 3 years ago

Tobiaqs commented 3 years ago

I'm using NKit on Linux (Pop_OS) using latest Mono version (6.8.0.105) and libmono-system-xml-linq4.0-cil installed alongside it.

I have the file B56C9C8AFEC8C60A2E7828A0C6B2D45C69E7D76A_N_940B57BB present in the folder %exe\Recovery\Redump\Wii

The file NKit.dll.config is untouched, so it definitely contains the <add key="RecoveryFilesPath" value="%exe\Recovery\Redump\Wii"/> within the <wii></wii> section (albeit with Windows slashes).

When I try to convert an nkit.iso in this case the USA version of Mario Kart, ConvertToISO.exe gives me the following error:

$ mono ConvertToISO.exe ~/wii/MarioKartUSA.nkit.iso
ConvertToISO v1.4, NKit.dll v1.4 :: Nanook

Processing command line and scanning files...
Found 1 file

DAT ENTRIES
-------------------------------------------------------------------------------
[3624 redump ] Redump.dat
[   0 custom ] Custom.dat
[9496 gametdb] wiitdb.txt

#####[ 1 / 1 ]#################################################################

FILES
-------------------------------------------------------------------------------
Input: /home/me/wii
  MarioKartUSA.nkit.iso

Temp:  /home/me/software/NKit/Processed
SmLog: /home/me/software/NKit/Processed/NKitSummary.txt

PROCESSING
-------------------------------------------------------------------------------
MarioKartWii [RMCE]  Wii  [MiB:2587.6]

3 Passes: [NKit.ISO] >> [1:To ISO] >> [2:Calc Hashes] >> [3:Full Verify]

To ISO:         .1.2.3.4.5.6.7.8.9.

    |DETAIL
    |...............................
    |!! Update partition *_940B57BB missing - Adding filler. It may be Recoverable
    |Fst parsing error - Converting as bad image
    |...............................

Deleting Output
Summary Log Written as Errored!

Failed
-------
Failed processing NkitReaderWii -> IsoWriter
Partition read did not write the full amount to the circular buffer before completing

I feel like I've tried everything, even building the DotNet Core 3.1 fork of this project myself, but to no avail (same issue there). Any help is welcome!

EDIT: I just read through some other issues and found this one particularly interesting: https://github.com/Nanook/NKit/issues/5#issuecomment-630234181 They are having the same underlying issue on Linux.

Tobiaqs commented 3 years ago

Found the culprit:

https://github.com/Nanook/NKit/blob/master/NKit/Settings/RecoveryData.cs#L99 assumes windows slashes.

Changing the pattern to

@"[/|\\]([A-Z0-9]{40})_([A-Z]+)_" + crc.ToString("X8") + "$"

accounts for both types of slashes.

Will do a PR