Sign in to follow this  
Followers 0
marcovich

Compile From Array?

11 posts in this topic

Is possible to compile a script stored in an array within another compiled autoit script?

That means, without writing out to a au3 file first

Share this post


Link to post
Share on other sites



Is possible to compile a script stored in an array within another compiled autoit script?

That means, without writing out to a au3 file first

I would assume so,

But i think you would have to edit the script with the array to make it's array contain "name of script.exe" as opposed to "name of script.au3"

Share this post


Link to post
Share on other sites

I would assume so,

But i think you would have to edit the script with the array to make it's array contain "name of script.exe" as opposed to "name of script.au3"

Thanks for your answer. May be the next code example clarify what I am trying:

$dim $arrlines[5]

$arrlines[0]='; this is to be compiled at run time'
$arrlines[1]='$a="hello"'
$arrlines[2]='$username=InputBox("","type your name")'
$arrlines[3]='MsgBox(0,"",$a & " " & $username)'
$arrlines[4]='Exit'

Run(@ComSpec & " /c " & 'aut2exe.exe /in ' & [color=#FF0000]$arrlines [/color] & ' /out "' & @ProgramFilesDir & '\hello.au3"', "", @SW_HIDE)

the problem is that " /in" parameter for aut2exe has to be a file, but for security I would prefer not to write the source code to any file.

Share this post


Link to post
Share on other sites

Thanks for your answer. May be the next code example clarify what I am trying:

$dim $arrlines[5]

$arrlines[0]='; this is to be compiled at run time'
$arrlines[1]='$a="hello"'
$arrlines[2]='$username=InputBox("","type your name")'
$arrlines[3]='MsgBox(0,"",$a & " " & $username)'
$arrlines[4]='Exit'

Run(@ComSpec & " /c " & 'aut2exe.exe /in ' & [color=#FF0000]$arrlines [/color] & ' /out "' & @ProgramFilesDir & '\hello.au3"', "", @SW_HIDE)

the problem is that " /in" parameter for aut2exe has to be a file, but for security I would prefer not to write the source code to any file.

Sorry, I didn't know that font color doesn´t show for a code segment. This is the right code:

$dim $arrlines[5]

$arrlines[0]='; this is to be compiled at run time'
$arrlines[1]='$a="hello"'
$arrlines[2]='$username=InputBox("","type your name")'
$arrlines[3]='MsgBox(0,"",$a & " " & $username)'
$arrlines[4]='Exit'

Run(@ComSpec & " /c " & 'aut2exe.exe /in ' & $arrlines & ' /out "' & @ProgramFilesDir & '\hello.au3"', "", @SW_HIDE)

Share this post


Link to post
Share on other sites

I dont think you can inturprit indivudal lines like that.

You might try instead the "Execute" function of the beta...but it is limited in what it can do...

Share this post


Link to post
Share on other sites

What about FileInstall, and pass Command Line Arguments?


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

I've already looked into this as an alternative for my multithreading UDF, but unfortunately it's not possible. I think the best you can do for protection is to obfuscate your code using SmOke_N's awesome UDF that does exactly that. Quite well, I might add... You can find it here:

EnCodeIt by SmOke_N

Basically, obfuscation is just a method that makes your code INCREDIBLY hard to understand. It turns all your variable names, function names, etc. into garbledy-gook. You should try it out, and just see how hard it is to read your OWN code. It's nearly impossible. Anywho, until they let us compile/run multiple lines, this might be your only option. Good luck.


[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites

evilertoaster:

yes, execute function is limited

MSLx:

using parameters, break security in a delicate zone

Uten:

yes, the array content is dynamic. That's why I have to compile it on the fly

neogia:

I will try EnCodeIt.

First I will obfuscate the script, and then will store in the array.

Do you know if I could edit some literals in the array-code after obfuscation?

Finally I'll save the script in a file, then compile.

Share this post


Link to post
Share on other sites

neogia:

I will try EnCodeIt.

First I will obfuscate the script, and then will store in the array.

Do you know if I could edit some literals in the array-code after obfuscation?

Finally I'll save the script in a file, then compile.

Good luck with editing after obfuscation.

If it something you want dynamic, I put those types of info at the very top, so I know where they are and can edit accordingly (just hope it's not text in those arrays for your sake).


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

why don't u just WRITE the script into the file and then compile it -.-


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

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