Sign in to follow this  
Followers 0
ChrisL

Include the script file

8 posts in this topic

#1 ·  Posted (edited)

I know that you can use the decompiler but if you wanted to include the script file as a safe guard then put this at the top of your script.

Replace "Put the name of the au3 file here.au3" with your file name and add a password in to the password variable.

To recover the script, launch your exe with the command line "recover", so either create a shortcut with the recover parameter or from the command prompt "Myfile.exe recover" you will then be prompted for the password, if they match then the au3 file will be written to your current script directory.

For ease of use you could add it to your template.au3 file in your "C:\Documents and Settings\UserName\Templates" directory

Update: based on dabus' version which is less work, well done!

$password = "MyPassword"
If $CMDLINE [0] > 0 and $CMDLINE [1] = "recover" Then
    $check = InputBox ("Recover", "Password?","", "*")
    If $Check = $password then 
        FileInstall ("Put the name of the au3 file here.au3", StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ) 
        MsgBox (0,"Output File",StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ,5)
    Else 
        MsgBox (0,"Error","Incorrect password" ,5)
    EndIf
Exit
EndIf
; Script Start - Add your code below here
Edited by ChrisL

Share this post


Link to post
Share on other sites



Why don't you do

$password = "MyPassword"
If $CMDLINE [1] = "recover" Then
    $check = InputBox ("Recover", "Password?","", "*")
    If $Check = $password then FileInstall ("Put the name of the au3 file here.au3", StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ) 
Exit
EndIf

?

First steps seem to be quit useless to me.

Share this post


Link to post
Share on other sites

First steps seem to be quit useless to me.

No, the first part includes the file in the compiled exe at compile time.

The second part allows you to recover the script from compile time with a password from the exe.

Share this post


Link to post
Share on other sites

Why don't you do

?

First steps seem to be quit useless to me.

Yes i have tried yours and it works. The compiler adds all files ignoring conditions. But it only extracts them if the condition surrounding them is true


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yes appologies dabus you are correct.

$password = "MyPassword"
If $CMDLINE [0] > 0 and $CMDLINE [1] = "recover" Then
    $check = InputBox ("Recover", "Password?","", "*")
    If $Check = $password then 
        FileInstall ("Put the name of the au3 file here.au3", StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ) 
        MsgBox (0,"Output File",StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ,5)
    Else 
        MsgBox (0,"Error","Incorrect password" ,5)
    EndIf
Exit
EndIf
; Script Start - Add your code below here
Edited by ChrisL

Share this post


Link to post
Share on other sites

I usually just do this:

If StringInStr($cmdlineRaw, "/MySecretRecoverSwitch") Then
    ; Recover the source
    FileInstall("Source.au3", @TempDir & "\Source.au3", 1)
EndIf

BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites

for even more enhanced security you could always change $CMDLINE [1] = "recover" . Just change "recover" to something harder to guess, and then it'll be kind of double passworded. Just an idea :)


- Dan [Website]

Share this post


Link to post
Share on other sites

Great Idea I really like this!


[center][/center]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0