Jump to content

CompileIt - an experimental AutoIt-to-machine code compiler 0.0.1

   (1 review)


2 Screenshots

About This File

This is an experimental AutoIt-to-machine code compiler, written in AutoIt, JavaScript and C.

Make sure you have GCC installed and configured within CompileIt before using.

User Feedback

You may only provide a review once you have downloaded the file.


Report ·


I have access to the Code::Blocks GCC compiler.

In order to get this to work, I did the following:

  • Create a local folder with all the includes required, the supplied .au3 sample files for the project, as well as the supplied includes;
  • Create a new project (.cbp) and added all these files (select *);
  • Hit Build!

The output file should be created as expected.  :) 


The challenge here is not compiling AutoIt to machine code, but in developing the compiler friendly parts of AutoIt at a pace that matches user needs.  By proving that AutoIt can be compiled like this, even if it first has to be transliterated into a lower level language, such as C in this case, the door is open for full function compiled AutoIt executables - in machine code.

This also places AutoIt in a position where it can produce compiled scripts, much the same way Lua does.

At this time the achievement is getting the idea to work in practice.  Even baby steps will change the way AutoIt can be used in the future.

Watch this space. :)


Share this review

Link to review
  • Similar Content

    • scintilla4evr
      By scintilla4evr
      Okay, this is exciting.
      I'm proud to introduce CompileIt - an experimental compiler, that allows to compile AutoIt to machine code.
      ...Kind of. CompileIt does compilation in a similar way the Glasgow Haskell compiler does: translates the code into a lower-level language (in CompileIt's case it's C), and then compiles the code in that language.
      Now, this project is still in its infancy, since, although it is simple to use, AutoIt is incredibly complex on the inside (automation, COM, etc.). So, CompileIt can compile only a very small subset of what we know as AutoIt.
      Here's a list of things CompileIt (partially) supports (or not):
      Numbers, booleans, strings Some built-in functions If, For and While statements Exporting DLL functions (you can now write DLL's in AutoIt, guys!) No arrays, automation, GUI or COM. A more detailed list is included with CompileIt.
      CompileIt is written in AutoIt (the compiler interface), JavaScript (parser, executed with ChakraCore), and of course C.
      GCC is required to compile scripts. After you extract the files, run CompileIt.exe and configure it to work with GCC.
    • Ward
      By Ward
      I have wrote a lot of binary code library for AutoIt before. I also discover many ways to generate binary code for AutoIt in the past. However, all of them have limitation or need some extra effort.   Recently, I think I found the best and easiest way to generate the binary code. So I wrote this UDF, may be my last one about binary code.   The Features: Both AutoIt x86 and x64 version are supported. Windows API and static variables can be use (code relocation supported). Decompression at run-time with smallest footprint LZMA decoder. Allocated memory blocks are released automatically. Most C source code works without modification. Two step or one step script generation, very easy to use. How It Works:
      The C source code must be compiled by MinGW GCC with "-S -masm=intel" option. Output is GAS syntax assembly file. BinaryCall Tool is able to convert the GAS syntax assembly file (*.s) to FASM syntax (*.asm). During the conversion, global symbols will be stored as "Symbol Jump Table" at the head of the file. The output file should be able to be assembled to binary file under command line by FASM.EXE. This syntax conversion is step 1. The step 2 is to assemble the file. BinaryCall Tool will use the embedded FASM to assemble every file twice to generate the relocation table. "BinaryCall.inc" will be included automatically before assembling to detect the Windows API and generate the "API Jump table". All the results will be compressed and converted to AutoIt script output. There are two major functions in the output script. _BinaryCall_Create() function allocates memorys, decompress the binary, relocates the address in memory, and fills the "API Jump Table". _BinaryCall_SymbolList() converts the "Symbol Jump Table" to memory addresses, and then store them as pointers in a DllStruct variable. Finally, we can use DllCallAddress() to call the memory address stored in the DllStruct. Step by Step Tutorial:
      Write C source code:#include <windows.h> void main() { MessageBox(0, "Hello", "Welcome Message", 1); } Use GCC MinGW 32/64 to compile the source code:
      gcc -S -masm=intel -m32 MessageBox.c Use BinaryCall Tool "GAS2AU3 Converter", select "MessageBox.s":
      If Not @AutoItX64 Then Local $Code = '...' Local $Reloc = '...' Local $Symbol[] = ["main"] Local $CodeBase = _BinaryCall_Create($Code, $Reloc) If @Error Then Exit Local $SymbolList = _BinaryCall_SymbolList($CodeBase, $Symbol) If @Error Then Exit EndIf Paste the output script, call the main() in AutoIt:
      #Include "BinaryCall.au3" ; Paste output here DllCallAddress("none:cdecl", DllStructGetData($SymbolList, "main")) Try to run it!
      Change Log: v1.0Initial release. v1.1 A lot of improvement for GAS2ASM converter and FASM header file. Add many C Run-Time library as inline asm subroutines. Add command-line to argc/argv parser for easy calling main() function. Add ability to redirect stdio. More C source code can work without modification in this version.
      Following open source projects are tested.
      And Yes, they can run as binary code library in AutoIt now.
      SQLite 3.8.5
      TCC 0.9.26
      PuTTY beta 0.63
      v1.2 Dynamic-link library (DLL) calling is supported now. 
      If the C program requires a DLL file to run, just put it together with the source file. BinaryCall Tool will searches *.dll and exports all the symbols in these DLL files automatically. Of course, you need these DLL files when run the output script. However, it also works if you loaded them by last version of MemoryDll UDF. To add more Windows API library easily by editing the ini file. Better error handling and more error messages in output script. Add zero padding to avoid short jumps that crash the relocation table. BinaryCall Tool accepts drag and drop files now. Some small bug fixed.  
      BinaryCall 1.0.zip
      BinaryCall 1.1.zip
      BinaryCall 1.2.zip
    • Yashied
      By Yashied
      This is my modification of the editor based on SciTE Too many changes are made. Added new plugins (.lua) and rewrited existing, added Toolbar and Sidebar, expanded main and context menu, and more... I will not list all the changes, just download and try it.
      I also want to say a big thank the staff of Ru-Board for the excellent work on the modification of the editor and writing great plugins (.lua).

      Compiler Wrapper (CW) - a new tool that is part of SciTE and designed to replace the AutoItWrapper. CW only works with "pragma" directives and does not use "AutoIt3Wrapper" directives. CW differs from AutoItWrapper both externally and internally but has a similar logic. Here are some possibilities utility - more friendly GUI, all options of "pragma" directives are located in one window, the ability to add digital signature, and a simple way to add resources (.rcs and .res files). The current version of CW is compatible with AutoIt 3.3.10.x, 3.3.12.x, and 3.3.14.x.

      How to install?

      Unpack CW to Compiler Wrapper folder and copy it to your SciTE or SciTE\Tools directory. Note that if you download SciTE then you need not do anything because CW is already installed in the package.

      Command lines for SciTE:
      #Command line for compilation command.compile.au3="$(SciteDefaultHome)\Compiler Wrapper\CW.exe" "$(FilePath)" /m:1 /c:0 command.compile.subsystem.au3=1 #Command line for building (without GUI) command.build.au3="$(SciteDefaultHome)\Compiler Wrapper\CW.exe" "$(FilePath)" /m:1 /c:0 /s:1 command.build.subsystem.$(au3)=1 #Command line for changing "pragma" options only command.90.au3="$(SciteDefaultHome)\Compiler Wrapper\CW.exe" "$(FilePath)" /m:2 command.name.90.au3=Compiler Options... command.shortcut.90.au3=Shift+F7 command.subsystem.90.au3=1 command.save.before.90.au3=1
      Command lines for Windows Explorer context menu:
      ;Command line for compilation "C:\Program Files (x86)\SciTE\Tools\Compiler Wrapper\CW.exe" "%1" /m:0 /c:0 ;Command line for building (without GUI) "C:\Program Files (x86)\SciTE\Tools\Compiler Wrapper\CW.exe" "%1" /m:0 /c:0 /s:1

      Files to download
      You can download latest SciTE build on this page (bottom of the post) or by using the SciTE Updater.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.