AutoHotkey Community

It is currently May 26th, 2012, 2:57 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: September 3rd, 2007, 5:31 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Quote:
The processor ID, description info is better (and you can get it in AHK without any external tool)


where is there an explanation of how to get this? do you mean with dllcalls? and if so could you give me an example?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2007, 6:07 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
You gave the link: http://grafi.ii.pw.edu.pl/gbm/x86/cpuid.html. Write a few lines of C code, with the inlined assembler instruction 0fh 0a2h, compile it and include in your AHK script its hex version, as described here. (I will be traveling for the next two weeks, so I can only do it after I return, if nobody does it before.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2007, 8:57 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
I'm confused. I got that disassembler, and got geared up, but then which dllcall should i be using from that link? in order to get the machine code?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2007, 1:12 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
This is what I meant (written just before takeoff):
Code:
MCode(ByRef code, hex) { ; allocate memory and write Machine Code there
   VarSetCapacity(code,StrLen(hex)//2)
   Loop % StrLen(hex)//2
      NumPut("0x" . SubStr(hex,2*A_Index-1,2), code, A_Index-1, "Char")
}

MCode(CPUID,"538b4424080fa2508b44241489188b44241889088b44241c89105b8b44240c89185bc3")

VarSetCapacity(a,4,0), VarSetCapacity(b,4,0), VarSetCapacity(c,4,0), VarSetCapacity(d,4,0)
dllcall(&CPUID,"UInt",0, "Str",a, "Str",b, "Str",c, "Str",d, "CDECL")
s = A = 0: %b%%d%%c%`n

SetFormat Integer, Hex
VarSetCapacity(a,4,0), VarSetCapacity(b,4,0), VarSetCapacity(c,4,0), VarSetCapacity(d,4,0)
dllcall(&CPUID,"UInt",1, "Uint*",a, "UInt*",b, "UInt*",c, "UInt*",d, "CDECL")
s = %s%A = 1: %a% %b% %c% %d%`n

VarSetCapacity(a,4,0), VarSetCapacity(b,4,0), VarSetCapacity(c,4,0), VarSetCapacity(d,4,0)
dllcall(&CPUID,"UInt",2, "Uint*",a, "UInt*",b, "UInt*",c, "UInt*",d, "CDECL")
s = %s%A = 2: %a% %b% %c% %d%`n

VarSetCapacity(a,4,0), VarSetCapacity(b,4,0), VarSetCapacity(c,4,0), VarSetCapacity(d,4,0)
dllcall(&CPUID,"UInt",3, "Uint*",a, "UInt*",b, "UInt*",c, "UInt*",d, "CDECL")
s = %s%A = 3: %a% %b% %c% %d%`n

MsgBox %s%


The CPUID machine code function was compiled by VS'05 and converted to hex stream. Its source code is (with the appropriate typedef for uint):
Code:
typedef unsigned long uint;

void CPUID(uint x, uint* a, uint* b, uint* c, uint* d) { // x=select, [a,b,c,d]=result
   __asm {
      mov eax, x
      cpuid
      push eax
      mov eax, DWORD PTR [b]
      mov DWORD PTR [eax], ebx
      mov eax, DWORD PTR [c]
      mov DWORD PTR [eax], ecx
      mov eax, DWORD PTR [d]
      mov DWORD PTR [eax], edx
      pop ebx
      mov eax, DWORD PTR [a]
      mov DWORD PTR [eax], ebx
   }
}

If the result is not string, use "UInt32*" in place of "Str" in the dllcall, which, in fact, does not call any dll, but the machine code function put in the CPUID AHK variable by the MCode function.

See the cited http://grafi.ii.pw.edu.pl/gbm/x86/cpuid.html for other information returned by CPUID at different first parameters.

Edit 20071023: The above url seems to be dead. Use http://en.wikipedia.org/wiki/CPUID instead.
Edit 20071030: The register EAX is also returned (before EBX, ECX and EDX)


Last edited by Laszlo on October 30th, 2007, 5:55 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2007, 1:45 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Most of the information on your CPU you can also be found in the registry (HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor\0), see Mustang's post but that could be edited or the access to the registry be intercepted. Using the CPUID command directly is more secure.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2007, 9:43 am 
what is unique hardware id ??


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2007, 1:19 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
rookies wrote:
what is unique hardware id ??

Some software providers generate a registration key for their software that will only work on your specific computer.
If you take this registration key to another computer it will not work.

They way do it, is to generate the key not only based on your username / email address, but to also use some parameters that identify your computer.

It can be anything really - serial numbers of specific hardware pieces, volume serial numbers of your hard drives, environment variables that are different from one computer to another (although not really considered "hardware" id) and so on.

They mix it all together plus your name and emil address, and generate akey based on this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2007, 11:38 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
I dont understand it Laszlo. I want to try to gain more useful information about the cpu, but I just cant understand how to do it


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2007, 7:39 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Set the first parameter to:
Code:
0: Get vendor ID
1: Processor Info and Feature Bits
2: Cache and TLB Descriptor Info
3: Processor Serial Number
0x80000000: Get Highest Extended Function Supported
0x80000001: Extended Processor Info and Feature Bits
0x80000002,0x80000003,0x80000004: Processor Brand String

For eaxample, Feature Bits
Code:
SetFormat Integer, Hex
dllcall(&CPUID,"UInt",1, "UInt*",a, "UInt*",b, "UInt*",c, "UInt*",d, "CDECL")
MsgBox %a%  %b%  %c%  %d%


Edit 20071030: added extra parameter "a", to match the last version of CPUID


Last edited by Laszlo on October 30th, 2007, 5:58 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2007, 5:25 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Updated CPUID, such that the register EAX is also returned (before EBX, ECX and EDX).


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 23rd, 2008, 11:12 am 
HardwareID DLL is reliable API to generate unique simplified ID to identify each computer. You can use this ID to lock each license just by machine with your existing license copy protection. Now you can prevent unauthorized installation or coping and increase your sales.

Key Features of AzSDK HardwareID:
*Support .NET and Win32 application.
*Support generate unique simplified ID to identify each computer and yours each programs.
*support many development languages, such as Delphi, C++Builder, VC, C#, VB, VB.NET, PowerBuilder, Visual Foxpro, Clarion ect.
*Hardware ID is affordable and reliable API than dongle price and easy to use.
*Hardware ID is a simplified ID so that anyone can communicate by phone, fax or email.
*No delay time to delivery your software, no need to send anything by post.
*Supports Windows 9x/Me/NT/2000/XP/2003/Vista 32bit.

For more information, Please visit http://www.azsdk.com/hardwareid.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 23rd, 2008, 11:26 am 
Offline

Joined: February 18th, 2008, 8:26 pm
Posts: 442
It reads like you are advertising hingman, are you the author of the tool you have just described? Nearly every type of hardware ID mentioned is easily available in the registry or via other system commands/API i.e. run ipconfig /all to get local MAC address. Users on this forum have also posted 100% AutoHotkey script code for UUIDs so you don't need to resort to risky machine code or third party shareware.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 5:09 am 
Offline

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
Laszlo wrote:
Updated CPUID, such that the register EAX is also returned (before EBX, ECX and EDX).


Laszlo, I am wondering if you know how to adapt this, so it works on newer 64-bit machines?

http://www.autohotkey.com/forum/viewtop ... highlight=


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 5:39 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
I don’t have access to 64-bit Windows. The CPU instructions should still work, but Windows might prevent the function from running properly.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 6:57 pm 
Offline

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
I am wondering, does anyone get data back from

3: Processor Serial Number

Tested on 32-Bit Intel: Nothing :|
Tested on 64-Bit AMD: Nothing :|

... just curious what this result is supposed to look like, or supposed to be some kinda hybrid cpu that would carry this information :?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], G. Sperotto, Google Feedfetcher, patgenn123 and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group