My main job is to write softwares at C# for a betting company that i work, but we need something to work fast with keyboard this is the reason i choose autohotkey, my script is ready but i am looking for ways to protect it. Thanks for your interest.

I didn't. Uberi did. There is currently no obfuscator script for AutoHotkey afaik, but i can show you how he did it if you are unable to translate the snippet. But first let´s talk a little bit more about obfuscation :wink:

If you are going to obfuscate a source code, you will probably make use of a lot of useless code and a lot of diversion code. A script is a text file that is based on a programming language, which is a language that can serve as means of communication between the human programmer AND the interpreter/compiler.

The thing is, although both of them are making use of the same language, they understand it differently. Humans read the language in an extremely slow pace compared to the machine, but the machine (albeit being a faster reader) is unable to grasp the abstract meaning of the code (the logic of the script).

These key differences between the types of readers allow obfuscation by the means of making the code much harder for a human to read without significantly altering the expected results of the execution.

In that sense, even the most simple techniques could provide some level of obfuscation:

The interpreter will read both scripts so fast that they will seemingly do the same. But a human programmer will find the second significantly harder to understand.

Obfuscation is mostly an art by itself. You could go on and create a script that will auto-obfuscate other scripts, or you could go on and obfuscate it manually. It's not hard at all, just put together some concepts of the language to script the same routines in a seemingly unreadable manner.

Uberi made use of the following aspects of the AutoHotkey programming language to create that obfuscated snippet:

1 - The chr() function: A built-in function that allows one to retrieve any character from it's ASCII value. As any function parameter, the value to be passed can be the result of an expression (such as the bitwise or'ing of two numbers with | operator or the left/right shiftings with >> and << operators)2 - Lot's of #'s, @'s, $'s and _'s: these symbols are allowed into variable names and can be easily mistaken for operators. 3 - Commas (,): They allow multiple mathematical assignments to be declared in the same line.4 - Dereferencing variables into function names: a function call can be succesfully implemented by dereferencing the contents of variables. Dllcall() is a function and chr() is a function too, so both can be succesfully called in this manner.And maybe some others that i cannot remember atm.

This article, albeit being intentionally a joke, contains lots of ideas on how to obfuscate a script and it's a well worth reading

Uberi made use of the following aspects of the AutoHotkey programming language to create that obfuscated snippet:

1 - The chr() function: A built-in function that allows one to retrieve any character from it's ASCII value. As any function parameter, the value to be passed can be the result of an expression (such as the bitwise or'ing of two numbers with | operator or the left/right shiftings with >> and << operators)2 - Lot's of #'s, @'s, $'s and _'s: these symbols are allowed into variable names and can be easily mistaken for operators. 3 - Commas (,): They allow multiple mathematical assignments to be declared in the same line.4 - Dereferencing variables into function names: a function call can be succesfully implemented by dereferencing the contents of variables. Dllcall() is a function and chr() is a function too, so both can be succesfully called in this manner.

Most importantly, you can build up any integer by setting its bits correctly. Any integer between 0 and 255 would require no more then 8 variables shifted and bitwise-OR'd together.

Back to the subject, though, obfuscation is the only real way to protect AHK source code as of now, since the source is what is input to the AHK interpreter. That said, there is no fully automated, well maintained obfuscator available for AHK as of the moment. However, this might get you on the right track:

The above is a basic source code minifier I had lying around. It will remove whitespace, continuation sections, and generally make the code more compact. It will not mangle names, add dead code, or fold expressions, though.

lots of languages have lots of tools that lots of other languages could use. but every language is different. We here at AHK do not monitor or stalk the AutoIt community to create what they do. are are our own community, not some jealous Autoit wannabe's.

Only a small handful of AHK users have wanted/needed there code super secure. The best you might be able to get is the CamoAHK compiler. search for it.

Obfuscate all you want. But, if someone realy wants your source code they will get it. AHK is a scripting language and as such the packed exe needs to be able to read the script in order to run. If it can read it, then a human can eventually read it. You will have to use a compiled language if you want to protect your source code.