Jump to content

Compile From Array?


Recommended Posts

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"

Link to comment
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.

Link to comment
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)
Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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).

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...