AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: January 31st, 2009, 11:59 pm 
Offline

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
Hello, is there a way to get into a variable form, the identificaltion number of the CPU processor? I am researching alternative methods for better software license creations for school, and a CPUID seems like the most reliable and stable number. I cannot fathom of any other number that cannot easily be changed.


Does anyone know if there is a built in windows command to get this information? :) Thank you so much. Sarah.^%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 10:10 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5478
Location: the tunnel(?=light)
Is this what you might be looking for?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 7:22 pm 
Offline

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
Hi Sinkfaze, you know, I found that example before posting... but I was not able to get any data back. Running this function (re-pasted below), generates this back:

A = 0:
A = 1: 0x0 0x0 0x0 0x0
A = 2: 0x0 0x0 0x0 0x0
A = 3: 0x0 0x0 0x0 0x0

I am running Windows 64 bit BTW ... so I don't know if this why or how to adapt the function.

Does it work for you? :)

Code:

; courtesy of Laszlo

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%



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 7:33 pm 
it does work in window7 32bit
Image


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

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
That is remarkable!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], G. Sperotto, Google Feedfetcher, patgenn123, Yahoo [Bot] and 21 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