• Advertisement

Archived

This topic is now archived and is closed to further replies.

Hard Drive Serial Number

This topic is 5759 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i cant seem to find any Docs on how to retrieve it...im sure there should be some API''s to do this..anyone know?

Share this post


Link to post
Share on other sites
Advertisement
you might want to lookup the VPD specification. i know you can read information from the IDE bus. although, you may have to read from the EPROM of the HDD, and this may be vendor specific.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
I have code to do it in VB. It is just an API call. I dont have it with me, but if you can wait til Friday, I could post it.


University is a fountain of knowledge, and students go there to drink.

Share this post


Link to post
Share on other sites
quote:
Original post by Palidine
Out of curiosity is that for a copyright protection scheme?

-me


im doing it because i wrote a very secure database program, and will only run on on 3 peoples computers with thier HD Serial #. Also incorporates encryption. Cant have other people running/using our program and database. Top Secret stuff


Yea, id love to see the code in VB, but ill prolly find it before then. email it to damnmessycan@hotmail.com

Share this post


Link to post
Share on other sites
Look at the GetVolumeInformation() api call. You should be able to get everything you need with that.

Kory

Share this post


Link to post
Share on other sites
if it''s known users, is there a reason why you don''t just read it off the side of the HD? it''s printed on a big fat sticker, or engraved in the metal.

-me

Share this post


Link to post
Share on other sites
quote:
Original post by Palidine
if it''s known users, is there a reason why you don''t just read it off the side of the HD? it''s printed on a big fat sticker, or engraved in the metal.

-me


i still have to check whether the specific machine is using it. also, im not hardcoding this(VB). i also wrote an app in C++ that will only allow people with the program to register themselves with only specific IP addresses, and it will patch the program created in VB so they can use it. everything is encrypted also

Cant just let anyone view confidential info.

Share this post


Link to post
Share on other sites
hmmm
windows registery ??


  
HKEY hKey[9];
DWORD dwNumKeys = 9;
DWORD dwKeyIndex;
BOOL bkeyFound = FALSE;

if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"HARDWARE",0,KEY_READ,&hKey[0]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);

if(RegOpenKeyEx(hKey[0],"DESCRIPTION",0,KEY_READ,&hKey[1]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);

if(RegOpenKeyEx(hKey[1],"System",0,KEY_READ,&hKey[2]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);

if(RegOpenKeyEx(hKey[2],"MultifunctionAdapter",0,KEY_READ,&hKey[3]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);

DWORD dwQueryNumber=0;
char rgchSubQueryStringBuffer[MAX_STRING_SIZE];

while(!bkeyFound)
{
if(RegOpenKeyEx(hKey[3],_itoa(dwQueryNumber++,rgchSubQueryStringBuffer,10),0,KEY_READ,&hKey[4]) == ERROR_SUCCESS)
{
if(RegOpenKeyEx(hKey[4],"DiskController",0,KEY_READ,&hKey[5]) == ERROR_SUCCESS)
bkeyFound = TRUE;
else
RegCloseKey(hKey[4]);
} else
MessageBox("Cannot find registery key","Error",MB_ICONERROR);
}

if(RegOpenKeyEx(hKey[5],"0",0,KEY_READ,&hKey[6]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);

if(RegOpenKeyEx(hKey[6],"DiskPeripheral",0,KEY_READ,&hKey[7]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);

if(RegOpenKeyEx(hKey[7],"0",0,KEY_READ,&hKey[8]) != ERROR_SUCCESS)
MessageBox("Cannot find registery key","Error",MB_ICONERROR);



DWORD dwKeyType;

if(RegQueryValueEx(hKey[8],"Identifier",NULL,&dwKeyType,NULL,pSize) != ERROR_SUCCESS)
MessageBox("Cannot read registery value","Error",MB_ICONERROR);

BYTE * pBuffer = new BYTE[*pSize];

if(RegQueryValueEx(hKey[8],"Identifier",NULL,&dwKeyType,pBuffer,pSize) != ERROR_SUCCESS)
MessageBox("Cannot read registery value","Error",MB_ICONERROR);

for(dwKeyIndex=0;dwKeyIndex < dwNumKeys;dwKeyIndex++)
RegCloseKey(hKey[dwKeyIndex]);

return (LPSTR)pBuffer;



i wrote this to find the hard disk number, its unique for each machine..



{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites
IP address is surely worthless, given that I can give any adaptor on my system any IP address I want.

Share this post


Link to post
Share on other sites
quote:
Original post by korybricker
Look at the GetVolumeInformation() api call. You should be able to get everything you need with that.

Kory


the HDD volume S/N is not the HDD S/N. the volume S/N is assigned when you format the volume (partition) .

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites

  • Advertisement