Home > Software engineering >  For a great god, how could you get each computer unique machine code?
For a great god, how could you get each computer unique machine code?

Time:09-16

Developed a program that want to install to every computer access to machine code, as a password to protect program, consult everybody a great god, and this method is feasible? What is your code?

CodePudding user response:

references the building Lord reply to learn makes me happy (affliction) :
developed a program that want to install to every computer access to machine code, as a password to protect program, consult everybody a great god, and this method is feasible? What is your code?

CodePudding user response:

references the building Lord reply to learn makes me happy (affliction) :
developed a program that want to install to every computer access to machine code, as a password to protect program, consult everybody a great god, and this method is feasible? What is your code?

CodePudding user response:

[machine] after the hard disk serial number format will automatically change, it's no use

CodePudding user response:

The Mac address is not to change, but not easy to obtain, the method of

CodePudding user response:

So-called machine code, you may have a CPU serial number, the hard disk serial number, etc., general protection program, use the hard disk serial number is more, a hard disk has a unique serial number, if not replace the hard disk, hard disk serial number is no change, upstairs said after format the hard disk serial number change is incorrect,
Access to hard disk serial number can use API function to obtain, obtaining, after you get the serial number, then according to the authorization of the serial number is ok,

CodePudding user response:

Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long

The Public Function GetVolumeSerialNumber (ByVal RootPath As String) As String
Dim lpszVolumeNameBuffer As String
Dim lpszFileSystemNameBuffer As String
Dim lVolumeNameSize As Long
Dim lpVolumeSerialNumber As Long
Dim lpMaximumComponentLength As Long
Dim lpFileSystemFlags As Long
Dim nFileSystemNameSize As Long
Dim lRetVal As Long
LpVolumeSerialNumber=0
LpMaximumComponentLength=0
LpFileSystemFlags=0
LpszVolumeNameBuffer=Space $(255)
LpszFileSystemNameBuffer=Space (255)
LVolumeNameSize=Len (lpszVolumeNameBuffer)
NFileSystemNameSize=Len (lpszFileSystemNameBuffer)
LRetVal=GetVolumeInformation (RootPath lpszVolumeNameBuffer, lVolumeNameSize, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpszFileSystemNameBuffer, nFileSystemNameSize)
GetVolumeSerialNumber=Hex $(lpVolumeSerialNumber)
End the Function

Try to use this code, and should be a volume of serial number, the serial number is not the only, tried on three computers, one of the two volume serial number repeat,
Ask: how hard disk serial number?

CodePudding user response:

Dim cpuSet
Dim CPU
Dim a, I
The Set cpuSet=GetObject (" winmgmts: {impersonationLevel=impersonate} "). The InstancesOf (" Win32_Processor ")

For Each CPU In cpuSet
A=(CPU. ProcessorId)
Next

Msgbox "CPU serial number is:" & amp; A

The method of CPU serial number is not the only,

CodePudding user response:

Dim DriveID As Object

Dim mySerial
The Set driveID=createObject (" Scripting. FileSystemObject ")
MySerial=DriveID. GetDrive (" C "). The SerialNumber
Msgbox mySerial

Dim PcName As String
Dim a, As the Object
Set a=createObject (" Work "Wscript.Net
PcName=a.Com putername
Msgbox Pcname

So we can get C disk serial number and computer name, computer name only, but you can change the C disk serial number is not the only, there are two computer disk C serial number,
The above methods are not,


Ask each ace grant instruction!

CodePudding user response:

Since a single hardware sequence may not be the only, that you use in a way that is accumulated, CPU + hard disk + MAC address, etc., different combination, choose a, generate a string as a serial number is

CodePudding user response:

references 9 f waaoo response:
since a single hardware sequence probably isn't the only one, that you use in a way that is accumulated, CPU + hard disk + MAC address, etc., different combination, choose a, generate a string as a serial number is

Constant + constant +=variables, the key lies in the variable, don't know if I understand right,
Or alternatively, use other ways to protect,

CodePudding user response:

references to the tenth floor response to learn makes me happy (affliction) :
Quote: references 9 f waaoo response:
since a single hardware sequence probably isn't the only one, that you use in a way that is accumulated, CPU + hard disk + MAC address, etc., different combination, choose a, generate a string as a serial number is

Constant + constant +=variables, the key lies in the variable, don't know if I understand right,
Or alternatively, use other ways to protect,


Hard drive ID, the CPU ID, MAC addresses are variable, impossible to find two identical to, so add a few more variables, come out of the variables, the result is certainly different, do not have to worry aboutnullnullnullnullnullnullnullnull
  • Related