###############################################
#
#                        .__        ________    _______________   
#  __ __ ___  __________ |__|______ \_____  \  /  _____/\   _  \  
# |  |  \\  \/  /\_  __ \|  |\____ \  _(__  < /   __  \ /  /_\  \ 
# |  |  / >    <  |  | \/|  ||  |_> >/       \\  |__\  \\  \_/   \
# |____/ /__/\_ \ |__|   |__||   __//______  / \_____  / \_____  /
#             \/            |__|          \/        \/        \/ 
#
# uxrip360 - Linux Based  XBOX360 game dumper 0.2a
#			klewan - 2008
#
#   REMEMBER IT IS ALPHA!!!
#   after you got a 'final.iso' use Schtrom3.4/XBC/Mulleter whatever, to verify your files (Wine or Virtual BOX)
#			best at this time is to use XDVDMulleter in virtualbox-osd and do a full CRC check against the online DB
#
#   we WARNED you :)
#
################################################
# if you have modified something -> meet us @uxrip360 EFNET
################################################
#
#
#
# Verified to Work on following Drives
# 				Samsung SH162C
#                               Samsung-H943A (seems to work look @youtube :)
#                               Benq-VAD6038 (not verified)
#                               Samsung D163B  
#                               Samsung D162D  
#
# Drives wich are supported but not yet verified:
#				Benq-VAD6038 (not verified, if you have one please contact me)
#

Changes from 0.1 to 0.2:
------------------------
	+ tested on an exploitable kernel xbox using a H934A drive (thx zouzzz)
		+ http://fr.youtube.com/watch?v=zzTxfes5fDo
		+ also verify that H934A drive work's :)
	+ read errors from disc will get retried, and after 10 fail's you have the choice
	+ detects now max blocks per IO automaticly (again a fix for another USB enclosure)
	+ now most USB encluseres should work, as my cheap and my expensive one work now ;)
	+ splitVid Conversion (-a convert-splitvid)	
	+ extract/inject stealth files from/to an iso
		+ DMI
		+ PFI
		+ SS
	+ ETA and MB/s are displayed on all progressbar's
	+ -a test display's a few parts of Kreon's Feature  List (if kreon drive)
	+ major code housekeeping, split up clean up etc......
	+ auto discover drive if "-D" is not specified (requires libHAL, on ubuntu atleast its standard)
		+ initial by klewan
		+ more asskicking version by f0rk
	+ verify function:
		+ gives you CRC of following components:
				* SS-CRC
				* SS-RAW-CRC
				* PFI-CRC
				* Video/L0/L1 - CRC
				* DMI-CRC
				* GAME-CRC
				* XEX-Hash
				* Region-Flags
				* XEXMediaID
				* checks if image is splitvid
					* if splitvid verif's CRC of L1 part is same as expected part of L0
					* if not present displays fat warning that only IX14 should be used
				* Checks if DMI matches SS
				* Checks if MediaID matches DMI
				* Checks PFI start LBA is correct
				* Checks if XBOX (string) is in DMI
	+ progressbar from hell (tm)
	+ f0rk all-around cleanup 1001 patches ;)
	+ PFI decode by f0rk based on redline + wolfieNUKE code on Xboxhacker	
	+ f0rk tried hard to explain me the difference between "long" and "long long"
			- atleast mine is the largest ;)
	+ alot a code cleanup and small patches by "f0rk"


INSTALLATION:
-------------------
unpack the tar.bz2 you got:
			tar xjvf uxrip360.tar.bz2
			make
			sudo make install

after that put in a XBOX360-dvd:
	to test drive:
		sudo uxrip360 -a test 

	and run following:
		#--------- non split vid image:
		sudo uxrip360 -a rip -o /path/where/files/should/be/stored
		#--------- rip with splitvid:
		sudo uxrip360 -a rip -o /path/where/files/should/be/stored -s
		
	if you want to convert an existing image to SplitVid format:
		sudo uxrip360 -a convert-splitvid -o /path/where/files/should/be/stored/final.iso

	if your drive is not getting detected automaticly (should work in most cases)
	use the "-D" flag to specify your dvd-rom e.g.: -D /dev/dvd

NOTES:
--------------------
	* ESPECIALLY INJECTION SHOULD BE HANDLED WITH CARE!!!! (there is no backup made at all)
	  DO YOURSELF A FAVOUR AND BACKUP BEFORE INJECTING ANYTHING

	* To Burn a ISO:
		growisofs -use-the-force-luke=dao -use-the-force-luke=break:1913760 -dvd-compat -speed=2 -Z /dev/dvdrw=image.iso


	* Sometimes on my SH162-C it looks like if i start "-a rip"
	  and cancle during the game.iso extraction and after that i do again a "-a rip" the video isn't read out ok, either the OS doesn't report any 
	  error it seems that this has something to do with kreon FW or any hardware issue with my hardware
	  in this case a rerun of "-a rip" work's for me, seems to reset the drive or so.

	* TO verify a ISO:
		uxrip360 -o /path/to/iso.iso -a verify

	* TO RIP A RIP: Insert original :-)
	  or do a:
		uxrip360 -D /dev/srX -o /where/to/store -a rip-a-rip