Jump to content



Photo

Include the script file


  • Please log in to reply
7 replies to this topic

#1 ChrisL

ChrisL

    Mass Spanner!

  • Active Members
  • PipPipPipPipPipPip
  • 1,746 posts

Posted 29 May 2006 - 07:43 AM

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, 09 June 2008 - 08:44 AM.






#2 dabus

dabus

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 405 posts

Posted 29 May 2006 - 08:09 AM

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.

#3 ChrisL

ChrisL

    Mass Spanner!

  • Active Members
  • PipPipPipPipPipPip
  • 1,746 posts

Posted 29 May 2006 - 08:25 AM

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.

#4 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 29 May 2006 - 09:00 AM

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.

#5 ChrisL

ChrisL

    Mass Spanner!

  • Active Members
  • PipPipPipPipPipPip
  • 1,746 posts

Posted 29 May 2006 - 09:08 AM

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, 29 May 2006 - 09:08 AM.


#6 bluebearr

bluebearr

    Prodigy

  • Active Members
  • PipPipPip
  • 184 posts

Posted 02 September 2006 - 01:00 PM

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.

#7 dandymcgee

dandymcgee

    Valik's #1 Fan

  • Active Members
  • PipPipPipPipPipPip
  • 812 posts

Posted 10 September 2006 - 04:31 AM

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]

#8 DirtDBaK

DirtDBaK

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 978 posts

Posted 27 November 2007 - 01:25 AM

Great Idea I really like this!

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users