Dgameman1 Posted October 1, 2011 Share Posted October 1, 2011 (edited) Let's say I have a website called www.Dgameman1.com/AutoIt.txt Would it be possible so that when the program loads. It goes to www.Dgameman1.com/AutoIt.txt and then the program would use the code on that webpage to run itself? Like.. Can I put the programs code on a txtfile online and when the program loads up, the programs code is taken from that textfile on www.Dgameman1.com/AutoIt.txt ? I would like this so that there is no download needed when I update my program for others to use. Any idea? Edited October 1, 2011 by Dgameman1 Link to comment Share on other sites More sharing options...
Beege Posted October 1, 2011 Share Posted October 1, 2011 Downloading a script and then launching that script with the compiled exe that you use to download the script is very possible and easy. Reading that code and executing it from the very same script gets really complicated. Theres functions like execute(), assign(), eval() that can be used but like I said, complicated. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Unsigned Posted October 1, 2011 Share Posted October 1, 2011 (edited) Here's a quick and dirty solution I wrote up in about 30 seconds. Error checking is left as an exercise for the reader. #Include <File.au3> Func RunScriptFromURL($url) Local $tmp = _TempFile(@TempDir, "~", ".au3") InetGet($url, $tmp) RunWait(@AutoItExe & " /AutoIt3ExecuteScript " & $tmp) FileDelete($tmp) EndFunc This will work in compiled and uncompiled scripts alike. Edited October 1, 2011 by Unsigned . Link to comment Share on other sites More sharing options...
Dgameman1 Posted October 1, 2011 Author Share Posted October 1, 2011 Here's a quick and dirty solution I wrote up in about 30 seconds. Error checking is left as an exercise for the reader. #Include <File.au3> Func RunScriptFromURL($url) Local $tmp = _TempFile(@TempDir, "~", ".au3") InetGet($url, $tmp) RunWait(@AutoItExe & " /AutoIt3ExecuteScript " & $tmp) FileDelete($tmp) EndFunc This will work in compiled and uncompiled scripts alike. I'm actually very confused on how to use that script. A dumbed down version of that please? =P Link to comment Share on other sites More sharing options...
Beege Posted October 1, 2011 Share Posted October 1, 2011 To dumb it down, try to think of any "compiled" autoit script as zip file that has the main autoit.exe (the one thats in your ProgramFiles directory) and your au3 script wrapped up into one file. Because the compiled autoit script contains the real autoit.exe inside it, any compiled autoit script is capable of launching any other autoit script the same way scite does for you. Look in the help file under Command Line Parameters for more info about that. The macro @autoitexe has two meanings. Either The full path and filename of the AutoIt executable currently running or for compiled scripts it is the path of the compiled script. This means that RunWait(@AutoItExe & " /AutoIt3ExecuteScript " & $tmp) is using that internal autoit.exe I just talked about to execute the $tmp script. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
DeltaRocked Posted October 1, 2011 Share Posted October 1, 2011 (edited) This logic / topic has all the signs of a malware. but anyway . nice. download something from the net and then execute it on the pc... hmmmm Edited October 1, 2011 by deltarocked Link to comment Share on other sites More sharing options...
Dgameman1 Posted October 1, 2011 Author Share Posted October 1, 2011 This logic / topic has all the signs of a malware. but anyway . nice. download something from the net and then execute it on the pc... hmmmm It's really not. Do you not think that it would be amazing to never have to download something ever and have it constantly updated? Link to comment Share on other sites More sharing options...
DeltaRocked Posted October 1, 2011 Share Posted October 1, 2011 (edited) yup... but due to my job profile I have to always think like a malware author. An obfuscated script will be a bit better... or an encrypted txt file which is decrypted and then executed. after execution the tmp file is overwritten and deleted. #Include <File.au3> Func RunScriptFromURL($url) Local $tmp = _TempFile(@TempDir, "~", ".au3") InetGet($url, $tmp) ; decrypt RunWait(@AutoItExe & " /AutoIt3ExecuteScript " & $tmp) FileDelete($tmp) EndFunc Edited October 1, 2011 by deltarocked Link to comment Share on other sites More sharing options...
Unsigned Posted October 1, 2011 Share Posted October 1, 2011 (edited) This logic / topic has all the signs of a malware. but anyway . nice. download something from the net and then execute it on the pc... hmmmmHow is that different from any program which updates itself via web? It's really not. Do you not think that it would be amazing to never have to download something ever and have it constantly updated?I agree with you. However, you should take precautions against the event of a server hijack. If someone was able to modify or replace your downloaded script, it could mean hell for your users (and your PR). Suggestion: It would be worth looking into asymmetric encryption. Encrypt the server-side copy offline with your private key before uploading. Then have your launcher download it, decrypt it with your public key and run a hash check on it. That way you can be assured nobody has tampered with or replaced it. This method is used by many antivirus providers to secure their updates. Edited October 1, 2011 by Unsigned . Link to comment Share on other sites More sharing options...
Unsigned Posted October 1, 2011 Share Posted October 1, 2011 (edited) I'm actually very confused on how to use that script. A dumbed down version of that please? =P@AutoItExe automatically expands to the interpreter path. For uncompiled scripts (.au3), this will be the main AutoIt interpreter. For compiled scripts, this will be the .exe itself. Every AutoIt-compiled script contains an instance of the AutoIt interpreter by definition, thus any AutoIt .exe can double as an interpreter by using the /AutoIt3ExecuteScript switch. Edited October 1, 2011 by Unsigned . Link to comment Share on other sites More sharing options...
DeltaRocked Posted October 3, 2011 Share Posted October 3, 2011 Unsigned :Updating the source with additional modules, I doubt its going to trigger any of the filters .. and AVs are going to miss this unless and until they are into dynamic analysis and blocking. anyway .... but original idea with your insights are gr8 . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now