XboxDev / extract-xiso

Xbox ISO Creation/Extraction utility. Imported from SourceForge.
http://sourceforge.net/projects/extract-xiso/
Other
690 stars 87 forks source link

Seems like it fails to recognize XISOs from Dual Layer DVDs #32

Closed Newk77 closed 5 years ago

Newk77 commented 5 years ago

like the title implies When i try to read .iso files that are bigger then a normal DVD the program gives an error: "... does not appear to be a valid xbox iso image"

GXTX commented 5 years ago

This is a known issue which appears never got reported. Thanks.

Newk77 commented 5 years ago

Thank you for acknowledging this! Would be GREAT if a cross-platform program like this one would support it. I had to leave my Linux environment to use XDVDMulleter Beta 10 on Windows7 in order to extract these ISOs. (maybe the source of that floats around to give pointers how to deal with Dual Layers)

JayFoxRox commented 5 years ago

I'm going to close this issue as a misnomer and mark it as invalid. - That does not mean that I don't agree with this being a problem, it just means that the issue is not suitable for tracking the problem (title and descripion are making incorrect assumptions).

I assume you used a redump-style image (~7.5GiB). That is indeed a dual-layer image, but it's not the reason why extract-xiso will fail.

Every Xbox game disc is not only dual-layer, but also multi-partition (for a lack of a better term). What this means, is that each game will have 2 partitions:

  1. Video partition (standard Video DVD filesystem, which a DVD player can read)
  2. Game partition (Xbox game disc filesystem also known as GDF; an alias is XDVDFS; the homebrew community calls this XISO)

These partitions are entirely independent of the dual-layer characteristic. If you linearily read the disc, you'll see the video data, followed by the game data.

Also see https://web.archive.org/web/20150616131202/http://dark.ellende.eu/public/360DVDfirmwareRelatedInfo.pdf

If you put an Xbox game disc into a DVD player, that player will see the video partition (which is at actual offset 0) which tells you that's it not a game disc.

If you put the Xbox game disc into an Xbox, the security data is verified and the DVD drive (which is specifically designed to handle these discs) adds an offset to all addresses, so it sees the Game partition (which it considers to be offset 0 after the address-offset).

So if you naively dump an Xbox game disc on an original Xbox, you will only get the game partition. So some dumping software dumped only the game partition and called it XISO. Fortunately, others then noticed the video partition and added that to disc images (unfortunately, they also sometimes dubbed this XISO).

Redump images are full (somewhat linear) dumps of the disc, which contain both partitions. If you try to use such a file in extract-xiso, it sees the video partition, and doesn't know how to handle it.

This is expected, as you aren't giving it an XISO.

The correct solution is to split your image into 2 partitions, by removing the first 0x30600 x 2048 bytes (0x18300000 bytes = 387MiB) - I actually don't remember where the 0x600 come from; I also don't remember what partition they belong to. You still want to keep those video partition bytes as they are part of the disc, and some software (such as XQEMU) will potentially require them in the future. However, for extract-xiso these bytes aren't relevant / it can't deal with them.

Here's an example (using unix tools) for extracting the game-data with redump:

dd if=game.iso of=game_data.iso skip=387k bs=1k
extract-xiso -x game_data.iso

(Note that you should already be able to use the game_data.iso in XQEMU)

You can also look at the video partition like this:

dd if=game.iso of=game_video.iso count=387k bs=1k
mkdir /tmp/video
mount game_video.iso /tmp/video

(Note that I was unable to test any of these commands, because I don't have a full game image readily available. However, I believe these commands should still work)

This offset situation is also made worse, because you can manually mount XISOs using the Xbox kernel, even if they are not part of a disc. So you might want to extract an XISO which doesn't have a video-partition before it. So always skipping that amount is bad / not an option.

Other software deals with these partitions by searching for the magic value of the XISO. However, this approach is error-prone as it might find incorrect data. It also couldn't handle with XISO embedded into other files.

I assume we'll add an -o[ffset] option to deal with this, and mention 0x18300000 in the -h[elp] text. I'll remind that this shouldn't even be necessary, as it has nothing to do with XISO (it also goes against unix philosophy). I'll create a new issue about this anyway.

Personally, I'd just split my discs into video and game partition, which also helps for preservation, because the video partition will be the same content on most discs. By explicitly splitting it, you can replace individual files with hardlinks. You can push this further by removing random streams. If you need the full dump, you could always use a fuse filesystem to recombine them for you, at virtually no cost (lossless + fast).

Also note that there are also more severe issues with extract-xiso which make this rather pointless (see https://github.com/XboxDev/extract-xiso/issues/12#issuecomment-528020367). I'd avoid extract-xiso unless you want to create a new ISO (as is the use-case in nxdk) or unless someone tells you why to use it (I might be missing something here).

Closed.