Sam Trenholme's webpage
This article was posted to the Usenet group alt.hackers in 1995; any technical information is probably outdated.

Re: Disk Serial Numbers.


Article: 7827 of alt.hackers
From: jsl2228@acf4.nyu.edu (jsl2228)
Newsgroups: alt.hackers
Subject: Re: Disk Serial Numbers.
Date: 17 May 1995 04:36:00 GMT
Organization: New York University
Lines: 32
Approved: Site administrator
Message-ID: 3pbufg$la@cmcl2.NYU.EDU
NNTP-Posting-Host: acf4.nyu.edu
X-Newsreader: TIN [version 1.2 PL2]
Status: RO

MICHAEL PAUL DANIEL (mdanie@wilbur.mbark.swin.oz.au) wrote:
: Just a quick question.. How does MS-DOS determine the serial number when
: you format a disk??

	It's not a pesudo-randum number #, it actually has a formula.  It's
based on the current date & time.

unsigned long int NS;  (Serial numbers are 32 bits)

NS = (	( ( ((seconds << 8) + hundreth) ) +
	    ((day << 8) + month) ) << 16 ) +
       (   ((hour << 8) + minutes) + year);

	Try this: get a disk that is already formatted (but whose data you
don't care about:)

>FORMAT A:/Q/U/V:""

	Format the disk once, note the serial number, then immediately
format it again.  Note that the second serial number only differs in
a few digits from the first.

ObHack:
	A few years ago, to hack a Novell network, I wanted a copy of
the boot disk for diskless workstations.  Getting the image file was
easy, but how to get it into a floppy?	DiskEdit works, but is cumbersome
if you have to do it many times.  So I wrote R-DOSGEN, to Reverse
the DOSGEN process (and also take out the changes made by RPLFIX)
Now Novell's DOSGEN can also reqrite a diskette based on the image...
but, I did add disk formatting to my pgm, and (you guessed it!)
adding new serial numbers to the disks, just like DISKCOPY does.




Parent

Back to index