Solved

READ HARD DISK SERIAL NUMBER

Posted on 2000-05-16
13
28,681 Views
Last Modified: 2011-08-18
HOW TO READ REAL SERIAL NUMBER OF HARD DRIVE... IN DOS OR WINDOWS ?

NOT VIRTUAL SERILA NUMBER... REAL SERILA NUMBER OF HARD DRIVE
...
WHAT IS VIRTUAL SERILA NUMBER = ANY SERIAL NUMBER THAT IS ASSING TO HARD DRIVE WHEN USER FORMAT THEM .... EVERYTIME WHEN YOU USE FORMAT SERIAL NUMBER IS DIFFERENT....

HOW TO READ REAL SERIAL NUMBER NOT VIRTUAL SERIAL NUMBER?
0
Comment
Question by:BOKINET
  • 5
  • 4
  • 4
13 Comments
 
LVL 6

Accepted Solution

by:
My name is Mud earned 50 total points
ID: 2816314
Program GetIDEHDDInfo;
USES
  CRT,DOS;
Type
  ArraySTR = Array[0..255] Of Byte;
Const
  WhichDrv: Array[1..2] Of Word = ($A0,$B0);
Var
  NumDrv: Word Absolute $0040:$0075; { BIOS info on how many HDD you have }
  Regs: Registers;
  Data: ArraySTR;
  DataOff: Byte;
  Loop: Integer;

Function GetString(InData: ArraySTR; OffStart,OffEnd: Byte): String;
Var
  TempSTR: String;
  I: Byte;
Begin
  TempSTR:='';
  For I:=OffStart To OffEnd Do
    TempSTR:=TempSTR+Char(InData[I]);
  GetString:=TempSTR;
End;

Begin
  ClrScr;
  WriteLn('You have ',NumDrv,' Hard Disk(s).');
  For Loop:=1 to NumDrv Do
    Begin
      WriteLn('  Info on Hard Disk ',NumDrv,' is:');
      While Port[$01F7] <> $50 Do; { Wait For controller not busy }
      Port[$01F6]:=WhichDrv[Loop]; { Get first/second drive }
      Port[$01F7]:=$EC;            { Get drive info data }
      While Port[$01F7] <> $58 Do; { Wait for data ready }
      For DataOff:=0 To 255 Do     { Read "sector" }
        Data[DataOff]:=Port[$01F0];
      WriteLn('    Model Number: ',GetString(Data,27,46));
      WriteLn('    Serial Number: ',GetString(Data,10,19));
    End;
End.
0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 2828364
Hey!!! how 'bout some feedback??? did it work for you??? HEY!!! Is any body home???
0
 
LVL 3

Expert Comment

by:vikiing
ID: 2833025
>>EVERYTIME WHEN YOU USE FORMAT SERIAL NUMBER IS DIFFERENT....

FORMAT program uses current time to calculate disk number; that's why each time you use FORMAT, srial number differs. BUT both you and your friend, if format a disk simultaneously could (in theory) get the same serial number.

Even you can try this: create a .BAT file and put these commands on it:

TIME <any time you want>
FORMAT <drive>

Execute the BAT file several times, and time will be the same each time you run it.

But I don't know why I think I'm tallking to a wall... :~(
0
 

Author Comment

by:BOKINET
ID: 2833051
i made any program in turbo pascal 6.0 that read all information from bios including hard disk serial number (real not from boot sector ) and hard disc... but i need to make the same application that will do the same thing in windows because this pascal program can only work in msdos ... and i am writeing any windows application
0
 

Author Comment

by:BOKINET
ID: 2833062
i made any program in turbo pascal 6.0 that read all information from bios including hard disk serial number (real not from boot sector ) and hard disc type... but i need to make the same application that will do the same thing in windows because this pascal program can only work in msdos ... and i am writing any windows application
0
 
LVL 3

Expert Comment

by:vikiing
ID: 2834956
>>that read all information from bios including hard disk serial number

Disk serial number does NOT come from BIOS.


>>this pascal program can only work in msdos

If it runs in DOS, it can run perfectly under a DOS window from Windoze (in fact, I have Pascal and Basic (both compilers from Borland) programs which perform the same job. And work.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:BOKINET
ID: 2835349
not exacli from bios - bios read from hard drive...

0
 
LVL 3

Expert Comment

by:vikiing
ID: 2835461
>>bios read from hard drive

hehehehe... BIOS reads from (and writes to !!) everything, including a diskette [one of the reasons why BIOS means "Basic Input/Output System"]  :) :)
0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 2835971
Can i get my points???
0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 2836477
Why did i get a "B" when you specifically say:

  HOW TO READ REAL SERIAL NUMBER OF HARD DRIVE... IN "DOS" OR WINDOWS?


Just a doubt...

But Thanks... hope the code had help you out...
0
 

Author Comment

by:BOKINET
ID: 2838052
i didn't use your code but is ok..
i had been done with my own code
but i am still looking for code that do the same thing under windows system (via API)
0
 
LVL 3

Expert Comment

by:vikiing
ID: 2838769
>>i am still looking for code that do the same thing under windows system (via API)

If you're looking for a protection system, I'm afraid you're going in the wrong direction; disk "serial" number is not such a thing. In fact, that stupid number can be written as easily as it can be read. ¿Do you know what are one of mi disks' number?: BEBE-CACA (you must know Spanish :)

Thus, if your protection scheme is based on a disk number, anyone can duplicate thge same number on another disk and ¡¡voilà!! your protection system was defeated.

Sorry...
0
 

Author Comment

by:BOKINET
ID: 2839887
he, he ,,, VIKING give me your email
to send you program that read serial number... and see...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to resolve an IP Address to a host name 6 1,679
Wininet read php file from internet issue 6 83
Virtuailstring tree compare node issue 14 105
Using idhttp to login to instagram 2 76
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now