How can I get a Unique System ID?
As in, different for every Computer.
Posted on 2003-05-03 16:08:20 by ESP
Sorry, posted in MASM forum..

Any suggestions?
Posted on 2003-05-03 19:03:25 by ESP
There is none. What are you up to?
Posted on 2003-05-03 19:08:38 by Sephiroth3
well, CPU IDs are usually disabled.

I think a safe bet for a relative unique ID linked to each computer would be either a MAC address from a nic or the serial number from the HD. I think to get the serial of the HD there's code on the board somewhere.
Posted on 2003-05-03 19:24:59 by Hiroshimator
Posted on 2003-05-03 19:37:12 by Hiroshimator
Thanks

Is there a way to retrieve the Drive Serial Number without a activex controls, and win32?
Posted on 2003-05-03 20:54:09 by ESP
MSDN is your friend :)


lpVolumeSerialNumber
Pointer to a variable that receives the volume serial number. This parameter can be NULL if the serial number is not required.


Posted on 2003-05-03 21:05:04 by Hiroshimator
BOOL GetVolumeInformation(

LPCTSTR lpRootPathName, // address of root directory of the file system
LPTSTR lpVolumeNameBuffer, // address of name of the volume
DWORD nVolumeNameSize, // length of lpVolumeNameBuffer
LPDWORD lpVolumeSerialNumber, // address of volume serial number
LPDWORD lpMaximumComponentLength, // address of system's maximum filename length
LPDWORD lpFileSystemFlags, // address of file system flags
LPTSTR lpFileSystemNameBuffer, // address of name of file system
DWORD nFileSystemNameSize // length of lpFileSystemNameBuffer
);

invoke GetVolumeInformation, addr Drive, addr VName, 255, addr VID, 0, 0, addr FSName, 255
invoke MessageBoxA,hWin,addr VID,addr VID,0

doesn't seem to work correctly lol. Doesn't look like the numbers to me, and I know my HD serial.
Is there a different way I should be getting the info?
Posted on 2003-05-03 21:37:22 by ESP
Hi ESP,
Use the dw2hex function before trying to display the Volume ID. Yoiu must include the masm32.inc and masm32.lib files.

;add this
.data?
dwBuffer db 12 dup(?)


.code
invoke GetVolumeInformation, addr Drive, addr VName, 255, addr VID, 0, 0, addr FSName, 255

;add this line
invoke dw2hex, VID, addr dwBuffer


;change this
;invoke MessageBoxA,hWin,addr VID,addr VID,0

;to this
invoke MessageBoxA, hWin, addr dwBuffer, addr dwBuffer, 0

Hope this helps,
bgong68
Posted on 2003-05-03 23:13:53 by bgong68
Only that THAT serial number (retuned by API) is NOT the real hardware serial number of HDD, it is just a number that Windows assigns to each HDD at format time. It can ve changed quite easy with Partition Magic for example, but tere are other simple tools also.

To get the hardware serial number of a HDD one would need a Vxd or a SYS driver. ..to do IN/OUT operation on IDE interface. Besides this ATA command is optional...however it is a fair cahnce it will work in today new HDD's.

Eh i guess WinIO will do also?
Posted on 2003-05-04 02:54:42 by BogdanOntanu
Are there ways to grab the real HD Serial in win32 programs without the vxds and what not?
Posted on 2003-05-04 19:21:43 by ESP
ESP, Please remember your not the first one to tackle this job. Maybe getting a hint from the leaders will help.

You gave as a point, Hard Drive serial. There are other pieces of information about the hard drive you can serialize from.

Most vendors use a blended approach to serializing a computer system.
On PIII, you can manipulate the CPUID, but Intel discontinued that, because of the privacy issues. But there is also a CPUID string with other characteristics of the CPU to serialize from.

Check the address of any NICs installed.

Checking installed hardware items.

Checking DUN accounts and network settings.

Known OS serial number.

Other Software installed.

There was a white paper about M$'s serializing attemps and others, which should give you more ideas.

Plus you need an algorythum to determine what is valid change in a system and update accordingly.

Then there is the embbeded serial number, you leave a serial number on the system. I have seen where a program manipulates the file buffer area beyond the end of file. Reseting file access times of course. Personally, I don't care for this technique. Hidden files and/or Paths, registry settings ( like adding extra entries in normal key areas.

Regards, P1
Posted on 2003-05-05 10:05:19 by Pone
hidden files and "weird registry keys" are pretty sucky... and a pretty bad plan if you want to support NT and future security-minded OSes.
Posted on 2003-05-05 10:08:08 by f0dder
Pone has mentioned a white paper about M$'s  serializing. Can anybody give me any information about this white paper (link, correct title, author, ....) to find this?

Many thanks for your help.

DS
Posted on 2010-02-25 02:15:34 by ds10-08

Only that THAT serial number (retuned by API) is NOT the real hardware serial number of HDD, it is just a number that Windows assigns to each HDD at format time. It can ve changed quite easy with Partition Magic for example, but tere are other simple tools also.

To get the hardware serial number of a HDD one would need a Vxd or  a SYS driver. ..to do IN/OUT operation on IDE interface. Besides this ATA command is optional...however it is a fair cahnce it will work in today new HDD's.

Eh i guess WinIO will do also?


wrong.. it can be obtained via the WMIi interface
Posted on 2010-02-25 04:41:12 by evlncrn8
wrong.. it can be obtained via the WMIi interface
Was that present in 2003?
Posted on 2010-02-25 07:15:21 by f0dder