# Building extract-xiso - Quick Start ## What is extract-xiso? **extract-xiso** is a tool for working with Xbox (original Xbox) ISO images. It can: - Create XISO files from game directories - Extract XISO files to directories - Rewrite ISOs for compatibility **Why needed:** Xbox games need special XISO format, different from standard ISOs! --- ## Quick Build ```bash cd /data/emu/rom-farmer/tools/extract-xiso # Step 1: Download source (first time only) ./clone.sh # Step 2: Build extract-xiso ./build.sh # Step 3: Use it! ../bin/extract-xiso -h ``` Build time: ~5-10 seconds (very fast!) --- ## What clone.sh Does 1. **Clones extract-xiso repository** from https://github.com/XboxDev/extract-xiso - Small repo, no shallow clone needed - Shows available release tags 2. **Records version info** in `VERSION.txt` - Git commit hash - Release tag (if on a release) - Build date --- ## What build.sh Does 1. **Checks dependencies** - Verifies gcc/clang compiler - Checks for make 2. **Builds extract-xiso** (simple Makefile) - Very fast build (seconds) - No special options needed 3. **Installs binary** - Copies to `tools/extract-xiso/build/extract-xiso` - Creates symlink in `tools/bin/extract-xiso` - Records build info in `BUILD_INFO.txt` --- ## Usage Examples ### Create XISO from extracted game directory ```bash # Game directory contains: default.xbe, *.xpr files, etc. extract-xiso -c /path/to/game_directory -o game.iso ``` ### Extract XISO to directory ```bash # Extract to current directory extract-xiso game.iso # Extract to specific directory extract-xiso game.iso -d output_directory ``` ### Rewrite ISO for compatibility ```bash # Fix ISO issues extract-xiso -r game.iso ``` ### List contents without extracting ```bash extract-xiso -l game.iso ``` --- ## Integration with rom-farmer The transformation recorder will detect and record your extract-xiso version: ```python # Automatically recorded in database transformation = ROMTransformation( source_file="Halo (USA).iso", source_md5="ORIGINAL_ISO_HASH", final_file="Halo (USA).xiso", final_md5="XISO_HASH", # Different from original! tool="extract-xiso", tool_version="2.7.1 (abc123)", # Detected automatically tool_path="/data/emu/rom-farmer/tools/bin/extract-xiso", # ... ) ``` --- ## Why Different Versions Matter ### XISO Format Changes Different extract-xiso versions can create slightly different XISOs: - Padding differences - Metadata handling - File ordering optimizations **Result:** Same input ISO → Different output XISO hashes! ### Solution Track the version used: 1. **For scraping:** Use multi-tier strategy (XISO → ISO → filename) 2. **For consistency:** Stick with one version for all your conversions 3. **For sharing:** Document which version you used --- ## Xbox ROM Processing Workflow ### Phase 1: Import Xbox ISOs ```bash # Your collection (standard ISOs) ls xbox/ Halo.iso Halo 2.iso ... ``` ### Phase 2: Convert to XISO ```python # With transformation tracking from romfarmer.metadata import TransformationRecorder recorder = TransformationRecorder(db_session) with recorder.record_transformation( source_file="Halo.iso", system="xbox", tool="extract-xiso", version="2.7.1" ) as transform: # Create XISO run_command(["extract-xiso", "-r", "Halo.iso", "-o", "Halo.xiso"]) transform.set_final_file("Halo.xiso") # Database now has: # source_md5: ORIGINAL_ISO_HASH # final_md5: XISO_HASH ``` ### Phase 3: Scrape Metadata ```python # Look up transformation transformation = recorder.find_source_hash(xiso_file) # Get original ISO hash iso_md5 = transformation.source_md5 # Query ScreenScraper with original ISO hash game = screenscraper.search_game( system_id=XBOX_SYSTEM_ID, md5=iso_md5 # Use original ISO hash, not XISO! ) ``` --- ## ScreenScraper Strategy for Xbox **Problem:** ScreenScraper may not know your XISO hash **Solution:** Use original ISO hash via transformation tracking ``` Your XISO → Transformation DB → Original ISO hash → ScreenScraper → Metadata ✅ ``` This is why transformation tracking is essential! --- ## Dependencies ### Ubuntu/Debian ```bash sudo apt-get install build-essential ``` ### Fedora/RHEL ```bash sudo dnf install gcc make ``` ### macOS ```bash xcode-select --install ``` --- ## Troubleshooting ### "gcc: command not found" ```bash sudo apt-get install build-essential ``` ### "make: command not found" ```bash sudo apt-get install make ``` ### Build succeeds but binary doesn't work ```bash # Check file type file tools/extract-xiso/build/extract-xiso # Should show: ELF 64-bit LSB executable ``` ### "Permission denied" when running ```bash chmod +x tools/bin/extract-xiso ``` --- ## See Also - `tools/README.md` - Overview of tools management - `tools/mame/README.md` - chdman build guide (similar process) - `docs/MULTI_TIER_STRATEGY.md` - Why transformation tracking matters - https://github.com/XboxDev/extract-xiso - Upstream project --- ## Fun Fact The XISO format was reverse-engineered from the original Xbox file system. Unlike regular ISOs which use ISO 9660 or UDF, XISOs use a custom Microsoft file system optimized for the Xbox's DVD drive. This is why you need special tools like extract-xiso! The format includes: - Custom partition tables - Modified directory structures - Security sector optimizations - Executable signatures (default.xbe) That's why a "regular" ISO of an Xbox game won't work - it needs to be in XISO format!