Page 1 of 1

Invalid or Corrupt File, possible DiskHeader size bug

Posted: Mon Jan 06, 2014 11:29 pm
by boozezela
I have a number verified .ISOs that are problematic with Swiss R94 and higher (e.g. R94, 174,189, 253).
They all give "Invalid or Corrupt File" when I try to run them.

For example:

Baten Kaitos Origins (Disc 1)
DL-DOL-GK4E-0-USA

CRC-32: ADF9FCB3
MD5: 67A443E8E6C8E50DE87F45433EBFBDDC
SHA-1: B5E6AAFAE4AA171CAA558875CA7D66B465A78F7F

======================================================

Soul Calibur II
DL-DOL-GRSE-USA

CRC32: 89779810
MD5: 0C8EC93F3F4F4E00D5A46443225C169C
SHA-1: 49F281FBE7086A4EB400A03C869FCAC5F90DF55A

Given the fact that I have the same error on SD card of different sizes, regardless if I reformat them or not, and that the same games magically work as soon as I modify the ISO (shrink, 32k align, or shrink+align), could it be a bug related to the disk header's size check?

Code: Select all

// boot the GCM/ISO file, gamecube disc or multigame selected entry
        deviceHandler_seekFile(&curFile,0,DEVICE_HANDLER_SEEK_SET);
        if(deviceHandler_readFile(&curFile,&GCMDisk,sizeof(DiskHeader)) != sizeof(DiskHeader)) {
                DrawFrameStart();
                DrawMessageBox(D_WARN, "Invalid or Corrupt File!");
                DrawFrameFinish();
                sleep(2);
                return;
        }
Edit:
Trying to copy one of the problematic .ISOs I get a "Failed to Read! (32768 -1)" error.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Mon Jan 06, 2014 11:59 pm
by emu_kidid
Where are you reading these from, WKF or SD Gecko?

Invalid or Corrupt file means that I tried to read the disk header, but the read didn't come back complete.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Tue Jan 07, 2014 12:03 am
by boozezela
I understand that, the point is that I am using clean rips, so it should not happen.
I am reading them using SD Gecko.

Edit:
I have tried to reformat a 4GB card using quick format, slow format and I have even used a specific format tool.
I have also deleted and re-created the partition on the card with a different offset, to achieve 4k alignment.

Unfortunately the above did not make any difference and I still get "Invalid or corrupt file" on the same ISOs.

Do you have a tool to check if the ISOs on the SD card are properly aligned (if this is the problem) or a tool to repartion/format a card directly on the GC in a way that may appeal Swiss better?

Unfortunately I cannot access logs/debug via USB, so I don;t know what to do besides shrinking the images.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Tue Jan 07, 2014 4:52 am
by emu_kidid
If they're clean rips, then you're getting read errors from the SD card. Are you using the SDML adapter by any chance?

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Tue Jan 07, 2014 5:13 am
by boozezela
emu_kidid wrote:If they're clean rips, then you're getting read errors from the SD card. Are you using the SDML adapter by any chance?
I am using a WiiKey SD card adaptor with a 4GB Sandisk (class 4) and a 32GB Sandisk Ultra (class 10). Both cards works fine on the PC and I have tested them using h2testw to ensure that the all the data written to the card gets read back exactly the same.

Thinking that the problem was caused by accessing data from a specific position, I have also tried to shuffle the content of the card by copying the ISOs in different order but it doesn't make any difference: all the problematic images stays problematic, everything else works just fine (including emulators) regardless of the position.

I have also formatted the cards using different cluster sizes, and different readers, still nothing.

While writing this I have also tried to use the Soul Calibur II ISO with a third card (another Sandisk 32GB class 10), still nothing. Again as soon as I alter a problematic image it works.

Edit:
For the sake of completeness, I have checked the connections between the SD slot and the memcard pins inside the SD card adaptor using a multimeter and they are all properly connected.

Would you like me to upload the offending image somewhere just in case?

Edit 2:
Since I am stubborn, I have checked the prolematic ISOs with a bunch of ISO tools and with SD-Boot.

- GC-Tool 1.2 cannot open ANY of the problematic ISOs (other tools can), but it can open the ones that Swiss can deal with
- SD-Boot 0.4 can access ALL these problematic ISOs:

Battalion Wars: Information are shown correctly but the banner is garbled (the game doesn't boot from the clean image, only from the shrunk one)
Soul Calibur II: Information are shown correctly but the banner is garbled (game doesn't boot, clean or shrunk)

And SURPRISE, SURPRISE...
Baten Kaitos Origin - Disc1: Information are shown correctly including the banner. The game boots as well (again this very same ISO is identified as corrupted by Swiss). It also gets correctly recognised as Disc 1.

So I believe these ISOs are slightly different from the others and Swiss simply cannot deal with them.

Edit 3:
I have resurrected the (for me) ancient Swiss 0.1-r62.

It considers the above ISOs corruptet/invalid as well, however I can see a modicum of info and no banners for the three of them.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sat Jan 18, 2014 12:51 am
by boozezela
Any thoughts on "Edit 2" (SD-boot) ?

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 1:58 am
by emu_kidid
It's possible that CleanRip is creating corrupt files, have you tried putting a known verified ISO from the PC to a cleanly formatted (non 64kb cluster) SD card? Once it's on the card, re-verify the ISO and then lastly try it in swiss.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 3:12 am
by boozezela
Hi,

I have just checked for data consistency using both Sould Calibur II NTSC/US and Baten Kaitos Origin Disc 1 NTSC/US.

The CRC32, MD5 and SHA1 values calculated from a cleanly formatted SD card (after rebooting the PC to avoid reading the same data from RAM) are the same as the ISOs saved on the hard drive.

The MD5s (0C8EC93F3F4F4E00D5A46443225C169C and 67A443E8E6C8E50DE87F45433EBFBDDC) are the same ones you can find on redump.org and GameTDB.

Not strictly related, however I can see the banners (SC2 banner was garbled using SD-BOOT) and boot the games fine using Dolphin.

EDIT:
This thing is driving me crazy...
- I have downloaded SC2 from a website I am not going to mention.
- The iso has the same frigging hashes as the other one and it works on the same SD card with the same Swiss release.
- I have also saved the "bad" iso and the "good" iso twice with different names (good1.iso, good2.iso, bad1.iso, bad2.iso).
- They still have the same damn checksums and yet the bad ones show up as corrupt.

I am going to to a binary diff on the damn files next.

EDIT2:
A binary diff does not show anything different (as expected). However GC Tool 1.2 refuses to open the "bad" iso and opens no problem the "good" one.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 7:15 am
by megalomaniac
soul calibur boots with no errors
tested swiss r253 from SD Gecko and WASP fusion slot
viewtopic.php?p=22192#p22192

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 7:50 am
by boozezela
I am going to scream and swear. Loudly.
Maybe involving God, the Holy Mary and a couple of assorted Saints.

GCM-Tool cannot open read only files.
Neither can Swiss apparently.

ALL the "bad" ISOs were marked "read only" in the FS.
The attribute propagated on all the SD Cards I have used.

Once I removed it Swiss started to happily run ALL of them.

#$%£@#!!!

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 8:18 am
by emu_kidid
very interesting, glad you sorted it.

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 8:11 pm
by boozezela
Yeah, I am glad too... :)

Re: Invalid or Corrupt File, possible DiskHeader size bug

Posted: Sun Jan 19, 2014 11:15 pm
by BenoitRen
Possible left-over check from the time when Swiss patched ISOs? Because now it patches memory instead. Right?