Innovative Posted October 16, 2007 Share Posted October 16, 2007 Hello all, I just wanted to ask if we can password protect a COMPILED exe program on the computer? What script ? Link to comment Share on other sites More sharing options...
Xenobiologist Posted October 16, 2007 Share Posted October 16, 2007 HI, may have a look at LoginWrapper. (see my sig) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Innovative Posted October 16, 2007 Author Share Posted October 16, 2007 This cant works for me .. But cause i wanted it to password protect the file and the user can only access the compiled exe by entering the username & password but cant access from the desktop or other where else. REMEMBER , IT IS AN COMPILED EXE, so i cant edit the script Link to comment Share on other sites More sharing options...
Xenobiologist Posted October 16, 2007 Share Posted October 16, 2007 HI, if you cannot edit the exe then you need to wrap the exe with something else which does the job for you. This can be Winzip or an AutoitScript like LoginWrapper. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Innovative Posted October 16, 2007 Author Share Posted October 16, 2007 WinZip cant do the job because i wanted a script like $bLoop = 1 While $bLoop = 1 $text = InputBox("Password", "Please enter the assigned password to comfirm your identification.") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else ; They clicked OK, but did they type the right thing? If $text <> "gamingforumz#dxwnd" then MsgBox(4096, "Error", "You typed in the wrong thing - try again!") Else $bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf Wend Run("FileName.exe") WinWaitActive("BLABLA") Send("The password of the password protect file inside the winZIP") But it just cant works. And LoginWrappers cant works because the user can just access from the path and to the file. So it cant works for me in boths ways. Any other ways ? Link to comment Share on other sites More sharing options...
icadea Posted October 16, 2007 Share Posted October 16, 2007 This may help, found it in the example section titled Simple Password Script, Require Password to access/run script! expandcollapse popup#NoTrayIcon ;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Pwd Char=*123, Mandatory #cs $password = "Password001"; Password needed to access script! If Not IsDeclared("InputBoxAnswer") Then Local $InputBoxAnswer $MaxAttempts = 3 #ce If Password(3, "me") Then MsgBox(1024, "Password was correct!", "You typed the correct Password. You may access this file!"); What to do if password was entered correctly! ; do rest of stuff here ElseIf @error = 1 Then MsgBox(1024, "Password was wrong!", "Sorry, You can not access this file!"); What to do if password was not entered correctly! ; do other non-authorized attempt stuff here Exit ElseIf @error = 2 Then MsgBox(1024, "You pressed the Cancel Button!", "A Password is requuired to access this file!") ; do other Cancelled stuff here Exit ElseIf @error = 3 Then ; do inputbox failure stuff here EndIf Func Password($MaxAttempts, $Password) ;returns 1 if successfully authorized ;returns 0 if not and sets @error = 1 if not authorized, ; @error = 2 if cancelled authorization ; @error = 3 if Input box failed to open $Attempts = 0 Do $InputBoxAnswer = InputBox("Password Prompt!", "Please type in a password to access this program!", "", "*M", "-1", "-1", "-1", "-1") Select Case @error = 0;OK - The string returned is valid If $InputBoxAnswer == $Password Then Return 1 Else If $Attempts < $MaxAttempts - 1 And $MaxAttempts <> 1 Then MsgBox(1024, "Password was wrong!", "You typed the Wrong Password. You may try again " & ($MaxAttempts - 1) - $Attempts & " time(s)"); What to do if password was not entered correctly! Else SetError(1) Return 0 EndIf $Attempts += 1 ;Exit EndIf Case @error = 1;The Cancel button was pushed SetError(2) Return 0 Case @error = 3;The InputBox failed to open SetError(3) Return 0 EndSelect Until $Attempts = $MaxAttempts EndFunc ;==>Password Link to comment Share on other sites More sharing options...
Innovative Posted October 17, 2007 Author Share Posted October 17, 2007 You still dont understand what i mean.. I CANT EDIT THE SCRIPT BECAUSE THE PROGRAM WAS ALREADY COMPILED! Link to comment Share on other sites More sharing options...
BrettF Posted October 17, 2007 Share Posted October 17, 2007 Have you looked at using a third party utility then? And CAPS LOCK is considered at yelling, you yell at people, you are less likely to get help. Also, calm down a bit? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shevilie Posted October 17, 2007 Share Posted October 17, 2007 How big is the exe ??? You could make a script that would install and delete the exe.... (Though they could while running the program find the exe - but anyway they would be able to do that if you cant change the exe) Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Innovative Posted October 17, 2007 Author Share Posted October 17, 2007 Have you looked at using a third party utility then? And CAPS LOCK is considered at yelling, you yell at people, you are less likely to get help. Also, calm down a bit? Im sorry for yelling , And anyway , what do you mean by third party utility? Can you provide me with a link ?How big is the exe ??? You could make a script that would install and delete the exe.... (Though they could while running the program find the exe - but anyway they would be able to do that if you cant change the exe) The size is 260KB. How do i make a script that will install and delete the exe ? Sorry for all the troubles because im quite new to autoIT =\ Link to comment Share on other sites More sharing options...
BrettF Posted October 17, 2007 Share Posted October 17, 2007 Im sorry for yelling , And anyway , what do you mean by third party utility? Can you provide me with a link ?Look at your first reply. That should be your answer. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Innovative Posted October 17, 2007 Author Share Posted October 17, 2007 But the utility is using a program which is in the comp. And the program is not password protected so the user can just access the file through the path. Because the script i wanted to use was $bLoop = 1 While $bLoop = 1 $text = InputBox("Password", "Please enter the assigned password to comfirm your identification.") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else ; They clicked OK, but did they type the right thing? If $text <> "gamingforumz#dxwnd" then MsgBox(4096, "Error", "You typed in the wrong thing - try again!") Else $bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf Wend and if the user entered the right password , Run("FileName.rar (which is inside the RAR folder)") WinWaitActive("BLABLA") Send("The password for the password protect file inside the winZIP") Link to comment Share on other sites More sharing options...
BrettF Posted October 17, 2007 Share Posted October 17, 2007 Use TCP to send whether the program can be accesed or not to a moniter program, which includes father/son recreation. That should solve your other issue Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shevilie Posted October 17, 2007 Share Posted October 17, 2007 Im sorry for yelling , And anyway , what do you mean by third party utility? Can you provide me with a link ? The size is 260KB. How do i make a script that will install and delete the exe ? Sorry for all the troubles because im quite new to autoIT =\Installhttp://www.autoitscript.com/autoit3/docs/f...FileInstall.htmAnd for delete...http://www.autoitscript.com/autoit3/docs/f.../FileDelete.htm Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Shevilie Posted October 17, 2007 Share Posted October 17, 2007 But again IF he can spot where to you install the exe, he WILL be able to copy it to another place - hence you can't delete it. This is though not average user info. (And he could terminate your process that kills the program etc etc etc... What you want, can't be done 100 % because you can't edit the exe. Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
therks Posted October 17, 2007 Share Posted October 17, 2007 The best thing I can imagine being able to do is something like the following... $sFileNameRandom = @TempDir & '\' & Hex(Random(0, 0x7fffffff), 8) & '.txt' $sPassword = InputBox('Password Required', 'Enter Password:', '', '*') If Not @error And $sPassword = 'cookies' Then FileInstall('FileName.exe', $sFileNameRandom) RunWait($sFileNameRandom) FileDelete($sFileNameRandom) EndIf At least they're not likely to find the program to run it alone. Otherwise I'd say you're hooped. There are a lot of ways to do it if you can edit the file. Might I ask what it is exactly that you're doing? My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Innovative Posted October 17, 2007 Author Share Posted October 17, 2007 THis is my code. Could you guys kindly please tell me where to put it ? or what to edit ? expandcollapse popup; 30 Day Trial ; Author MSLx Fanboy #include<date.au3> #include<string.au3> If RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu") = "" Then RegWrite("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu", "REG_SZ", _StringEncrypt(1, _NowCalc(), @ComputerName)) SetError(0) EndIf $startdate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu"), @ComputerName) If _Datediff("D", $startdate, _NowCalc()) > 1 Then MsgBox(0, "*XPClean Menu*", "You have 19 more days till your trial expires") EndIf If _Datediff("D", $startdate, _NowCalc()) > 2 Then MsgBox(0, "*XPClean Menu*", "You have 18 more days till your trial expires") EndIf If _DateDiff("D", $startdate, _NowCalc()) > 20 Then MsgBox(0, "*XPClean Menu*", "You're registration period has expired.") Exit EndIf $bLoop = 1 While $bLoop = 1 $text = InputBox("Password", "Please enter the assigned password to comfirm your identification.") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else ; They clicked OK, but did they type the right thing? If $text <> "gamingforumz#dxwnd" then MsgBox(4096, "Error", "You typed in the wrong thing - try again!") Else $bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf Wend Link to comment Share on other sites More sharing options...
Shevilie Posted October 17, 2007 Share Posted October 17, 2007 Just add this in the end $sFileNameRandom = @TempDir & '\' & Hex(Random(0, 0x7fffffff), 8) & '.txt' FileInstall('FileName.exe', $sFileNameRandom) RunWait($sFileNameRandom) FileDelete($sFileNameRandom) Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Innovative Posted October 17, 2007 Author Share Posted October 17, 2007 But what will be the password ? Link to comment Share on other sites More sharing options...
Shevilie Posted October 17, 2007 Share Posted October 17, 2007 I wont tell you if you can't guess it - You actually provided the password in your last post... Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit 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