Jump to content

Recommended Posts

Posted

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 :">

Posted

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)

NEWHeader1.png

Posted

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...

Posted

Hmm.. doesnt have to be so complicated :P... 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 ?

Posted (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 by YpR^
Posted (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 :P

Edited by YpR^
Posted

Hmm.. doesnt have to be so complicated :P... 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
Posted

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

Posted

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

NEWHeader1.png

Posted

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)

NEWHeader1.png

Posted

I have no idea how to "implant" these functions... so i think i just throw it away :P ...

But thanks for the inputs !

Posted

I have no idea how to "implant" these functions... so i think i just throw it away :P ...

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....
Posted (edited)

Seems to work now.... or.. my drive isn't labed GAY PORNO when running the script :P .. hehe

Possible to set the "allow" thing to 2 persons ? ...

Edited by YpR^
Posted

Seems to work now.... or.. my drive isn't labed GAY PORNO when running the script :P .. hehe

Possible to set the "allow" thing to 2 persons ? ...

yes, just add another $allowed variable, maybe... $allowed2... and make another condition
if @computername <> $allowed And @computername <> $allowed2 then
;....other stuff here

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...