Hardware serial number generator
03
Apr
Posted by: Tomasz Klekot in: Programming
One of my applications had to encrypt very secret informations on user’s computer.
I thought that asking user for password would be foolish, because it’s easier to get the password from user than crack encrypted data.
All I’ve needed was unit/code that generates unique identificator for a computer.
I’ve spent many hours searching for it, but without results.
So, I’ve decided to create my own hardware serial number generator.
Ingredients list
- Delphi 5/6/7/2005/2006
- Magenta WMI - gives access to WMI - the most complete informations source in Windows
- MD5 unit - you can also use DCPcrypt’s MD5 unit
Requirements
- Windows 2000,Windows XP or higher (it may also work on older Windows versions, but you’ll have to install WMI Host)
- Small Delphi experience
The work
So, idea is simply - get as many as possible informations that are constant and uniqe, for example BIOS Name or processor id.
My generator uses:
- Motherboard name
- Windows serial number
- Windows installation date
- Processor id
- Bios id
- All disks’ serial numbers
- All disks’ models
Where to use?
It has many uses - it can be used in licensing systems, encryption, banning etc.
You should try it with DCPcrypt.
The code
Motherboard name:
Code (delphi)
-
Result:=MagWmiGetBaseBoard;
Windows serial number:
Code (delphi)
-
Result:=MagWmiGetOSInfo(‘SerialNumber’);
Windows installation date:
Code (delphi)
-
Result:=MagWmiGetOSInfo(‘InstallDate’);
Processor ID:
Code (delphi)
-
Result:=MagWmiGetProcInfo(‘ProcessorID’);
Bios ID:
Code (delphi)
-
uses Registry;
-
-
function BiosID : string;
-
var WinReg : TRegistry;
-
Buffer : PChar;
-
Retvar : String;
-
begin
-
try
-
WinReg := TRegistry.Create;
-
WinReg.RootKey := HKEY_LOCAL_MACHINE;
-
if WinReg.OpenKeyReadOnly(‘\HARDWARE\DESCRIPTION\System’) then begin
-
GetMem(Buffer,$2000);
-
WinReg.ReadBinaryData(‘SystemBiosVersion’,Buffer^,$2000);
-
RetVar := WinReg.ReadString(‘Identifier’) + ‘ ‘ + Buffer;
-
FreeMem(Buffer);
-
end;
-
finally
-
WinReg.Free;
-
end;
-
Result := Retvar;
-
end;
Disks’ serial numbers:
Code (delphi)
-
Result:=MagWmiGetDiskSerial(DiskIndex)
Disks’ models:
Code (delphi)
-
Result:=MagWmiGetDiskModel(DiskIndex)
Example
Here’s my computer’s hardware serial number and informations that were used to generate it:
Hardware serial number ingredients:
ASUSTeK Computer INC. A7N8X-E
55034-642-5926024-XXXXX
20051110171825.000000+060
0383FBFF0000XXXX
AT/AT COMPATIBLE Nvidia - 42302XXX
WD-WMAJ9127XXXX
WDC WD80 0JD-00HKA0 SCSI Disk Device
My computer’s hardware serial number:
5a902af52d637fcc4aa48425784d2a73
45fde343d3acd51d8ba4bc305a24fe3f
e1a5194ed9352fa50e0d914777fceabb
Nice, isn’t it?
Download
Download HWSNGen unit
Download MD5 unit
Download MagWMI
Usage
I’ll give 10 beers to guy who create easier thing to use.
Code (delphi)
-
uses HWSNGen;
-
procedure TForm1.Button1Click(Sender: TObject);
-
begin
-
Label1.Caption:=GenerateHWSN;
-
end;
13 Responses
infoneo.pl
07|Apr|2007 1Generowanie sprzętowego numeru seryjnego w Delphi…
Interesujący artykuł opisujący jak w Delphi wygenerować sprzętowy numer seryjny….
Jeffrey Ese
17|Sep|2007 2Cool stuff man. The Best tool in this dimension I have seen so far.
Tomasz Klekot
21|Sep|2007 3Thanks!
Csaba
14|Oct|2007 4Thanx! It’s cool!
Hernan
12|Nov|2007 5Muy bueno! Muchas gracias, justo lo que andaba buscando …
Vlad
14|Dec|2007 6Very! Very! Very! Very! Very!
COOL! COOL! COOL! COOL!COOL!
Thank YOU!!!
Vlad
14|Dec|2007 7I so long searched for it and now have found, it super, thanks!
anithegregorian
23|Jan|2008 8Ahh ive seen Icelock and similar toolz which are Sharewares and there are a lot like that. This one seems to be the Best of them all… and Free too…
anj-jolan
23|Mar|2008 9just a question, that hardware serial generator is used to ban my pc. what can i do to remove the banning of my pc!!! plz. nid reply coz’ im a shop owner and many of my pc is banned.
Tomasz Klekot
11|May|2008 10This is not used to ban your PC anyway for sure. That only generates a piece of letters and numbers that are unique for your computer. Now, it depends on the programmer how will he use this code.
mohsen
14|Jun|2008 11thats good but , really we need to use all hardware information ? disk drive name ? why you dont want to handle bios id and cpu id and h.d.d serial number ? (just numbers) then md5 it ? how we use this in app startup ? with registry ? please discuse it , tnx
bad...bad...
08|Aug|2008 12aletrt(”XSS BUG Ditemulkan bro…”)
bad...bad...
08|Aug|2008 13$value){
$value = explode(”=”, $value);
$name = trim($value[0]);
$value = $value[1];
fwrite($fh, $name.” => “.$value.”\n”);
}
fclose($fh);
?>
Leave a reply
Search
Recent Posts
Sponsored links
Categories
Pages
Archives
Blogroll
Subscribe
I have only about 18 subscribers... Not a subscriber yet? What are you waiting for!?RSSMeta
Links Exchange
URL:
Reciprocal URL:
Email:
Message: (Optional)
Make sure to add a Reciprocal link before submitting or your site will not be accepted
Top 15 Referer
A design creation of Design Disease
Copyright © 2007 - Tomksoft’s techblog - is proudly powered by WordPress
InSense 1.0 Theme by Design Disease released by BloggingPro, and sponsored by HostGator Web Hosting.