Author Topic: Windows-based DMS Format scripts  (Read 10458 times)

0 Members and 1 Guest are viewing this topic.

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Windows-based DMS Format scripts
« on: December 25, 2005, 05:05:35 am »
If anybody would like to try it out, I have written some scripts that work in XP to generate a working DMS... assuming your PhatBox is already fully hacked.

http://downloads.phathack.com/sbingner/dmsutils.exe

This is a self-extracting rar.  You need to run "backupdms.bat" which will generate the files necessary for the creation of a replacement DMS, you then need to run "newdms.bat" which will format a replacement DMS.  Once this is done, you will need to add songs using PMM

This does not copy over the keys, and does not start the partition at the proper offset... so DO NOT use newdms.bat against a stock/OEM signed DMS... I have put in some code that will hopefully make it recoverable if anybody does, but let's not test it hmm?

Sam
« Last Edit: December 25, 2005, 11:20:18 am by sbingner »

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: Windows-based DMS Format scripts
« Reply #1 on: December 25, 2005, 03:03:53 pm »
Nice work!

Edit:

I think we can make some changes to this script and get the windows DD to work so we don't need a boot disk anymore.

Code: [Select]
D:\Documents and Settings\alastor\Desktop\dms\dmsutils>DISKPAR -i 3
---- Drive 3 Geometry Infomation ----
Cylinders = 12161
TracksPerCylinder = 255
SectorsPerTrack = 63
BytesPerSector = 512
DiskSize = 100027630080 (Bytes) = 95393 (MB)

---- Drive Partition 0 Infomation ----
StatringOffset = 8225280
PartitionLength = 65802240
HiddenSectors = 16065
PartitionNumber = 1
PartitionType = b
---- Drive Partition 4 Infomation ----
StatringOffset = 74028032
PartitionLength = 99953602048
HiddenSectors = 1
PartitionNumber = 2
PartitionType = b

End of partition information. Total existing partitions: 2

The hidden sectors on the first parition listed is the key peice of making this work.  I also think we should test to see if we can get that hidden sector count to be 16384 as that will prevent reads and writes crossing physical boundaries on the media, which will cause two read or write operations every 4 8 or 16 read/write ops due to the physical drive structure and the filesystem block size.  This won't be a huge peformance increase but it will be an increase.

Sam, do you know, in the boot loader code in flash, is that offset hard coded or does it look for the start of the first partition to find the first FAT?

Also.. another thing to note...

I seem to recall that in windows 2003 the diskpar.exe utility does NOT work.  It will run and create partitions but it does not use the offset / hidden sector information for some reason and creates bad partitons ... in SP1 for 2003 the functions of diskpar from previous versions of windows was wrapped into diskpart.exe ... remember to look for the t and the end of the file name people, they are NOT the same utility.

Lastly, Sam, is it safe to distribute diskpar.exe outside of microsofts windows 2000 resource kit?
« Last Edit: December 25, 2005, 03:30:58 pm by judb »

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: Windows-based DMS Format scripts
« Reply #2 on: December 26, 2005, 04:25:36 am »
oooooh.. I had a thought.

have you guys heard of http://www.vmware.com/products/player/ the VMWare Player?

I was thinking, perhaps, we could just build a full music managment OS distro that runs in a VMware session or something.  You just configure your vmware session to have the DMS connected to it and voila!...  for accessing existing music on your PC, I'd say you could use a file share in windows or an nfs share on linux and mount it up from there within the virutal machine.  This way we could send out updates to the whole thing (think phat4X and hack disc all in one)... although I am thinking it may be easiear to go with a text based managment interface like the norton dos commander style or something.

Just brain storming.  

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: Windows-based DMS Format scripts
« Reply #3 on: December 26, 2005, 09:51:43 am »
Quote
oooooh.. I had a thought.

have you guys heard of http://www.vmware.com/products/player/ the VMWare Player?

I was thinking, perhaps, we could just build a full music managment OS distro that runs in a VMware session or something.  You just configure your vmware session to have the DMS connected to it and voila!...  for accessing existing music on your PC, I'd say you could use a file share in windows or an nfs share on linux and mount it up from there within the virutal machine.  This way we could send out updates to the whole thing (think phat4X and hack disc all in one)... although I am thinking it may be easiear to go with a text based managment interface like the norton dos commander style or something.

Just brain storming.  


But then everybody would have to buy VMWare....

diskpar works on Windows 2003, I've used it on like 40 servers... verified that it actually set the offset too.  Of course that was on an EMC-Symettrix connected server...  unfortunately it won't partition anything but the whole partition, which is a bit useless for us... I tried to do that... we could make it create a single partition with an offset of "2048" (just look at output Bytes per Sector and divide 1MB (1024*1024)/BytesPerSector)

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: Windows-based DMS Format scripts
« Reply #4 on: December 26, 2005, 09:54:52 am »
Quote
Sam, do you know, in the boot loader code in flash, is that offset hard coded or does it look for the start of the first partition to find the first FAT?

It reads the FAT, which is why partitioning a hacked DMS to start on the beginning of the drive like this works fine so long as the fact that it can't find the signature doesn't matter to it... the DMS I'm currently using was reformatted using those scripts.... we just couldnt use this on a dms that we want to be able to use on a unhacked box later.   I'd like to find a way to read serialnumber off the drive, so we can save the signature with the serial number though... less chance of frying a good DMS

Quote
Lastly, Sam, is it safe to distribute diskpar.exe outside of microsofts windows 2000 resource kit?
I'm not 100% sure, but we could make a script download it from microsoft if not

oh yea, we could make the offset with diskpart... but it only seems to work on one cyl increments.  On the 60GB drive I'm testing with that's 8MB... probably wouldnt really be that big a deal if we wanted to throw that space away
« Last Edit: December 26, 2005, 10:13:05 am by sbingner »

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: Windows-based DMS Format scripts
« Reply #5 on: December 26, 2005, 10:15:30 am »
I'm an idiot, diskpar will let me specify partition length on the first partition (but then it ends up not ending on a cyl boundary).... I just updated the scripts to use diskpart's offset option, but since windows seems to like LBA(?) info it's using an offset 8MB on even a 20GB dms.  Seems to work anyways

the /dev/sda info is from after running on the audi DMS and the image file is before
Code: [Select]
Disk /dev/sda: 20.0 GB, 20003880960 bytes
255 heads, 63 sectors/track, 2432 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2          14      104422+   b  W95 FAT32
/dev/sda2              15        2431    19414552+   f  W95 Ext'd (LBA)
/dev/sda5              15        2431    19414521    6  FAT16
[root@recluce phat]# fdisk -l DMS-Audi20GB.img
Disk DMS-Audi20GB.img: 20.0 GB, 20003880960 bytes
64 heads, 32 sectors/track, 19077 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

           Device Boot      Start         End      Blocks   Id  System
DMS-Audi20GB.img1               2         261      266240    b  W95 FAT32
DMS-Audi20GB.img2             262       19077    19267584    5  Extended
Partition 2 has different physical/logical endings:
     phys=(1023, 63, 32) logical=(19076, 63, 32)
DMS-Audi20GB.img5             262       19077    19267583+   b  W95 FAT32
« Last Edit: December 26, 2005, 11:22:12 am by sbingner »

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: Windows-based DMS Format scripts
« Reply #6 on: December 26, 2005, 02:39:33 pm »
Quote
Quote
oooooh.. I had a thought.

have you guys heard of http://www.vmware.com/products/player/ the VMWare Player?

I was thinking, perhaps, we could just build a full music managment OS distro that runs in a VMware session or something.  You just configure your vmware session to have the DMS connected to it and voila!...  for accessing existing music on your PC, I'd say you could use a file share in windows or an nfs share on linux and mount it up from there within the virutal machine.  This way we could send out updates to the whole thing (think phat4X and hack disc all in one)... although I am thinking it may be easiear to go with a text based managment interface like the norton dos commander style or something.

Just brain storming.  



But then everybody would have to buy VMWare....

diskpar works on Windows 2003, I've used it on like 40 servers... verified that it actually set the offset too.  Of course that was on an EMC-Symettrix connected server...  unfortunately it won't partition anything but the whole partition, which is a bit useless for us... I tried to do that... we could make it create a single partition with an offset of "2048" (just look at output Bytes per Sector and divide 1MB (1024*1024)/BytesPerSector)

dude, i linked to vmware's new player product.. its FREE.. :P  way to read the link! :)

Well, hmm.. I don't have the article handy that said not to do it on 2003 but anyhow I doubt that anyone would be hacking a dms on windows 2003..

As for loosing 8 megs instead of 1 meg I don't think it matters to me at all.. the idea here is to gain lots of space so a few megs would be a small loss.
« Last Edit: December 26, 2005, 02:45:06 pm by judb »

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: Windows-based DMS Format scripts
« Reply #7 on: December 27, 2005, 12:13:56 am »
Hmm, I like the vmware player thing... lets make one for that :)

Offline phatsailor

  • Newbie
  • Posts: 7
Re: Windows-based DMS Format scripts
« Reply #8 on: January 18, 2006, 10:21:42 pm »
I gave this a try.  I uncompressed the files and put them in c:\dmsutils.

I started a DOS window and changed to the c:\dmsutils directory

There is no DMS installed.  I typed backupdms and get the following response:

"Please ensure DMS is NOT connected and press enter to continue"

I hit enter and get:

"Please inset the stock (original) DMS and press enter to continue"

I insert my original DMS and hit enter and get:

"backupdms.sh: command not found: sleep [11]
backupdms.sh: command not found: diff[13]
bacbakcukpudpmdsm.ss.hs: hc: ocmommamnadn dn onto tf ofuonudn:d :w cg [13]
re[ [13]
backupdms.sh: parse error: condition expected: -eq [13]
Error: multiple or no new drives detected. Starting over.
Please ensure DMS is NOT connected and press enter to continue"


Any suggestions?
« Last Edit: January 19, 2006, 01:27:12 am by phatsailor »

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: Windows-based DMS Format scripts
« Reply #9 on: January 19, 2006, 08:17:59 am »
those files should have been part of the package, if I missed them I'll not be able to update it till I get home... but you can just do a search for Win32 versions of those files and put them in the same directory and you should be good... unless I forgot to put a "./" in front of them at that line