-
Thanks to Cygwin, I've managed to compile xboxdumper under Windows OS. xboxdumper and the companion mkfs.fatx are the key components in xboxhdm that does the actual work of marking a new hdd with the magic value that identifies it as a xbox hdd and creating the FATX partitions.
Note that this doesn't solve the hdd locking after you have created the partitions. You probably need a combination of MHDD and some other means of booting (ISO,USB) and LiveInfo Beta 3 for that - to lock the replacement hdd with the correct password calculated from the eeprom. Or if you have been working with the original hdd, hotswapping is still needed.
Instructions:
1. Download xboxdumper.exe , mkfs.fatx.exe and cygwin1.dll from xboxhdm2.1 soureforge site to the same folder.
2. Start a Command Prompt in Windows in that folder. You are likely to need adminstrator rights since you will be doing physical disk access later.
3. CODE
xboxdumper prepare \\.\PhysicalDrive1
where PhysicalDrive1 represents the second hard drive attached to your PC under Windows - the replacement xbox hdd. You should verify under Disk Management if you are working on the correct hdd. Execution will try a while depending on the size of the hdd.
Output will look something like this, ignore references to xboxhdd
CODE
Written -> BRFR
Creating -> part50 start 2884108288 size 5120024576
createPartition : Filename : xboxhdd
createPartition : clusters 312501
createPartition : start 2884108288
createPartition : size 5120024576
createPartition : chainMapSize 4
createPartition : chainTableSize 1253376
Creating -> part51 start 2359820288 size 524288000
createPartition : Filename : xboxhdd
createPartition : clusters 32000
createPartition : start 2359820288
createPartition : size 524288000
createPartition : chainMapSize 2
createPartition : chainTableSize 65536
Creating -> part52 start 524288 size 786432000
createPartition : Filename : xboxhdd
createPartition : clusters 48000
createPartition : start 524288
createPartition : size 786432000
createPartition : chainMapSize 2
createPartition : chainTableSize 98304
Creating -> part53 start 786956288 size 786432000
createPartition : Filename : xboxhdd
createPartition : clusters 48000
createPartition : start 786956288
createPartition : size 786432000
createPartition : chainMapSize 2
createPartition : chainTableSize 98304
Creating -> part54 start 1573388288 size 786432000
createPartition : Filename : xboxhdd
createPartition : clusters 48000
createPartition : start 1573388288
createPartition : size 786432000
createPartition : chainMapSize 2
createPartition : chainTableSize 98304
Calling ioctl() to re-read partition table.
Have not tested the hdd in the xbox yet. This is WIP.
-
xplorer360 beta 6 is required to insert files/folders onto the hdd prepared by xboxdumper.
I've verified with a hex editor the binary output from xboxhdm against xboxdumper's and only the FATX Volume IDs of the 5 FATX partitions differ so this is definitely viable. subfdisk uses a random value for the volume ID anyway.
-
Appropriate for the scenario where a chipped or tsop flashed xbox does not have a working dvd drive and needs to replace the hdd.
-
Hacked together hdtool (used in xboxhdm and from xbox linux) for the hdd locking stuff and Christian Franke's hdparm for win32 and Linux's kernel source.
For the IOCTL_IDE_PASS_THROUGH support in Windows OS. Commented out the i2c stuff which is intended for reading the eeprom directly from xbox motherboard.
File: hdtool.exe available from xboxhdm2 sourceforge.
CODE
hdtool (c) David Pye
[email protected]Licenced under the GNU GPL
Usage: hdtool
-p, --password - the password to use.
-e --eeprom-file - use an Xbox eeprom image from file to generate passw
ord
-o, --operation - the operation to perform, either LOCK, UNLOCK, or DISABLE-PW.
Either -a, -e or -p must be specified. -d is mandatory
If no operation is specified, the current drive security settings will be displayed
Example:
hdtool -p 12345678 --operation DISABLE-PW /dev/hda
will permanently remove the HDD password protection
In plain English, hdd locking/unlocking from Windows (if your OS driver supports IOCTL_IDE_PASS_THROUGH). XP SP2 has this. Unknown for other versions of Win OS. My test machine is on Win7.
My motherboard bios has Security Frozen feature so I can't test it myself but the program was able to issue low level ATA commands to read the hdd Serial and Model.
CODE
hdtool.exe /dev/hda
HDD Serial :
HDD Model : Hitachi
Drive Security Settings
Security supported : yes
Security enabled : no
Security locked : no
Security frozen : yes
Security count expired: no
I'll upload my source to sourceforge next time.
-
QUOTE(ldotsfan @ Mar 13 2010, 05:50 PM)

I'll upload my source to sourceforge next time.
Documented my changes to hdtool in here
-
QUOTE(ldotsfan @ Mar 9 2010, 08:56 PM)

I've verified with a hex editor the binary output from xboxhdm against xboxdumper's and only the FATX Volume IDs of the 5 FATX partitions differ so this is definitely viable.
subfdisk uses a random value for the volume ID anyway.
xboxhd and xbrowser (xboxhdm) doesn't recognize the partitions created and refused to work with them - testing was done from vmware agains the raw physical hdd. Even after manually creating the hda* device nodes with mknod and mounting them, xbrowser reported space problems while copying files to both C and E. Somehow the FATX partitions are broken somewhere. Further work is needed to investigate why this isn't working.
-
QUOTE(ldotsfan @ Mar 27 2010, 11:03 AM)

Further work is needed to investigate why this isn't working.
1. Reformatted the hdd as FAT32 under Windows.
2. Executed xboxdumper.
3. Noted that BRFR the magic xbox hdd identifier at offset 0x600 was missing and inserted the value with the hex editor. xboxdumper's logic for this is somehow broken.
4. Run xboxhdm1.9 under virtualbox.
5. This time, xbrowser did not complain and the file copies from Kingroach's C and E from the iso completed without errors.
6. Locked the hdd in the chipped xbox.
7. Booted xbox with chip off and was greeted by UnleashX dash from Kingroach's Ndure.
In other words, the xbox liked the xboxdumper created FATX partitions enough to boot from it. Need to do more tests on C,E,X,Y,Z partitions to verify.
-
QUOTE(ldotsfan @ Mar 28 2010, 10:00 PM)

Need to do more tests on C,E,X,Y,Z partitions to verify.
Happy to report that the XBMC install as dash and other apps went smoothfully without any surprises. Rebooted to XBMC and other apps worked too.
-
Time to put the pieces together for an end-to-end solution for hdd upgrades/replacement in Windows.
The necessary tools:
1. xboxdumper.exe. cygwin1.dll and mkfs.fatx from the same location.
2. hdtool.exe.
3. xplorer360
4. Installing Kingroach's Ndure (xplorer360 style).
5. eeprom.bin. Reference
Optional:
1. LiveInfo
2. CASH disc as a source of msdash 5960 files.
Instructions in the next post.
-
Instructions:
1. Download all files into the same folder.
2. Start a Command Prompt in Windows in that folder with administrative rights.
3. Run diskmgmt.msc. Take note of the Disk number corresponding to the xbox hdd, for example Disk 1 by using the drive size as a guide.
4.
CODE
xboxdumper prepare \\.\PhysicalDrive1
Make sure the first line of output is
CODE
Written -> BRFR
where PhysicalDriveN represents the xbox hdd, the number N must match the Disk number identified in step 3. In this case, N is 1.
5. Installing Kingroach's Ndure with xplorer360. If you are using Windows 7, you may need to disable UAC to enable drag&drop.
a. Open xbox hdd with xplorer360. Backup contents of C drive (partition 3). You might substitute msdash files from CASH disc in place of the backup of C drive.
b. Close the drive in xplorer360 and open shadowc.img in shadowc folder of ndure C folder with xplorer360.
c. Copy backup files from step 1 over to partition 0. Close the image.
d. Open xbox hdd with xplorer360 again. If you want ndure to coexist with existing msdash, delete xbox.xtf and xbox book.xtf in partition 3 and then copy over contents of ndure C folder over to partition 3. and take care ernie.xtf is copied before xbox.xtf. Otherwise delete away contents of partition 3 and copy over Ndure C folder contents over.
e. Copy ndure E folder contents to partition 4.
<Optional>
f. For setting up of UDDAE,
g. Copy xboxdashdata.17cdc100 folder in ndure C folder to partition 3.
h. Copy settings_adoc.xip from ndure C folder 's xboxdashdata.185ead00 folder to same folder in partiton 3.
i. If on partition 4, under TDATA/fffe0000/music folder , ST.DB exists, rename to ST2.DB.
j. Copy ST.DB from ndure E folder TDATA/fffe0000/music folder to same folder on partition 4.
6. Lock the hdd with hdtool.
CODE
hdtool /dev/hdc
will identify the hdd. Eg:
CODE
HDD Serial :
HDD Model : Hitachi
Drive Security Settings
Security supported : yes
Security enabled : no
Security locked : no
Security frozen : yes
Security count expired: no
CODE
hdtool -e eeprom.bin -p LOCK /dev/hdc
hda represents IDE primary master.
hdb is IDE primary slave.
hdc is IDE secondary master.
hdd is IDE secondary slave.
If xbox doesn't boot, use a hex editor and insert BRFR at offset 0x600 of the hdd. You have to unlock the hdd first with
CODE
hdtool -e eeprom.bin -p DISABLE-PW /dev/hdc
hdtool -e eeprom.bin -p UNLOCK /dev/hdc
-
Excellent work, as usual.
-
QUOTE(Heimdall @ Mar 29 2010, 11:27 PM)

Excellent work, as usual.

A minor bug fix for the reading of eeprom.bin and a newer copy of hdtool.exe uploaded to sourceforge.
-
QUOTE(ldotsfan @ Mar 30 2010, 10:43 PM)

and a newer copy of hdtool.exe uploaded to sourceforge.
This version doesn't set the master password to a known value like XBOXSCENE unlike the linux variant by ldots used by xboxhdm. A workaround is to use hdparm win32 to set the master password.
-
QUOTE(ldotsfan @ Apr 1 2010, 10:11 AM)

A workaround is to use
hdparm win32 to set the master password.
1. I've incorporated the hdparm code for master password setting into hdtool but it's untested. I still don't have a rig with the necessary specifications (since xboxhdm2.1 days) to test it myself. If you have a stock 8-10 GB hdd that you are prepared to brick and your rig meets the necessary requirements, ie OS runs hdtool and bios does not freeze lock and has the IOCTL_IDE_PASS_THROUGH support, please drop me a PM to sign up as a beta tester. Thanks.
2. xboxhdm traditionally has a rebuild C drive option. It should be easy to incorporate that into xboxdumper should there be a demand. If you would like this to be included, simply reply
.
3. A Powershell script or batch file to wrap-around the functionality in xboxdumper/hdtool and integrate things together will be nice. I will look into this in due time or if somebody is interested in taking the challenge, I welcome your help.
4. I'll be contacting the author of Xbox 360 Commander. This is related to point 3 and a GUI integrating xboxdumper/hdtool/xplorer360 will be very nice indeed. I hope he's receptive to supporting old-school xbox1 guys like us
-
Can you do this with a fully formatted PC drive?
If so, how?
Because when I do it, I don't get the BRFR at the beginning, and Xplorer360 for some reason only finds a Partition 0.
-
QUOTE(tripslipfall @ Apr 3 2010, 09:55 AM)

Can you do this with a fully formatted PC drive?
If so, how?
Because when I do it, I don't get the BRFR at the beginning, and Xplorer360 for some reason only finds a Partition 0.
1. Yes. Read my post that is a few posts in front of this post.
2. With a hex editor, I use HxD. Insert the value BRFR at offset 0x600. I haven't figured out why xboxdumper doesn't do it automatically in some situations.
3. If xplorer360 only finds one partition, something went wrong. Can you copy and paste the output of xboxdumper here?
-
QUOTE(ldotsfan @ Mar 29 2010, 09:46 PM)

3. Run diskmgmt.msc. Take note of the Disk number corresponding to the xbox hdd, for example Disk 1 by using the drive size as a guide.
4.
CODE
xboxdumper prepare \\.\PhysicalDrive1
Make sure the first line of output is
CODE
Written -> BRFR
where PhysicalDriveN represents the xbox hdd, the number N must
match the Disk number identified in step 3. In this case, N is 1.
Can a mod edit the post to put a warning that selecting the wrong drive will thrash the primary boot drive with Windows OS? All users are to double check and ensure the right drive is selected before proceeding.
Thanks
-
QUOTE(myfirstxbox @ Apr 5 2010, 06:49 PM)

I read somewhere that I need to hook xbox to router ... I dont have a router ..... cant I hook it xbox to my lappy . Internet I use is "3" three modem broadband is my only source of surfing the net.
Don't see the relevance of the question to the topic of the thread. Why don't you post a separate topic on it?
-
1. Integrated NghtShd's xbpartitioner partitioning code into xboxdumper. It now understands the ozpaul_b partitions and creates the compliant partition table at the hdd offset 0. No GUI though and currently hardcoded to create a F partition only. Other partitioning variants are supported in the code but yet to be exposed.
2. Integrated the 32k/64k FATX stuff.
Untested and WIP. Will document the changes in a separate development thread. Binaries at sourceforge.
Changes will fold back to xboxhdm3 in due time once I figure out how to get devfs working in ldots's xboxhdm initrd and it get tested.
-
QUOTE(ldotsfan @ Apr 2 2010, 10:45 AM)

4. I'll be contacting the author of
Xbox 360 Commander. This is related to point 3 and a GUI integrating xboxdumper/hdtool/xplorer360 will be very nice indeed. I hope he's receptive to supporting old-school xbox1 guys like us

Had some luck with Release 6 of Xbox 360 Commander. Will do more testing.
-
Revision 15a of Xbox 360 Commander was finally good to go with the full fileset of Kingroach's Ndure 3.1 on a 10Gb FATX hdd image, including the shadowC file and the 2 XBE at the root of C partition.
Will test in the xbox and see if the xbox likes the files created by 360 Commander.
-
QUOTE(ldotsfan @ Apr 17 2010, 10:53 PM)

Will test in the xbox and see if the xbox likes the files created by 360 Commander.
Xbox booted successfully.
-
QUOTE(reddwarffan @ Apr 19 2010, 05:38 AM)

And now I read you are developing a Windows solution for xboxhdm3 - man this just gets better and easier!
xboxhdm3 is unfinished with no definite timeline and it is still Linux based. xboxdumper is the tool that is Windows based.
QUOTE
Just to let you, I have a spare stock Xbox HDD which I will offer up for testing. However, due the ash cloud over the UK am the moment I am unable to buy a new test rig from ebay for a few weeks yet. When I do, and should you need testers, let me know and I will help out.
Thanks for the offer.
QUOTE
I have a question for you.
1) I done quite a bit of reading on this but I cannot find a definitive answer. I know you can create the necessary partitions and install files etc using hotswapping and your new windows method (which I have yet to test), but is it possible to lock a hdd using an IDE enclosure and a laptop running XP SP3 (which is my current setup)? The nearest I could find to an answer was this
post, but it's an old post - maybe a different approach has been found?
The answer in the past was a No. Now I'm not so sure, Cypress USB ATA chipsets used on some IDE enclosures support ATA security.
CODE
Cypress usb-pata bridge may use the ATACB proprietary scsi pass through command. The best way to know if your device support it, is to check your device usb id (most Cypress usb ata bridge got vid=0x04b4, pid=0x6830)
In the Linux kernel, CONFIG_USB_STORAGE_CYPRESS_ATACB need to be configured.
I'm not sure how such devices present themselves to Linux and I'm also uncertain the level of support Windows drivers provide for such devices as far as ATA security features are concerned, ie the hdd locking stuff.
That is at the OS layer. For userland applications like hdparm, hdtool, changes may be needed as well.
A quick Google yielded this result
CODE
SCSI subsystem
libata is the name of a set of drivers and some glue code that allows the SCSI layer to talk to ATA devices. From user land, for quite some time SATA drives have been showing up as /dev/sda (a SCSI disk device). More recently this was extended to PATA devices, and some old drivers were ported to libata.
libata does support HDIO_DRIVE_CMD and HDIO_DRIVE_TASK for backwards compatibility -- mainly for hdparm, hdtemp, smartmontools, etc. However it does not support HDIO_DRIVE_TASKFILE, and it is suggested that people use SG_IO instead.
The SCSI ioctl SG_IO allows the same features as the IDE TASKFILE, but sends the commands through the SCSI subsystem. Since the SCSI and ATA commands are nothing alike libata maintains translation code to do this for common commands, as mandated by the SAT2 T10 committee document referenced above.
If a command does not fit into the SAT2 translation you can wrap the ATA command with an SG_IO header and pass it using ATA16 pass-through commands
In plain English, a lot of work is still needed.
-
QUOTE(reddwarffan @ Apr 20 2010, 03:54 AM)

If we could agree on a certain model, I may look into it as plenty of selection available on
ebay. If your plate is full then it can wait - I am just curious about locking via usb - maybe I am too far ahead of myself?
I just did another Google for Cypress MSC driver and it turned out positive results for both Windows and Mac OS X: ATA security.
Now we need to find out if the driver extends the capabibility of hdd locking to user tools like hdtool.exe.
-
QUOTE(reddwarffan @ Apr 21 2010, 04:13 AM)

is it more of a trial and error approach i.e. buy one, fingers crossed and hope for the best
Unless somebody with better knowledge on the topic steps out, yes this is going to be trial and error
-
QUOTE(ldotsfan @ Mar 30 2010, 03:43 PM)


A minor
bug fix for the reading of eeprom.bin and a newer copy of hdtool.exe uploaded to sourceforge.
from which date and in which dir can the new and fixed eeprom reading hdtool.exe be found at sourceforge?
i don't know if i'm using the 'old' version but:
-
QUOTE(tyldd @ Apr 25 2010, 04:17 AM)

from which date and in which dir can the new and fixed eeprom reading hdtool.exe be found at sourceforge?
i don't know if i'm using the 'old' version but:

From the date of the post. xboxdumper folder.
The problem seemed to be unrelated to eeprom. Read this. What version of Windows are you using?
CODE
hdtool /dev/hda
will tell you the current security status of the hdd and whether Windows/motherboard bios implements Security Frozen. If you are using the same PC as the one you used for xboxhdm2.1, likely the security is frozen.
-
QUOTE(ldotsfan @ Apr 10 2010, 02:54 PM)

1. Integrated NghtShd's xbpartitioner partitioning code into xboxdumper. It now understands the ozpaul_b partitions and creates the compliant partition table at the hdd offset 0. No GUI though and currently hardcoded to create a F partition only. Other partitioning variants are supported in the code but yet to be exposed.
2. Integrated the 32k/64k FATX
stuff.
Untested and WIP. Will document the changes in a separate development
thread. Binaries at sourceforge.
Changes will fold back to xboxhdm3 in due time once I figure out how to get devfs working in ldots's xboxhdm initrd and it get tested.
Hdd size calculation bug fixed. Will upload changes to sourceforge. Had to define
CODE
#define _FILE_OFFSET_BITS 64
to make Cygwin happy. Now F/G partitions LBA offsets/sizes should be correct.
-
QUOTE(reddwarffan @ May 2 2010, 03:41 PM)

If I double-click the file in XP nothing happens. If I drag 'n' drop into Windows/Run, i.e. 'D:\Documents and Settings\Administrator\Desktop\xbox\XboxDumper\hdtool.exe /dev/hdc' an error is produced. Is it a DOS file?
Thanks in advance
It's a Windows console-based executable that depends on Cygwin. You'll need cygwin1.dll in the xboxdumper folder. What's the error encountered?
-
QUOTE(ldotsfan @ May 2 2010, 04:11 PM)

It's a Windows console-based executable that depends on Cygwin. You'll need cygwin1.dll in the xboxdumper folder. What's the error encountered?
I must admit I read it but it never sunk in...then a few hours later it clicked...doh.
I did say I was catching up to speed with my xboxing days 
Anyway, I ran hdtool.exe from a command prompt and the console booted up 
Will report back on XboxDumper testing later this week.
-
Happy to say XboxDumper was able to create correct partitions (C & E) on a stock 8gb Seagate hdd under the following test conditions
XP SP2
XP SP3
XP Live (using only 256Mb ram).
The following were noted:
In all tests XboxDumper was unable to write the 'magic' value to at offset 0x600. I used a HxD to write the required value (I used HxD portable for XP Live)
Installation of XBMC using xplorer360 beta 6 worked fine in all cases.
Much to my disappointment, I was unable to lock/unlock using the Windows hdtool as my bios places a security freeze on the hd (It's a pity the security freeze feature cannot be disabled :-). Still, I was able to run low level commands to view the state of the drive. I did try running hdtool anyway but I encountered the same 'freeze' as reported by tester in post 32 of this thread.
Theoretcially, it should be possible, if your bios allows you to disable the security freeze function, to lock/unlock and rebuild a Xbox HDD using XP live and the tools suggested in post 9 in this thread.
-
QUOTE(reddwarffan @ May 12 2010, 03:37 AM)

Happy to say XboxDumper was able to create correct partitions (C & E) on a stock 8gb Seagate hdd under the following test conditions
XP SP2
XP SP3
XP Live (using only 256Mb ram).
The following were noted:
In all tests XboxDumper was unable to write the 'magic' value to at offset 0x600. I used a
HxD to write the required value (I used HxD portable for XP Live)
Installation of XBMC using
xplorer360 beta 6 worked fine in all cases.
Much to my disappointment, I was unable to lock/unlock using the Windows hdtool as my bios places a security freeze on the hd (It's a pity the security freeze feature cannot be disabled :-). Still, I was able to run low level commands to view the state of the drive. I did try running hdtool anyway but I encountered the same 'freeze' as reported by tester in
post 32 of this thread.
Thanks for reporting back on your results. I'll try to fix the magic value bug - if it still exists. The drive size fix may have affected this. Getting a little confused on the various releases of xboxdumper I have - Windows and Linux
-
Test results with a 20Gb image
CODE
$ ./xboxdumper.exe
Syntax: xboxdumper
1. preparefg option leaves the standard partitions untouched and formats only F/G partitions while prepare formats all partitions.
2. listpartitions option displays a dump of the on-disk partition table.
-
While hunting for some files on one of my old hdd, I found an unfinished Windows GUI wrapper for xboxdumper.exe that I created with Visual Studio Express two years ago.
I will clean it up a bit and prepare for a source code release soon. The binary will be included but I cannot remember exactly what state I left it
Maybe somebody else wants to have another go at it some day...
-
File uploaded. I don't intend to develop this further