Page 1 of 3

Getting the System Hardware Fingerprint (XP/2003/Vista)

Posted: Mon May 07, 2007 2:59 am
by citystate
just a quick snippet...

Code: Select all

Structure HW_PROFILE_INFO
  DockInfo.l
  szHWProfileGUID.s{38}
EndStructure

getCurrentHWProfile_(hwp.HW_PROFILE_INFO)
hwGUID.s = hwp\szHWProfileGUID
MessageRequester("Info","Your Machine's FingerPrint is: "+hwGUID)

end
yeah, I know I've only used the minimum structure, but it seems to work fine. It returns a string in the format:

"{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"

The output includes the braces and hyphens. The X's appear to be simple Hex, and seem to be unique to the machine running the program (no surprising considering there are 2^256 different numbers available).
My laptop gives me the fingerprint

"{536a5cc0-645b-11d7-933e-806d6172696f}"

Once I get home, I'll test on different machines to confirm the uniqueness of the number. If anyone wants to test it out, please post your results for comparison.

Cheers,
Matt

Posted: Mon May 07, 2007 5:59 am
by rsts
Works fine under vista. Looks like a neat function.

didn't have time to copy the text string right now. Will update later.

cheers

vista business
{3d4e88c0-6a70-11db-b1ba-806e6f6e6963}

Posted: Mon May 07, 2007 8:57 am
by dige
WinXP: {9defa740-316f-11d9-9ee7-806d6172696f}

Posted: Mon May 07, 2007 10:17 am
by citystate
K - I've tested it out on a couple more machines

WinXP:
{9743fa40-f2e8-11da-9cee-806d6172696f}
{22bbe040-5f97-11db-9259-806d6172696f}

2003 Server:
{e615bcc0-49c9-11db-808d-806e6f6e6963}

with just this small sample set (thanks dige) - it looks like the last 6 bytes have something to do with the platform, I'm curious what Vista and other flavours of Windows might equate to...

Re: Getting the System Hardware Fingerprint (Windows)

Posted: Mon May 07, 2007 10:47 am
by PB
How can I make this a procedure? If I run the following, I get invalid memory
access on the ProcedureReturn line:

Code: Select all

Procedure.s HardwareFingerprint()
  Structure HW_PROFILE_INFO
    DockInfo.l
    szHWProfileGUID.s{38}
  EndStructure
  GetCurrentHwProfile_(hwp.HW_PROFILE_INFO)
  ProcedureReturn hwp\szHWProfileGUID
EndProcedure

Debug HardwareFingerprint()

Re: Getting the System Hardware Fingerprint (Windows)

Posted: Mon May 07, 2007 11:38 am
by gnozal
PB wrote:How can I make this a procedure? If I run the following, I get invalid memory
access on the ProcedureReturn line:

Code: Select all

Procedure.s HardwareFingerprint()
  Structure HW_PROFILE_INFO
    DockInfo.l
    szHWProfileGUID.s{38}
  EndStructure
  GetCurrentHwProfile_(hwp.HW_PROFILE_INFO)
  ProcedureReturn hwp\szHWProfileGUID
EndProcedure

Debug HardwareFingerprint()
The structure is wrong ...
This seems to work :

Code: Select all

;
; Get Hardware Fingerprint
;
#HW_PROFILE_GUIDLEN = $27
#MAX_PROFILE_LEN = $50

Structure HW_PROFILE_INFO 
  DockInfo.l 
  szHWProfileGUID.c[#HW_PROFILE_GUIDLEN] 
  szHwProfileName.c[#MAX_PROFILE_LEN]
EndStructure 

Procedure.s HardwareFingerprint()
  Protected hwp.HW_PROFILE_INFO
  GetCurrentHwProfile_(@hwp)
  Debug PeekS(@hwp\szHwProfileName[0]) + " -> " + PeekS(@hwp\szHWProfileGUID[0])
  ProcedureReturn PeekS(@hwp\szHWProfileGUID[0])
EndProcedure 

Debug HardwareFingerprint()
WinNT4 : {ADB18780-FC84-11DB-81B7-00A0C9E133FF}

Re: Getting the System Hardware Fingerprint (Windows)

Posted: Mon May 07, 2007 12:38 pm
by PB
Thanks gnozal! :)

Posted: Mon May 07, 2007 12:49 pm
by eJan
Thanks!
Win XP: {1d70e440-b786-11db-8634-806d6172696f}

Is it possible to make it working on Win 9x?
http://msdn2.microsoft.com/en-us/library/ms724311.aspx

Posted: Mon May 07, 2007 2:15 pm
by Derek
Winxp sp2

{27f5e540-5bbb-11db-bf11-806d6172696f}

Posted: Tue May 08, 2007 12:49 am
by citystate
eJan wrote: Is it possible to make it working on Win 9x?
http://msdn2.microsoft.com/en-us/library/ms724311.aspx
It should run on all flavours of Windows - it's a fairly standard API call
have you tried it on Win9x? what errors are you getting?

Posted: Tue May 08, 2007 1:55 am
by akj
In Windows ME, the output from the two Debug statements are:

Code: Select all

[Debug] ->
[Debug]
Thus nothing is returned by any of the PeekS() statements.

Posted: Tue May 08, 2007 2:22 am
by citystate
hmm

try this then

Code: Select all

Structure HW_PROFILE_INFO 
  DockInfo.w
  szHWProfileGUID.c[39]
  szHWProfileName.c[80] 
EndStructure 

getCurrentHWProfile_(hwp.HW_PROFILE_INFO) 
hwGUID.s = PeekS(@hwp\szHWProfileGUID[0])
MessageRequester("Info","Your Machine's FingerPrint is: "+hwGUID) 
end
sorry, I don't have anything earlier than XP so can't really test it
the only change is to the DockInfo variable type (making it a word instead of a long) It *might* work, but perhaps this function is only valid for XP onwards (if so maybe one of the Windows guru's could help out)...

Re: Getting the System Hardware Fingerprint (Windows)

Posted: Tue May 08, 2007 2:26 am
by citystate
PB wrote:How can I make this a procedure? If I run the following, I get invalid memory
access on the ProcedureReturn line:

Code: Select all

Procedure.s HardwareFingerprint()
  Structure HW_PROFILE_INFO
    DockInfo.l
    szHWProfileGUID.s{38}
  EndStructure
  GetCurrentHwProfile_(hwp.HW_PROFILE_INFO)
  ProcedureReturn hwp\szHWProfileGUID
EndProcedure

Debug HardwareFingerprint()
The main problem I can see is that you have the Structure inside the Procedure - move it outside and it should work

Posted: Tue May 08, 2007 10:35 am
by PB
> Is it possible to make it working on Win 9x?

No. MSDN for GetCurrentHwProfile states that it requires NT-based Windows.

Posted: Mon May 14, 2007 7:21 am
by GeoTrail
Vista
{0f694440-6a70-11db-8eb3-806e6f6e6963}