hello,
i am writting a program that is will work only in my PC , so if i run that program from my pc it will work,but it will not work on any other machine,so i thinked of properties (of the pc) that are globaly unique like CPU ID, motherboard ID , chipset id ,....
is it possible to do this ? or if you have better idea please tell me.
thank you.
No betters ideas - only Data sheet (http://intel.com) (on cpuid for example)
is CPUID unique for every machine in the world?
No (http://www.intel.com/software/products/documentation/vlin/mergedprojects/analyzer_ec/mergedprojects/reference_olh/mergedprojects/instructions/instruct32_hh/vc46.htm)Â :dance:
Ossama,
I guess you are looking for something like Windows Product Activation collecting information from your computer's components.
As a first trial, how about getting the volume serial number(s) of your hard disc? I guess it's not the best idea to solve your problem but it worths to do a trial as an exercise.
Quote from: Vortex on December 12, 2007, 07:13:59 PM
I guess you are looking for something like Windows Product Activation collecting information from your computer's components.
Vortex,
I am trying to understand your question, but everyone that wants to know CPUID, motherboard ID wants to know WPA ? I dont think so. Because who knows CPUID etc. is near to know my WPA. Is it right ?
RuiLoureiro
Quote from: RuiLoureiro on December 12, 2007, 07:35:05 PM
Quote from: Vortex on December 12, 2007, 07:13:59 PM
I guess you are looking for something like Windows Product Activation collecting information from your computer's components.
Because who knows CPUID etc. is near to know my WPA. Is it right ?
RuiLoureiro
I am afraid this not a simple task. Have a look at this article :
http://en.wikipedia.org/wiki/Windows_Product_Activation
Ok, i saw it. I have no problems with anything. I bought all things i have. But i remember i tested in my computer an exemple (from Michael if i am right ) to get CPUID and i dont know what more and i had no problems. I didnt think it was to make bad things in my computer. Do you think if i want to know CPUID is it because ... ??? I think it cannot be generallized.
Its all.
Have i nice night/day
RuiLoureiro
QuoteWindows Product Activation checks eight different categories of hardware:
Display Adapter
SCSI Adapter
IDE Adapter
Network Adapter (including the MAC Address)
RAM Amount Range (e.g. 0-512 MB)
Processor Type and Serial Number
Hard Drive Device and Volume Serial Number
Optical Drive (e.g. CD-ROM)
but how can i get some property (serial number for example) from these objects (for example, how can i get the serial number of the hard disk within masm)
There are few things that will work here, each motherboard may have a different method of extracting the serial number so that would be a lot of work. CPUID has nothing unique to extract. I would look at the following key...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductID
It should be unique to your PC.
Donkey
hi donkey,
what is this key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductID
ProductID of what?
I'm thinking he mistaken a little bit, mean the key :
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductID
contains the registration number for your windows installation (you can see it under "Registered to:" in the System Properties dialog.)
It should be unique for each windows cd (i.e. if you use the same cd on two machines, they will have the same id.)
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System
has information about the bios/pci/cpu, which can be useful, but many machines will have similar sets of components, especially if they came from the same vendor.
Maybe take all of them together as one long string, then hash that to obtain an identifier.
so we cant obtain globaly unique property from ProductID and system.
QuoteMaybe take all of them together as one long string, then hash that to obtain an identifier.
Tedd, how can i make the 'hash'?
not easily nope, even microsofts one is a mix of 8 or so components
A simple way could be to XOR each byte of the string with a known byte-sequence.
Quote from: Mark Jones on December 14, 2007, 07:01:02 PM
A simple way could be to XOR each byte of the string with a known byte-sequence.
is this operation reversible?
how can i get a double word number from many multi-byte sources (windows id, pci serials,....)and the the reverse (ie,from the hash i get those properties)
sorry, i am new in hash worls :bg,
any simple examples to show how can one get a hash from NULL terminated string -for example)?
For it is need to invent one function of pseudorandom generator, for example as Galua, and XOR string by it's return value iteratively :8)
Quote from: Tedd on December 14, 2007, 01:01:49 PM
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductID
contains the registration number for your windows installation (you can see it under "Registered to:" in the System Properties dialog.)
It should be unique for each windows cd (i.e. if you use the same cd on two machines, they will have the same id.)
Actually, all the CDs are pretty much the same with the exception of a few OEM specific additions. The product ID is derived from the registration code entered during the Windows installation process and would still be unique to each machine. Of course Windows versions prior to XP could be installed multiple times with the same key and that allows for a non-unique identifier though if you are only concerned about running exclusively on your machine you control the installation key so it is not a pressing issue (unless you have an illegal copy of Windows :naughty: ), with XP and above this key can be assumed to hold a value that is globally unique to a particular system.
However, short of a hardware dongle any software based solution to this would be easily broken so it is at best only a hindrance for the casual user.
While searching for more information about COM I came across this. It's about hardware so it may be related to some of the questions here. "Windows Management Instrumentation"
http://www.masm32.com/board/index.php?topic=2594.msg20533
For cryptography reason exists key that changing from installation to installation, but it is :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid
i have read that one hash code can be derived from many diffrent sources,so if a program that will work on machine based on hash code,may run in other machine that its properties may generate the same hash,
so it will not solve the problem
See here (http://en.wikipedia.org/wiki/Hash_function) for an explanation, and here (http://www.masm32.com/board/index.php?topic=8168.msg60009#msg60009)for some sources to get you started.
Hope this helps, Ehtyar.
Quote from: ossama on December 16, 2007, 11:15:01 AM
i have read that one hash code can be derived from many diffrent sources,so if a program that will work on machine based on hash code,may run in other machine that its properties may generate the same hash,
so it will not solve the problem
How many machines do you think this will actually run on ? SHA1 would be more than adequate to reduce the possiblities of a repeated hash to nearly nothing. The odds of 2 machines generating the same hash are less than significant. If you are looking to reduce the data to a useful size then a hash is the way to go and worrying about whether the remote possibility of 2 machines generating the same hash will occur is ludicrous. Who are you writing this for the CIA ? At any rate, here's an inplementation of the Windows crypto functions for generating a hash...
GetKey FRAME pszKey,pHashKey
uses edi,esi,ebx
LOCAL dwStatus :D
LOCAL bResult :D
LOCAL hProv :D
LOCAL hHash :D
LOCAL cbRead :D
LOCAL rgbHash[64] :B
LOCAL cbHash :D
LOCAL rgbDigits[16] :B
// Generate a 16 byte SHA HASH from the key
mov [rgbDigits],"0123"
mov [rgbDigits+4],"4567"
mov [rgbDigits+8],"89ab"
mov [rgbDigits+12],"cdef"
invoke szLen,[pszKey]
test eax,eax
jz >>.ERRORCONTEXT
mov [cbRead],eax
invoke CryptAcquireContext,offset hProv,NULL,NULL,PROV_RSA_FULL,CRYPT_VERIFYCONTEXT
test eax,eax
jz >>.ERRORCONTEXT
invoke CryptCreateHash,[hProv], CALG_SHA, NULL, NULL, offset hHash
test eax,eax
jz >>.ERRORHASH
invoke CryptHashData,[hHash], [pszKey], [cbRead], NULL
test eax,eax
jz >>.ERROROTHER
// The hash is created zero the key so it doesn't sit in memory
mov edi,[pszKey]
mov ecx,[cbRead]
xor eax,eax
rep stosb
mov D[cbHash],64
invoke CryptGetHashParam,[hHash], HP_HASHVAL, offset rgbHash, offset cbHash, NULL
test eax,eax
jz >>.ERROROTHER
// convert the hash to an SHA string using a lookup table
xor eax,eax
xor edx,edx
mov ebx,[pHashKey]
mov edi,offset rgbHash
mov ecx,[cbHash]
mov esi,offset rgbDigits
:
mov al,[edi]
shr al,4
mov dl,[esi+eax]
mov [ebx],dl
inc ebx
mov al,[edi]
and al,0fh
mov dl,[esi+eax]
mov [ebx],dl
inc edi
inc ebx
dec ecx
jnz <
mov B[ebx],0
invoke CryptDestroyHash [hHash]
invoke CryptReleaseContext, [hProv], NULL
xor eax,eax
ret
.ERROROTHER
invoke CryptDestroyHash [hHash]
.ERRORHASH
invoke CryptReleaseContext, [hProv], NULL
.ERRORCONTEXT
invoke VirtualFree,[pHashKey],NULL,MEM_RELEASE
xor eax,eax
dec eax
RET
ENDF
hi donkey,forget about CIA :bg
here in algeria all we have the same windows cd key for all PCs we dont have microsoft division where we can buy a liscned copy of windows,so when i generate a hash from the windows key it will be the same in all of the PCs in algeria,
so i need other Globall Property to generate a hash from it,
thank you for the help