How can I get a Unique System ID?
As in, different for every Computer.
As in, different for every Computer.
Sorry, posted in MASM forum..
Any suggestions?
Any suggestions?
There is none. What are you up to?
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.
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.
Thanks
Is there a way to retrieve the Drive Serial Number without a activex controls, and win32?
Is there a way to retrieve the Drive Serial Number without a activex controls, and win32?
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.
lpVolumeSerialNumber
Pointer to a variable that receives the volume serial number. This parameter can be NULL if the serial number is not required.
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?
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?
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
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
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?
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?
Are there ways to grab the real HD Serial in win32 programs without the vxds and what not?
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
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
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.
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
Many thanks for your help.
DS
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
wrong.. it can be obtained via the WMIi interface
Was that present in 2003?