**************************************
Build, rebuild, clone xbox harddrives.
**************************************

Useful tool both for softmodders and modchip users (who can ignore locking
issues).

Initial version : xboxhdm_v1.0.zip
Current version : xboxhdm_v1.9.zip

As always - use the info and tools described here at your risk. Don't come
whining if something goes wrong...
You should especially be careful when using the HDD locking tools. Write down
and backup any passwords you use.

(Most tools in this package I'm not personaly responsible for, and can
therefore not give any guaranties on their usage. Big thanks to all authors of
code I have borrowed and modified. Special thanks to the xbox-linux project. I
bow in admiration of what you guys have accomplished).

Let me start by...
------------------
Giving some advice to people new to softmodding. Softmodding is not without
risk and some people do get into trouble. Most of these troubles can be
prevented by always ensuring a way to revert the hacks people apply. Basically
as soon as you gain access to you xbox you should backup your xbox HD key and
eeprom. Most people initially gain access using a game-save hack packed with
evox. This app has a backup option that will dump the eeprom to a file as well
as the hdd key in a text file. Others gain access by hotswapping and
installing a hack this way. In that case let evox or ConfigMagic be the very
first app you run and get the backup files. Evox will store the backup files
in the location the evox app was installed in (if used from a game save it
will be somewhere in E:\UDATA). To my knowledge ConfigMagic stores the backup
in the root of the E-drive. Having these files you can always access your xbox
HD from the PC, and now in case of a broken drive you can build an xbox HD
from scratch. So you can pretty much get out of all HD-related toubles. I feel
more safe hacking my xbox knowing this

What this package does.
-----------------------

This package will let you create a bootable CD that can access and
manipulate/rescue, clone and even rebuild working xbox HD's from scratch. I
see this usefull for people who want to :

    * Upgrade their xbox with a larger HD (either by cloning or building from scratch)
    * rescue or rebuild a corrupt xbox HD.
    * Calculate the HD passwd for locked and unlocked HD's
    * Locks and unlocks HDD's with the password automatically calculated from the eeprom.
    * Can also set a Master Password (XBOXSCENE) when locking to allow an
      unlock later even without the eeprom or the user password.
    * Install the official softmod package including the audio and font hack,
    * Evox and PBL 1.4.1.
    * You also have the option to make a patched copy of you MS dashboard to
      be run from Evox when using the font hack. Do not use this package is you 
      do not have a kernel below 5530 and dashboard version 4920.
      This is meant to provide users without memcards or any of the
      exploitable games (MA,SC,007) with an easy to use softmod package.
    * have a stable package to access and delete, move, change files on the xbox HD.

An included program will also let you rebuild the C-drive alone, which could
be very usefull if this has become corrupted, if you are in a clock loop and
dont know how to manually restore the C-drive or if you need to downgrade the
dashboard.
This is all done by letting you boot to a small live-linux with fatx support,
like xlinux, but with so many more tools and options. Better hardware
compatibility due to a updated kernel/syslinux and NTFS support are things to
mention. Also from this CD you can boot to DOS and use HD lock/unlock tools.
The techical details of how this package works are described HERE

Making your bootable CD
-----------------------

This package comes as a zip-archive : xboxhdm_vx.x.zip (get it from the usual
places). When unpacked you find some files and a folder called linux. Inside
linux you find a C and a E folder. In here you can put pretty much what you
want to go on your xbox. If you have a working hacked setup (audio or font
exploit) you can pack that onto the CD, if you want to use this as a rescue
disc it would be more usefull to just put the original xbox system-files (The
files from the C-drive - get them from your own backup or from Slayers Evox)
in the C-folder and optionally you can put the TDATA and UDATA folders with
some game saves (could be some hacked saves) in the E-folder.
A minimal rescue CD would have something like the following in the C-folder of
the linux directory :

   Audio
   fonts
   xboxdash.xbe
   xboxdashdata.1012a700
   xodash

The E-folder can be left empty.

In the root of this archive (xboxhdm-folder) you find a make-iso-win.bat
script. Run this script to produce a bootable iso that you can burn to a CD.
Also included is a make-DOS-floppy.bat script. This will create a DOS floppy
with the unlockx,hdlock,hdunlock tools. This is the best way to run
locking/unlocking tools as log files will be written to floppy on succesful
locking of a drive (see warning below). If you want to make use of the
automatic locking you should make the DOS floppy using the xboxhd tool after
booting the xboxhdm CD (see section on the locking/unlocking tools below).

The Xboxhdm Boot-prompt
-----------------------

When you boot with this CD in the drive you will be presented with three
options :

   _  __ __         _  __    __  ______     __  ___      __            
  | |/ // /_  ____ | |/ /   / / / / __ \   /  |/  /___ _/ /_____  _____
  |   // __ \/ __ \|   /   / /_/ / / / /  / /|_/ / __ `/ //_/ _ \/ ___/
 /   |/ /_/ / /_/ /   |   / __  / /_/ /  / /  / / /_/ / ,< /  __/ /    
/_/|_/_.___/\____/_/|_|  /_/ /_/_____/  /_/  /_/\__,_/_/|_|\___/_/    
                                         __
                        ____ _____  ____/ /
                       / __ `/ __ \/ __  /
                      / /_/ / / / / /_/ /  
                      \__,_/_/ /_/\__,_/  
                                                 __              __
   ________  _________ _   _____  _______  __   / /_____  ____  / /
  / ___/ _ \/ ___/ __ \ | / / _ \/ ___/ / / /  / __/ __ \/ __ \/ /
 / /  /  __/ /__/ /_/ / |/ /  __/ /  / /_/ /  / /_/ /_/ / /_/ / /  
/_/   \___/\___/\____/|___/\___/_/   \__, /   \__/\____/\____/_/  
                                   /____/                        
                                           
      1) Boot VGA console with xbox-drive utilities (default)
      2) Boot text-console with xbox-drive utilities
      3) Boot linux with locking/unlocking utilities
      4) Boot to DOS with HD unlock tools
         (use with caution. Passwd log-files are not saved after reboot)


The first two options will bring you to the fatx-enabled linux (only
difference is the layout). Option three will let you boot to linux with
"automatic" locking/unlocking tools available. FreeDOS and let you use the
unlockx, hdlock, hdunlock, hddisabl tools. Going from DOS to linux or vice
versa you will need to reboot.

The locking/unlocking tools
---------------------------

WARNING! Using the locking utilities from CD the tools cannot store any log
files with used passwords, as the CD is read-only. It will be stored to the
virtual filesystem in RAM but is gone after rebooting. These logs are useful
if you accidentially use an incorrect HD passwd. If using the DOS based
locking tools (unlockx, hdlock) to lock a drive the passwd used will be
written to screen and you will be prompted to write this down. If you run the
locking tool from CDROM I furthermore advise you to insert a formatted floppy
in your primary floppy-drive and run the command : 'savelog'. This will write
the log-files from the locking tools to floppy.

Be warned that locking HDD's is serious buisness! Don't just fool around with
the locking tools and always be sure you backup the passwords you use. Locking
the HDD with an unknown password will make the HDD useless if you dont store
the log or write down the password!

From version 1.7 you can lock and unlock a HDD from both the linux and DOS
prompt.

Linux (option 3 from the xboxhdm boot menu) :

    * unlockhd, will search the xboxhd CD for the eeprom.bin image. If not
      found you have the option to insert a floppy with the eeprom of define
      the path manually. If the eeprom is supplied the tool will unlock and
      disable locking using a password generated directly from the eeprom.
    * lockhd, will search the xboxhd CD for the eeprom.bin image and likewise
      lets you tell the tool where to find the image if it wasn't included on
      the CD. When locking the password is also generated from the eeprom.
      Moreover the Master Password is also set to 'XBOXSCENE' (without the
      quotes). You can use this to unlock the HDD if you loose the eeprom
      password you your eeprom gets lost. Boot the xboxhdm to DOS (option 4)
      and run the atapwd tools to unlock using Master passwords.

DOS (option 4 from the xboxhdm boot menu) :

(The first two tools require that you have bootet xboxhdm to linux (option 1
or 2) and made the DOS floppy from the xboxhd tool.

    * lockhd, will prompt you to choose a drive and will lock the HDD with the
      password written to the floppy by xboxhd
    * unlockhd, will both unlock the HDD and disable locking with the password
      written on the floppy

      Should the password generated by xboxhdm be incorrect (bad eeprom dump, or a
      bug in the password tool <- you can never rule this out completely), you
      should still be able to unlock the drive again with the password stored on the
      floppy in : input/hdpass.txt

    * hdlock, Only locks a HDD
    * hdunlock, Only unlocks a HDD but doesn't disable locking. The drive will
      relock after reboot if you only run this tool.
    * hdddisabl, Disables locking. To be used after hdunlock so that locking
      stays off after rebooting.
    * unlockx, One option locks a drive, another option unlocks and disables
      locking in one go. Warning! This tools has been known to not work well
      with some drives. I recommend hdlock/hdunlock.
    * atapwd. Good for checking the drive security status. Can also be used to
      unlock with the Master password. If you locked your HDD using the linux
      tools the Master Password is 'XBOXSCENE'. If you locked it with
      ConfigMagic the Master password is set to 'TEAMASSEMBLY'


WARNING! The locking tools are not made by me, so dont make me responsible if
something goes wrong. Locking HDD's is not without risk. Until proven
otherwise I think the safest choice is to use the linux locking/unlocking
tools. Even if the eeprom is bad or the password generation algorithm is wrong
the Master Password is set, so you should always be able to unlock using that.

Final tips on locking/unlocking!
Most PC Bioses seems to enable the Freeze Lock command on unlocked drives on
bootup. I guess this is a safety messeaure since you cannot accidently lock or
erase prepare a unit when it's frozen. However when the freeze lock is set you
cannot relock the drive either. This is rare though and can be disabled in
most bioses by disabling automatic hardware detection on bootup on the Primary
channel (where the HDD is). We dont need this for booting a CD anyway.
Remember to reenable automatic detection on primary master after using xboxhdm
if your regular PC HDD is on primary master and is the boot device.

If your Bios doesn't support disabling of the auto detection your can try to
pull out the IDE cable of the HDD before booting the PC (put with the power
cable in the HDD) and put back the IDE cable when you reach the xboxhdm boot
menu.

The xboxhd-tool
--------------
When you boot to linux you will be told that you can start the xboxhd tool by
typing 'xboxhd' and pushing enter. This should give you this screen :
CODE

 __   ___                 _   _______  ___  ___      _            
 \ \ / / |               | | | |  _  \ |  \/  |     | |  
  \ V /| |__   _____  __ | |_| | | | | | .  . | __ _| | _____ _ __
  /   \| |_ \ / _ \ \/ / |  _  | | | | | |\/| |/ _' | |/ / _ \ '__|
 / /^\ \ |_) | (_) >  <  | | | | |/ /  | |  | | (_| |   <  __/ |  
 \/   \/_.__/ \___/_/\_\ \_| |_/___/   \_| |_/\__,_|_|\_\___|_|


            You have the following options :
         1) Build a new Xbox HD from scratch
         2) Rebuild C-partition on existing Xbox-drive
         3) Clone existing Xbox HD
         4) Install F-drive
         5) Wipe current fatx partition table
         6) Generate HD Key (requires eeprom)
         7) Make DOS floppy with HD lock/unlock tools
         8) Quit
             
             Make your choice [1-8] :

As of version 1.6.1 the drive detection mechanism was improved so that you can
run the xboxhd tool even if the drive is locked. You will be told that the
drive is locked and only the options 6) & 7) will be available to the user.
This should let you get the HDD password and generate the DOS floppy boot disk
with the nessecary unlocking tools.

Option 1
Use this option if you want to build an xbox HD from a blank drive. It is
two-step procedure.
First step is where the partition table is written to disk.
Second step is where xboxhd will format all fatx partitions and afterwards
build the C-partition with the files your put in the C-folder on the CDROM and
build the E-partition with the TDATA and UDATA folders you put in the E-folder
on the CDROM. If you left the C- and E-folders empty on the CDROM (by mistake
or on purpose) you will be prompted to insert a CD with the xbox system-files.
The tool will then search for the files.
You can also choose option 1) for rebuilding an existing xbox HD completely.
If the current fatx partition table is valid this will then not be a two-step
procedure.

Option 2
Choose this option if you just want to rebuild the C-partition. This could be
used if some system-files have been corrupted, if you are in a clock loop or
as a way to downgrade your dash. It is equivalent to the second step described
in option 1) above, but only formats and rebuilds the C-partition leaving all
game-saves on E: untouched.

Option 3
lets you clone an existing xbox HD onto another drive. You will be prompted
which device is the source device and which is the destination device.

Option 4
Install an F-drive if you HDD is large enough - this is checked!
Note that when building a HDD from scratch using option 1) the size of the HDD
is automatically checked, and if found large enough the user will be given the
option to build the F-drive at that stage.

Option 5
Use this if a current partition table is corrupted and you want to rebuild the
drive from scratch using option 1)

Option 6
This will let you calculate the HD unlock key. It requires that you have the
eeprom.bin from Evox or ConfigMagic on your CDROM in the eeprom-folder.
Current drive status and HD passwd is printed on screen and to file
(hdkey.txt).
In tests this gave the correct key for my HD put write down and (or) save they
key anyway so that you can always unlock your drive.

Option 7
You will be prompted to insert a floppy and push enter. A DOS floppy with
locking and unlocking tools will be created.

Option 8
Quit the tool and return to the linux prompt.

The xbrowser
Most people dont like typing commands. I included tools to make browsing and
manipulating files on the xbox HD more user-friendly. At the command prompt
type 'xbrowser' and hit enter. This will mount the CDROM with the linux
distribution (and your xbox-files) and if an xbox drive is present on the
primary IDE master channel the xbox C- and E-drives will be mounted. Then a
semi-graphical filemanager (Midnight-Commander) will open with a tabbed
(two-window) view of you CDROM on the left and the xbox C- and E-drive on your
right.

+<-/CD/----------------------------------------v>++<-/xbox-------------------------------------------v>+
|              Name         | Size  | MTime      ||               Name            | Size  |   MTime    |
|/..                        |UP--DIR|            ||/..                            |UP--DIR|            |
| ABOUT_THIS_CD.txt         |   1392|Apr 14 17:48|| C                             |   4096|Apr 14 17:48|
| C                         |   4096|Apr 14 17:30|| E                             |   4096|Apr 14 17:48|
| E                         |   4096|Apr 14 17:30||                               |       |            |
| check                     |      0|Apr 14 17:30||                               |       |            |
| isolinux                  |   4096|Apr 19 02:13||                               |       |            |
| readme.txt                |   6013|Apr 18 21:47||                               |       |            |
| xbox                      |   4096|Apr 14 17:30||                               |       |            |
|                           |       |            ||                               |       |            |
|                           |       |            ||                               |       |            |
|                           |       |            ||                               |       |            |
|                           |       |            ||                               |       |            |
|                           |       |            ||                               |       |            |
|                           |       |            ||                               |       |            |
+------------------------------------------------++----------------------------------------------------+
|/..                                             ||/..                            |       |            |
+------------------------------------------------++----------------------------------------------------+
GNU Midnight Commander 4.6.0
$
1Help   2Menu   3View   4Edit   5Copy   6RenMov   7Mkdir   8Delete   9PullDn   10Quit


Some hint on using this tool :
- Current dir is in the top of each windows.
- Switch the curser between left and right windows with TAB
- Move the curser with the arrow-keys.
- Placing the curser on the very top dir (../) and hitting enter will go on
  directory up.
- File/dir manipulation-commands are issue with the F-keys according to the
  list of commands in the bottom of the windows.

Example : To rename Xbox.xtf to Xbox.bak in the font-dir on the xbox-drive
hit:
- TAB to switch to the right window.
- down-arrow + enter to go to C-directory.
- twice down-arrow and enter to go to fonts folder
- twice down-arrow to go to Xbox.xtf
- F6 to bring up Move/rename box.
- Write Xbox.bak and hit enter to perform rename.
Simple!

The Softpack
------------
Available 'the usual places' is the official softmod package for xboxhdm. This
includes the dashboard exploits and PBL and therefore require a kernel version
below 5530 and the MS dashboard version 4920. When including this package on
the xboxhdm CD the user can run the 'softmod' command and will be given the
options to install :

   1) The NO-CD new stable audio hack.
   2) The Mech-fonts
     The "Xbox Live" tab will be renamed to PBL
     and will load the Phoenix Bios Loader when pressed.
   3) Phoenix Bios Loader v 1.4.1 with support for Focus chip.
     Only bios included is the 4981.67_ef bios. Include
     more bioses (E:\pbl\Bioses) if you need.
   4) Evox v. 3935.
     Ip              = 192.168.0.3
     Subnetmask      = 255.255.255.0
     Defaultgateway  = 192.168.0.1
   5) Automatically make a patched copy of the MS dashboard (xtf -> bak)
     in C:\ called msdash.xbe to be run from Evox when using
     the font hack. It has been tested only on the 4920
     dashboard from Slayers Evox, but should work on all 4920
     dashboards.

   Read more about the softmod package here

The UDE package
---------------

A softmod package like the one above.
Installs the save Evox and PBL version as the softpack mentioned above, but
uses the "Ultimate Dashboard Exploit". The advantages over the softpack is
that this exploit has NO chance of clock-loops and it boots PBL directly when
the xbox is turned on. The 'UDE' command provides install and uninstall
options.
Since no M$ copyrighted code is included in this package the user has to
supply the needed update.xbe (the exploitable M$ executable) themselves. The
tool will check that it is the correct version, which should hopefully
iliminate the chance of people getting a corrupted install.
Read more about this package here

Final comments and tips
-----------------------

Being a fatx enabled linux you can use this distro to manipulate xbox-drive
content in any way you wish using linux commands :

   ls (to list files and dirs in current working directory)
   ls -l (for extended listing)
   cd dir (for navigating to directory dir)
   cp source dist (to copy file sorce to file dist)
   cp -r source dist (to recursively copy directory source to directory dist)
   mv source dist (to move source to dist)
   rm file (to remove file)
   rm -r dir (to recursively remove directory)
   mkdir dir (to create directory dir)
   mount -t filesys /dev/X dir (to mount device X with filesystem filesys
   (fatx,ntfs,iso9660) on dir)
   umount dir (to unmount device mounted on dir)


TIP : Use this filemanager (xbrowser) to install softmods. Before you burn the
bootable linux CD you could add a folder (hacks) to the linux directory with
all the files needed for the hack (Bert, Ernie, ST.DB, PBL,....). Then use
xbrowser to copy files to the xbox HD.

TIP : Hotswapping with this linux distro is easy. I recommend the following.
Place your xbox so that the PC's primary master ide cable will reach the xbox
HD. Pull the DVD IDE cable and boot the xbox. It will stop with error 12. At
this point the xbox HD is unlocked and will stay this way. Put you xboxhdm
bootable CD in the PC and boot. At the boot-prompt it will stop for 5 mins.
The bios has done its hardware detection without the xbox HD attached yet -
linux still hasn't. So at this boot prompt you pull the ide-cable on the xbox
HD, and plug in the primary master ide cable of the PC. Then hit enter to boot
to linux. After booting, execute 'xbrowser' to see if the drive was found.

For more info read the HOWTO's and ReadMe's include in the package.

------------------------------------------------------------------------------

Thanx to all testers for usefull feedback and ideas.

Happy hacking - hope you dont have to use this tool too often 
