testingtest Posted March 31, 2007 Share Posted March 31, 2007 (edited) well this is all i could get done so far please if you want try and finish it if not ill do it tomorrow... what it allows you to do is this - enter a password - you select a file to protect - it will create a new .au3 file compile it with the selected file you picked - when someone now opens that file a inputbox will pop up asking for a password i know its a rough code it was only for testing and still is unless you guys like the idea expandcollapse popup#include <GUIConstants.au3> Global $file , $pass $GUI = GUICreate("test", 236, 143, 310, 249) $pass = GUICtrlCreateInput("password", 0, 22, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $pass2 = GUICtrlCreateInput("password", 0, 80, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("&OK", 78, 112, 75, 25, 0) $Button2 = GUICtrlCreateButton("&Cancel", 159, 112, 75, 25, 0) $Label1 = GUICtrlCreateLabel("Enter password", 0, 2, 77, 17) $Label1 = GUICtrlCreateLabel("Re-type password", 0, 60, 89, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If GUICtrlRead($pass) = GUICtrlRead($pass2) Then $file = FileOpenDialog("choose a file" , @ScriptDir , "all files (*.*)") If Not $file = "" Then _protect() Else MsgBox(0 , "" , "error passwords don't match") EndIf Case $Button2 Exit EndSwitch WEnd Func _protect() $write = '' $write &= GUICtrlRead($file) $write &= GUICtrlRead($pass) & @CRLF $write &= 'If Not @Compiled Then' & @CRLF $write &= 'Exit' & @CRLF $write &= 'else' & @CRLF $write &= '$pass2 = InputBox("Enter the password" , "you must enter a password to acess this file" , "password" , "*")' & @CRLF $write &= 'If $pass = $pass2 Then $write &= 'FileInstall($file , @ScriptDir)' $write &= 'else' $write &= 'MsgBox(0 , "" , "Error wrong password was entered")' $write &= 'exit' $write &= 'endif' $CompileFile = "NewFile.au3" FileWrite($CompileFile , $write) Run("C:\TEMP\aut2exe.exe /in "& $CompileFile &" /out C:\YourFile.exe /icon C:\TEMP\defaulticon.ico /comp 4 /pass " & GUICtrlRead($pass)") EndFunc might want to add some more @crlfs Edited March 31, 2007 by testingtest Link to comment Share on other sites More sharing options...
Skrip Posted April 1, 2007 Share Posted April 1, 2007 Does is work for .exes? [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
testingtest Posted April 1, 2007 Author Share Posted April 1, 2007 Does is work for .exes?it will once i fix finish it. the coding looks bad becuase i wrote it at 3 in the morning and was tired it will compile the autoit file into a exe and add the file you select in the the autoit exe and if the password is not correct extract the file and run it Link to comment Share on other sites More sharing options...
Pascal257 Posted April 1, 2007 Share Posted April 1, 2007 (edited) that should fix the _protect func: expandcollapse popup#include <GUIConstants.au3> Global $file , $pass $GUI = GUICreate("test", 236, 143, 310, 249) $pass = GUICtrlCreateInput("password", 0, 22, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $pass2 = GUICtrlCreateInput("password", 0, 80, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("&OK", 78, 112, 75, 25, 0) $Button2 = GUICtrlCreateButton("&Cancel", 159, 112, 75, 25, 0) $Label1 = GUICtrlCreateLabel("Enter password", 0, 2, 77, 17) $Label2 = GUICtrlCreateLabel("Re-type password", 0, 60, 89, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If GUICtrlRead($pass) = GUICtrlRead($pass2) Then $file = FileOpenDialog("choose a file" , @ScriptDir , "all files (*.*)") If Not $file = "" Then _protect() Else MsgBox(0 , "" , "error passwords don't match") EndIf Case $Button2 Exit EndSwitch WEnd Func _protect() $write = '' & @CRLF $write &= ';File: ' & GUICtrlRead($file) & @CRLF $write &= '$pass = ' & GUICtrlRead($pass) & @CRLF $write &= 'If Not @Compiled Then' & @CRLF $write &= 'Exit' & @CRLF $write &= 'else' & @CRLF $write &= '$pass2 = InputBox("Enter the password" , "you must enter a password to acess this file" , "password" , "*")' & @CRLF $write &= 'If $pass = $pass2 Then'& @CRLF $write &= 'FileInstall($file , @ScriptDir)'& @CRLF $write &= 'else'& @CRLF $write &= 'MsgBox(0 , "" , "Error wrong password was entered")'& @CRLF $write &= 'exit'& @CRLF $write &= 'endif'& @CRLF $CompileFile = "NewFile.au3" FileWrite($CompileFile , $write) Run("C:\TEMP\aut2exe.exe /in "& $CompileFile &" /out C:\YourFile.exe /icon C:\TEMP\defaulticon.ico /comp 4 /pass " & GUICtrlRead($pass)") ;; should be changed EndFunc btw I like the idea ^^ Edited April 1, 2007 by Pascal257 Link to comment Share on other sites More sharing options...
testingtest Posted April 1, 2007 Author Share Posted April 1, 2007 i am still going to have to finish this script ill post it when im done but might take a bit i started playing wow lol Link to comment Share on other sites More sharing options...
Pascal257 Posted April 1, 2007 Share Posted April 1, 2007 i am still going to have to finish this script ill post it when im done but might take a bit i started playing wow lol[off-topic] WoW sucks ^^ Play Vanguard... its that better[/off-topic] I'd like to see your script finished ^^ Link to comment Share on other sites More sharing options...
Maxtreeme Posted April 1, 2007 Share Posted April 1, 2007 Cool! How on earth can you ppl come up with ideas like this? I only managed to do stupid scripts Link to comment Share on other sites More sharing options...
GEOSoft Posted April 1, 2007 Share Posted April 1, 2007 Cool! How on earth can you ppl come up with ideas like this? I only managed to do stupid scripts It's a known fact the the most difficult problem a developer faces is finding an original idea.Most ideas have already been done by someone in some languge so all you do is find a way to build a better mousetrap or convert someone else idea to work using a different language. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
jvanegmond Posted April 1, 2007 Share Posted April 1, 2007 It's a known fact the the most difficult problem a developer faces is finding an original idea.Most ideas have already been done by someone in some languge so all you do is find a way to build a better mousetrap or convert someone else idea to work using a different language.I am full of original ideas.. They're just not very good ones.. I just noticed my spell checker is off... Seems like I have been babbling all day.. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Maxtreeme Posted April 1, 2007 Share Posted April 1, 2007 ...so all you do is find a way to build a better mousetrap or convert someone else idea to work using a different language.i like the "mousetrap" part i have some scripts, but i can't post them... not yet.btw this is a nice script, i have some files, that i can use it on Link to comment Share on other sites More sharing options...
testingtest Posted April 1, 2007 Author Share Posted April 1, 2007 (edited) more or less the script above only generates this file $pass2 = "password" $pass = InputBox("Enter password" , "Enter password" , "password" , "*" , 200 , 50 , 0 , 0) If $pass = $pass2 Then _install() Else MsgBox(16 , "Error" , "you have enter the wrong password now exiting...") Exit EndIf While 1 Sleep(500) WEnd Func _install() FileInstall("yourfile.exe" , "c:\yourfile.exe") RunWait(@ComSpec & " /c c:\yourfile.exe" , "" , @SW_HIDE) ProcessClose("CMD.exe") EndFunc it will also encrypt the passwords... now if there was only a faster way to run the exe after you enter the password if you got a better way of securing the password be my guess although its mean't to only keep busy bodys out of your files i think i could go white and nerdy and make it encrypt with a lot of things so in order to decrypt it would take some thinking and math skill it would include the encrypt function some hex some binary a tiny bit of array i stick with WoW for now as well Edited April 1, 2007 by testingtest 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