Sign in to follow this  
Followers 0
lionfaggot

is it possible to read code from a file?

9 posts in this topic

sort of like, i put autoit code in a txt file, can a compiled autoit exe execute the code? and also, how would i go about this in a secure manner, it creates possible code injection vulnerabilities

Share this post


Link to post
Share on other sites



You will need the compiler or write your own compiler.

You can make your own script with autoitscript.

So yes, it's possible.


Many times you need to think like hobby-bob:')

Share this post


Link to post
Share on other sites

not what i meant, i saw another post on here some time ago asking a similar question and it got answered. at the time i didnt care but now i wanna do something with it and cant find the post LOL

Share this post


Link to post
Share on other sites

What you mean then?

You want to make a kind of macro's, instead of compile it to .exe?

So in example you make a text file called "code.txt".

In "code.txt" is written "msg: hello world".

And you want to make a msgbox with "hello world" from your compiled script.


Many times you need to think like hobby-bob:')

Share this post


Link to post
Share on other sites

no, i want to have a compiled exe read from a file msgbox(0,"poop","poop") and execute the code

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

So you will have something like this:

#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("C:\code.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringRegExp($aRecords[$x],'(?i)MsgBox') Then
    MsgBox(0,"test","regexp true")
    EndIf
Next
Edited by Gideon

Many times you need to think like hobby-bob:')

Share this post


Link to post
Share on other sites

Do you mean this?

Run("anyCompiledAutoitExe.exe  /AutoIt3ExecuteScript C:\MyAutoitScriptInATextFile.txt" )

That's a lot better:)

I'm trying to help, but not know everything, Sorry


Many times you need to think like hobby-bob:')

Share this post


Link to post
Share on other sites

thanks, youre awesome

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