Recent

Author Topic: how to get unique hardware serial number with lazarus?  (Read 20813 times)

gajahbengkak

  • New Member
  • *
  • Posts: 13
  • this is me, mine, myself
    • Catatan Si Arief
how to get unique hardware serial number with lazarus?
« on: November 17, 2009, 09:32:23 am »
Hello,

Does anyone here know how to get unique hardware serial number with lazarus.

I need it for my thesis, it is about software distribution security system.

Best regards,
gajahbengkak

EMTR

  • New Member
  • *
  • Posts: 20
Re: how to get unique hardware serial number with lazarus?
« Reply #1 on: November 18, 2009, 06:04:53 pm »
Since nobody has answered I will...

Far as I know there isn't a unique hardware ID function in Free Pascal or Delphi. Most likely you'll need to get a Windows function (or Mac or Linux) to provide you with a given value? If a given hardware / configuration ID exists? Your after something like this in Windows I think... http://msdn.microsoft.com/en-us/library/dd567933.aspx. Otherwise I'd look at MSDN as a starting point to find unique IDs for devices hard disks, cpu, etc.


Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: how to get unique hardware serial number with lazarus?
« Reply #2 on: November 18, 2009, 09:24:34 pm »
Hi,

I've found some code for hardware http://www.soft.tahionic.com/download-hdd_id/free-download/app-source-code.html or you can use TRegistry to access for example Windows registry where (I believe) are also stored some info like Windows S/N or reg. key, which maybe will be also useful for you.
Don't  forget add unit Registry to "uses".
B.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

gajahbengkak

  • New Member
  • *
  • Posts: 13
  • this is me, mine, myself
    • Catatan Si Arief
Re: how to get unique hardware serial number with lazarus?
« Reply #3 on: November 19, 2009, 03:50:32 am »
thx all, i will study it now.

but i don't want to use windows product key cause there are many illegal windows installations that use only one key here in indonesia.

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: how to get unique hardware serial number with lazarus?
« Reply #4 on: November 19, 2009, 12:35:37 pm »
Maybe you can use the MAC address of the network card. But there isn't any safe data to identify hardware. Even the MAC address can be changed by user but with some effort and knowledge.
Lazarus 1.7 (SVN) FPC 3.0.0

clauslack

  • Sr. Member
  • ****
  • Posts: 275
Re: how to get unique hardware serial number with lazarus?
« Reply #5 on: November 19, 2009, 12:47:34 pm »
1. You can check the processor serial number(intel) I don't from other processors.
Check
http://www.intel.com/design/PentiumIII/applnots/245125.htm

2. Or you can do a checksum with the CPU ID+RAM+Other, I think that cpuid is in all pentium class processor, even AMD.

But the hardware can change (cpu, network card, ram, disk), so is hard use this as "primary key"

Regards.


TurboRascal

  • Hero Member
  • *****
  • Posts: 672
  • "Good sysadmin. Bad programmer."™
Re: how to get unique hardware serial number with lazarus?
« Reply #6 on: November 19, 2009, 04:37:28 pm »
The most common method is to extract serial numbers from M/B, HDD and possibly other main system components. As clauslack said, CPU can also be used, but I believe only the second method is actually feasible - I know P-III were the first CPUs to have a serial number, but people weren't delighted with the idea, so very soon MBO/BIOS manufacturers offered an option to disable access to that number, and it's always activated by default. I'm not sure if later Intel CPUs (P4, Core...) have access to the S/N, and I believe AMD never had that "feature".

Also, getting CPUID is not hard. Getting the S/N's of other hardware could be a bit harder though, but I believe at least MBO S/N is provided by ACPI.

Concerning changes in hardware, there are some software systems which are tolerant to some HW changes, an example being the winxp activation. I'm not sure how it is done, but I'd do it by providing several hashes something like:

Code: [Select]

Hash1 := HashFunc ( MBOSN + HDDSN );
Hash2 := HashFunc ( MBOSN + CPUID );
Hash3 := HashFunc ( HDDSN + CPUID );
In this example we monitor three key components and have the same number of hashes. So you record all three hashes, and if only one of the key components change, at least one hash remains correct. Changing more than one key component invalidates all hashes.

There are likely better algorithms, but I hope illustrates what I meant. Also this can be adjusted to the number of components you wish to allow to get changed.
Regards, ArNy the Turbo Rascal
-
"The secret is to give them what they need, not what they want." - Scotty, STTNG:Relics

gajahbengkak

  • New Member
  • *
  • Posts: 13
  • this is me, mine, myself
    • Catatan Si Arief
Re: how to get unique hardware serial number with lazarus?
« Reply #7 on: November 23, 2009, 09:43:25 am »
thanks all i will study it...

Forest

  • New Member
  • *
  • Posts: 16
Re: how to get unique hardware serial number with lazarus?
« Reply #8 on: November 23, 2009, 10:20:00 am »
thanks all i will study it...

get turbopower onguard ported to Lazarus and you will find in svn version ability to read HDD serial number for key generation

 

TinyPortal © 2005-2018