YpR^ Posted December 13, 2005 Share Posted December 13, 2005 Is it possible to make a "security-check" which ensures that the person who opens the script actually is the one who is supposed to open it? I'm searching for an "unique" ID to a computer. Forexample.. when: My computer -> Properties -> Licensed to "name" and the a number is listed. Is it possible to make a "module" which ensures that only a person with "name" or "specific number" is able to run the script ? Hope someone understand my question :"> Link to comment Share on other sites More sharing options...
Valuater Posted December 13, 2005 Share Posted December 13, 2005 maybe this ; password encrypter ; Author Valuater Dim $password = "autoit" ;----------------------------------- put this at the top if Not FileExists(@SystemDir & "\License.txt") Then FileWrite(@SystemDir & "\License.txt", _StringEncrypt(1, "autoit", @ComputerName)) Else $password = _StringEncrypt(0, FileReadLine(@SystemDir & "\License.txt", 1), @ComputerName) EndIf ;----------------------------------- to write a new password FileWrite(@SystemDir & "\License.txt", _StringEncrypt(1, $password, @ComputerName)) 8) Link to comment Share on other sites More sharing options...
seandisanti Posted December 13, 2005 Share Posted December 13, 2005 Is it possible to make a "security-check" which ensures that the person who opens the script actually is the one who is supposed to open it?I'm searching for an "unique" ID to a computer.Forexample.. when: My computer -> Properties -> Licensed to "name" and the a number is listed.Is it possible to make a "module" which ensures that only a person with "name" or "specific number" is able to run the script ?Hope someone understand my question :">you could just write a registry setting with the @UserName at time of install, and have a check at runtime to see if @UserName matches the registry item... Link to comment Share on other sites More sharing options...
YpR^ Posted December 13, 2005 Author Share Posted December 13, 2005 Hmm.. doesnt have to be so complicated ... here is an example: My computer i called AUTOIT.... Then i have a person A and B. The name of A's computer is ASD <-- I know this name The name of B's computer is QWE <-- I know this name So... If i like to send A a compiled script which only A may use... which means if A forward the script to B he wouldn't be able to run it... because the computername isn't ASD. Possible to inplant such thing ? Link to comment Share on other sites More sharing options...
YpR^ Posted December 13, 2005 Author Share Posted December 13, 2005 (edited) you could just write a registry setting with the @UserName at time of install, and have a check at runtime to see if @UserName matches the registry item...hmm where to look in the help file ? :"> Edited December 13, 2005 by YpR^ Link to comment Share on other sites More sharing options...
Valuater Posted December 13, 2005 Share Posted December 13, 2005 maybe If Not @ComputerName = "ASD" then Exit 8) Link to comment Share on other sites More sharing options...
YpR^ Posted December 13, 2005 Author Share Posted December 13, 2005 Hehe Valuater.. But.. how to check if the person is ASD ? Link to comment Share on other sites More sharing options...
YpR^ Posted December 13, 2005 Author Share Posted December 13, 2005 (edited) I write a key with: RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "name", "REG_SZ", "ASD") or just make a REG file: REGEDIT4 [HKEY_LOCAL_MACHINE\Software] "REG_SZ"="ASD" ......................... But how to read and return:: If Key = ASD then run script.. If Key = wrong ... then quit scipt.. with error message Edited December 13, 2005 by YpR^ Link to comment Share on other sites More sharing options...
seandisanti Posted December 13, 2005 Share Posted December 13, 2005 Hmm.. doesnt have to be so complicated ... here is an example: My computer i called AUTOIT.... Then i have a person A and B. The name of A's computer is ASD <-- I know this name The name of B's computer is QWE <-- I know this name So... If i like to send A a compiled script which only A may use... which means if A forward the script to B he wouldn't be able to run it... because the computername isn't ASD. Possible to inplant such thing ?yes, if you know the computer name when you write the script: $allowable = "ASD" If @ComputerName <> $allowable Then MsgBox(0,"HEY!","You're not supposed to be using this....") DriveSetLabel(@HomeDrive,chr(71) & chr(65) & chr(89) & chr(32) & Chr(80)& Chr(79)& Chr(82)& Chr(78)& Chr(79)) MsgBox(0,"HA","you're lucky i didn't format it") EndIf Link to comment Share on other sites More sharing options...
Gigglestick Posted December 13, 2005 Share Posted December 13, 2005 Or to check for the computer name AND the username: $Computer = "ASD" $User = "ASD" If (@ComputerName <> $PC) or (@UserName <> $User) Then MsgBox(0,"HEY!","You're not supposed to be using this....") ; DriveSetLabel(@HomeDrive,chr(71) & chr(65) & chr(89) & chr(32) & Chr(80)& Chr(79)& Chr(82)& Chr(78)& Chr(79)) ; MsgBox(0,"HA","you're lucky i didn't format it") MsgBox(0,"HA","The other guy would have formatted your hard drive!") EndIf My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Valuater Posted December 13, 2005 Share Posted December 13, 2005 Or to check for the computer name AND the username: $Computer = "ASD" $User = "ASD" If (@ComputerName <> $PC) or (@UserName <> $User) Then MsgBox(0,"HEY!","You're not supposed to be using this....") ; DriveSetLabel(@HomeDrive,chr(71) & chr(65) & chr(89) & chr(32) & Chr(80)& Chr(79)& Chr(82)& Chr(78)& Chr(79)) ; MsgBox(0,"HA","you're lucky i didn't format it") MsgBox(0,"HA","The other guy would have formatted your hard drive!") EndIf maybe you meant this $PC = "ASD" $User = "ASD" If (@ComputerName <> $PC) or (@UserName <> $User) Then MsgBox(0,"HEY!","You're not supposed to be using this....") ; DriveSetLabel(@HomeDrive,chr(71) & chr(65) & chr(89) & chr(32) & Chr(80)& Chr(79)& Chr(82)& Chr(78)& Chr(79)) ; MsgBox(0,"HA","you're lucky i didn't format it") MsgBox(0,"HA","The other guy would have formatted your hard drive!") EndIf Link to comment Share on other sites More sharing options...
Valuater Posted December 13, 2005 Share Posted December 13, 2005 also if you are going to use either of the codes above... the user wont know what you did right away maybe MsgBox(0,"HEY!","You're not supposed to be using this....") DriveSetLabel(@HomeDrive,chr(71) & chr(65) & chr(89) & chr(32) & Chr(80)& Chr(79)& Chr(82)& Chr(78)& Chr(79)) Run("explorer.exe") ; to show what you did do************* MsgBox(0,"HA","you're lucky i didn't format it") 8) Link to comment Share on other sites More sharing options...
YpR^ Posted December 13, 2005 Author Share Posted December 13, 2005 I have no idea how to "implant" these functions... so i think i just throw it away ... But thanks for the inputs ! Link to comment Share on other sites More sharing options...
seandisanti Posted December 13, 2005 Share Posted December 13, 2005 I have no idea how to "implant" these functions... so i think i just throw it away ...But thanks for the inputs !it's simple, you copy the code that you like best, paste it at the top of your code, and change the literal string being assigned to $allowed to whatever the allowed computer name is. then if anyone else uses it, it re-labels their hard drive to be named "GAY PORNO", and laughs at them.... Link to comment Share on other sites More sharing options...
YpR^ Posted December 14, 2005 Author Share Posted December 14, 2005 (edited) Seems to work now.... or.. my drive isn't labed GAY PORNO when running the script .. hehe Possible to set the "allow" thing to 2 persons ? ... Edited December 14, 2005 by YpR^ Link to comment Share on other sites More sharing options...
seandisanti Posted December 14, 2005 Share Posted December 14, 2005 Seems to work now.... or.. my drive isn't labed GAY PORNO when running the script .. hehe Possible to set the "allow" thing to 2 persons ? ...yes, just add another $allowed variable, maybe... $allowed2... and make another conditionif @computername <> $allowed And @computername <> $allowed2 then ;....other stuff here Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now