Announcement

Collapse
No announcement yet.

autoplay2c - transpile AMS8/Lua -> C -> DLL.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • autoplay2c - transpile AMS8/Lua -> C -> DLL.

    After years of being idle in the AutoPlay Media Studio world something triggered my interest in AMS again.
    This is why I decided to have a weekend project for the few people remaining on these forums.

    autoplay2c
    autoplay2c is a utility for AMS8 users or Lua 5.1 developers on 32-bit Windows based systems. This tool is
    capable of transpiling (translating/compiling) Lua 5.1 to a Lua Abstract Syntax Tree (AST). It then translates that
    AST into a C AST, which can be used to generate C source code. autoplay2c will then compile that source
    code into a DLL, specifically a Lua module. The module can then be loaded like any other Lua module.

    When a .autoplay project file is chosen as input file, all the source code in that project will be collected and
    converted to a single large Lua module. That large Lua module is then compiled as DLL. A copy of the
    AMS project file is stored containing only calls into the compiled Lua module, but the original source code
    is gone as it was translated to Lua API calls rather than Lua VM instructions.

    There is support for version information, your resulting binary will have your own version information.

    disclaimer: this is not code encryption or obfuscation, it's a full translation of Lua to C. This means that
    your original code might not always work. Coroutines are not supported. Read more about the limitations
    in the application help dialog. Huge Lua scripts might require a custom Lua version with a very large
    LUAI_MAXCCALLS value, as all calls will happen on the C side of Lua rather than the Lua side.

    read the help topics that are accessible from within the main application!

    More information and downloads

    Click image for larger version  Name:	main-application.png Views:	3 Size:	184.5 KB ID:	309340
    Last edited by Imagine Programming; 09-24-2022, 07:53 PM.
    Bas Groothedde
    Imagine Programming :: Blog

    AMS8 Plugins
    IMXLH Compiler

  • #2
    A couple of examples of AMS projects that were transpiled through autoplay2c
    Attached Files
    Bas Groothedde
    Imagine Programming :: Blog

    AMS8 Plugins
    IMXLH Compiler

    Comment


    • #3
      Bas,
      Many Thanks for your efforts

      Comment


      • #4
        Thanks !!

        Comment


        • #5
          see that you have finished the project
          great job as usual
          many thanks Bas​

          Comment


          • #6
            Originally posted by herrin View Post
            see that you have finished the project
            great job as usual
            many thanks Bas​
            I have not fully finished the other project :P Thanks!
            Bas Groothedde
            Imagine Programming :: Blog

            AMS8 Plugins
            IMXLH Compiler

            Comment


            • #7

              Comment


              • #8
                Update - v1.1.0.0

                An update is available for autoplay2c:
                • Changed: all compiler options are now under the "Options" button next to the "Compile" button
                • Fixed: Generate intermediate files checkbox state was not stored as project setting
                • Added: Object serialization (no more objects in _proj.dat)
                • Added: Object serialization exclusion rules (exclude object types or specific objects from serialization)
                • Added: Generate code to imitate TAB-order where possible, which is not entirely the same due to AMS limitations
                • Added: Generate code to also automatically add items from the AMS environment to serialized objects, where applicable
                • Added: Feature to replace references to AutoPlay directory with a directory of choice
                ​For more information, visit the product page.

                NOTE: Object Serialization is not a magic solution for hiding away objects in your AMS project. It will disappear from _proj.dat, but some features will no longer be available. TAB-order will act differently, some object types have bugs (such as OBJECT_INPUT, OBJECT_LISTBOX) upon creation with Page.CreateObject and DialogEx.CreateObject and more. Please test your software well before publishing, as it might be acting differently after autoplay2c and especially after object serialization. I will update the limitations and help dialog information soon, after feedback from users.

                Also please remember that this is also not obfuscation or encryption, it transpiles the application. Reverse engineering is still possible, quite easily. The only advantage here is that the Lua source code is absolutely gone, so it cannot be reversed that easily to Lua.
                Bas Groothedde
                Imagine Programming :: Blog

                AMS8 Plugins
                IMXLH Compiler

                Comment

                Working...
                X