The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: N1ghtm4r3 on May 04, 2011, 11:13:52 AM

Title: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 04, 2011, 11:13:52 AM
A little tool to get Unique hard disk serial number using DLL.

(Buy the DLL (http://www.devlib.net/buy-getdiskserial.htm))
Title: Re: Hard Disk Serial Number
Post by: sinsi on May 04, 2011, 11:36:22 AM
Nothing happening here, win7 x64
Title: Re: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 04, 2011, 11:46:44 AM
Try to load it with administrator rights.
Title: Re: Hard Disk Serial Number
Post by: dedndave on May 04, 2011, 11:49:41 AM
works on XP SP3  :U
Title: Re: Hard Disk Serial Number
Post by: sinsi on May 04, 2011, 11:59:01 AM
Tried admin, tried drive 1, nothing.
Title: Re: Hard Disk Serial Number
Post by: ragdog on May 04, 2011, 12:14:44 PM
On X86 WIn7 works fine

WD-WXEZ0*2*5*8*

I have my Result censored
Title: Re: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 04, 2011, 12:18:05 PM
Quote from: sinsi on May 04, 2011, 11:59:01 AM
Tried admin, tried drive 1, nothing.
Probably the DLL fault on x64.
Title: Re: Hard Disk Serial Number
Post by: Vortex on May 04, 2011, 05:37:05 PM
The application works fine on my XP Pro SP3.
Title: Re: Hard Disk Serial Number
Post by: juozas on May 04, 2011, 06:20:08 PM
Works fine on my Intel Dual-Core with XP SP3, no problems :)

Got my HD serial easily: S20BJ90SC2***9
Title: Re: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 04, 2011, 07:35:58 PM
Thanks for report, guys :)
Title: Re: Hard Disk Serial Number
Post by: ragdog on May 04, 2011, 08:05:54 PM
Why if this dll not open source?
Title: Re: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 04, 2011, 08:15:50 PM
Quote from: ragdog on May 04, 2011, 08:05:54 PM
Why if this dll not open source?
Why what? the dll is not written by me.
Title: Re: Hard Disk Serial Number
Post by: qWord on May 04, 2011, 09:05:26 PM
N1ghtm4r3 ,

have you the permission of the vendor (http://www.devlib.net/index.htm) for sharing the DLL? - it is commerial!
Title: Re: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 04, 2011, 09:17:43 PM
Quote from: qWord on May 04, 2011, 09:05:26 PM
N1ghtm4r3 ,

have you the permission if the vendor (http://www.devlib.net/index.htm) for sharing the DLL? - it is commerial!
The DLL replaced with Demo one from website and first post updated.
Sorry didn't notice that before :)
Title: Re: Hard Disk Serial Number
Post by: ragdog on May 04, 2011, 11:28:10 PM
Ahh ok

Here is a Info to get the serial via WMi
http://netcode.ru/dotnet/?lang=&katID=30&skatID=264&artID=7284

I think it gives other ways to get the serial without WMi
with DeviceIoControl

http://www.masm32.com/board/index.php?topic=12398.msg95136#msg95136

I have for a longe time coded with DeviceIoControl I must  look if I still have already this Project
Title: Re: Hard Disk Serial Number
Post by: RuiLoureiro on May 05, 2011, 07:04:12 PM
Hi
    I am trying to use DeviceIoControl
    but i havent STORAGE_PROPERTY_QUERY and IOCTL_STORAGE_QUERY_PROPERTY
    where can i find it ?
    Thanks
Title: Re: Hard Disk Serial Number
Post by: ragdog on May 05, 2011, 08:21:07 PM
http://www.masm32.com/board/index.php?PHPSESSID=fa6317223d0698039ffd8f6ff3db32e9&topic=11486.0
Title: Re: Hard Disk Serial Number
Post by: RuiLoureiro on May 06, 2011, 02:46:23 PM
Thank you ragdog :wink
Title: Re: Hard Disk Serial Number
Post by: RuiLoureiro on May 06, 2011, 03:20:56 PM
When
        szDriveName     db "C:\", 0

        invoke  CreateFile, Addr szDriveName, NULL, NULL, NULL, OPEN_EXISTING, NULL, NULL
        returns    eax=INVALID_HANDLE_VALUE

        It doesnt work ! Why ?
Title: Re: Hard Disk Serial Number
Post by: ragdog on May 06, 2011, 03:30:48 PM
QuoteTo retrieve a handle to the device, you must call the CreateFile function with either the name of a device or the name of the driver associated with a device. To specify a device name, use the following format:

\\.\DeviceName

DeviceIoControl can accept a handle to a specific device. For example, to open a handle to the logical drive A: with CreateFile, specify \\.\a:. Alternatively, you can use the names \\.\PhysicalDrive0, \\.\PhysicalDrive1, and so on, to open handles to the physical drives on a system.

http://msdn.microsoft.com/en-us/library/aa363216%28v=vs.85%29.aspx
Title: Re: Hard Disk Serial Number
Post by: RuiLoureiro on May 06, 2011, 03:36:46 PM
Ok, Thank you ragdog !   :wink
i will go to test it
Title: Re: Hard Disk Serial Number
Post by: N1ghtm4r3 on May 10, 2011, 12:51:59 PM
New version of this DLL is out, win 7 issue might be fixed in this version.

http://www.devlib.net/download-getdiskserial.htm
Title: Re: Hard Disk Serial Number
Post by: ragdog on May 10, 2011, 12:59:52 PM
$31.96 for a dll that give me information about my drives ::)

I think that is not really difficult to coding it gives many examples about it

SeaFarer have a good example
http://www.winasm.net/forum/index.php?showtopic=2224