Page 2 of 8

Re: AHK源代码加密器 v2.0

Posted: 07 Jun 2018, 17:59
by AHKStudent
feiyue wrote:@AHKStudent, I fixed this problem, and now it can package the AHK main program into a separate program.
Tested and it works :thumbup: :thumbup:

Re: AHK源代码加密器 v2.1

Posted: 08 Jun 2018, 13:59
by alware
i put this code at the beginning of my code but still doesn't work

SetWorkingDir %A_WorkingDir% ; Ensures a consistent starting directory.

Re: AHK源代码加密器 v2.1

Posted: 08 Jun 2018, 14:31
by feiyue
@alware, You need to re-encrypt the script ! :wave:
The initial working directory of the encrypted script (or compiled program) is the directory where the file is located.
For example, your script is in the D:\ directory, and your picture is in the same directory D:\001.jpg.
When you search for pictures, you can use the relative script path: "001.jpg".
I suggest that you use dir:=A_WorkingDir to save the script's working directory at the beginning of the script,
then you can use the absolute path of the picture: dir . "\001.jpg".

Re: AHK源代码加密器 v2.0

Posted: 08 Jun 2018, 21:58
by alware
feiyue wrote: @alware, Because script runs through named pipes, A_ScriptDir is useless.
You should use dir:=A_WorkingDir to get the used directory of the compiled program.
works perfectly!!! Thank you so much! your code rocks!!!!!!!!!!!!!!!!!

reload() doesn't work ! any idea?

Re: AHK源代码加密器 v2.1

Posted: 08 Jun 2018, 22:38
by feiyue
@alware, You can test a simple script encryption.

Code: Select all

Msgbox, OK !
Esc::Reload()

Re: AHK源代码加密器 v2.1

Posted: 09 Jun 2018, 15:09
by FluffyMrKitty
Is there any way to have the encrypted script run without a tray icon?

Re: AHK源代码加密器 v2.1

Posted: 09 Jun 2018, 17:38
by feiyue
FluffyMrKitty wrote:Is there any way to have the encrypted script run without a tray icon?
add #NoTrayIcon

Re: AHK源代码加密器 v2.1

Posted: 09 Jun 2018, 17:57
by FluffyMrKitty
You're right. I just now noticed my stupid mistake. Sorry about that.

Re: AHK源代码加密器 v2.1

Posted: 12 Jun 2018, 14:04
by FluffyMrKitty
Would you be interested in figuring out why your encryption messes with this script's encryption/decryption? Frankly your work is beyond my current comprehension and I barely have a grasp on Laszlo's work.

Basically if I encrypt Laszlo's SW protection script with your script, I only get two unique fingerprints as opposed to a unique fingerprint for every machine.

Re: AHK源代码加密器 v2.1

Posted: 17 Jun 2018, 15:16
by feiyue
FluffyMrKitty wrote:Would you be interested in figuring out why your encryption messes with this script's encryption/decryption? Frankly your work is beyond my current comprehension and I barely have a grasp on Laszlo's work.

Basically if I encrypt Laszlo's SW protection script with your script, I only get two unique fingerprints as opposed to a unique fingerprint for every machine.
@FluffyMrKitty, You have found a good script, and I like it very much. :bravo:
I changed my script a little bit, upgraded to v2.2 version.
Deleted the #NoEnv statement (attached to the user script). :dance:

I suggest that you adjust the following code when you use Laszlo's script :

Code: Select all

dir:=A_WorkingDir
IniFile = %dir%\SafeSW.ini

Code: Select all

CheckAuth:
ListLines, Off
SetTimer,, Off

Re: AHK源代码加密器 v2.2

Posted: 23 Jun 2018, 15:16
by AHKtreasureland
thank you Fei, this is great stuff! Would it also work with AHK_H? would be great if it does. Thank you again!

Re: AHK源代码加密器 v2.2

Posted: 07 Aug 2018, 19:20
by FastLearner
as usual perfect scripts, fan of your "FindText" script :thumbup: :clap:

I'm also using the great laszlo's protection script so I need to hide any relevance on how this script/program was made or with what language.

Is there any way to not include the autohotkey master program when opening the compiled script?

or a way to hide ahk.exe icon and maybe encrypt it to hide it was made by which program?

Thank you very much :salute:

Re: AHK源代码加密器 v2.5

Posted: 26 Aug 2018, 18:26
by feiyue
更新到v2.5版本,提高了破解的难度,但还是防菜鸟防不了高手。

Re: AHK源代码加密器 v2.0

Posted: 02 Oct 2018, 04:42
by SOTE
feiyue wrote:Updated to the V2.0 version, Enhance the difficulty of cracking. :superhappy:
Suggestions for additional security:

1) To possibly create a GUI, so a user can add a blacklist of cracking, debugger, or whatever programs. If the process of such cracking programs are found, then this causes the main program to exit.

2) Checksum or md5 hash check. Program performs a self check and/or consults database elsewhere, and if it's been altered from it's original state, tampered with, or hash doesn't match that of the database, will not run the main program.

Re: AHK源代码加密器 v2.6

Posted: 12 Oct 2018, 04:24
by SOTE
nice

can you give an explanation in english? maybe you could post this in the "Scripts And Functions" forum

and can you provide the c++ source code for the machine codes?
There are a lot of c and c++ open source code that you can compile into machine code or use, like NCrypt for example, https://sourceforge.net/projects/ncrypt/
Though there is a good point about not providing the source of the machine code, because then how much can you trust it? A lot of people will not use, if they don't know what is in the machine code.
thank you Fei, this is great stuff! Would it also work with AHK_H? would be great if it does. Thank you again!
AHK_H already has the ability to use encryption, Refer to https://autohotkey.com/boards/viewtopic.php?f=67&t=6013

However, that uses a default password to encrypt, and you must recompile the source code in order to change it. But for basic protection, you are set. This method is superior to obfuscation. And more so, once you figure out how to recompile source code. That is not to say that Feiyue's method, though fantastic, doesn't have some issues too. Like trusting the contents of the machine code or not giving the source used to generate the machine code... But I do think a hybrid method between what Feiyue and HotKeyIt have done might be possible. Where a function generates a random password or one chosen by the user, and where the source code is open, but it's not necessary to recompile it in order to encrypt protect scripts.

I think there is a place for this, as in businesses, schools, or IT departments that want to use AutoHotkey but are worried about their source code that has sensitive information (like passwords, server names, looking for porn in the work place, etc...) that can be exposed or it can be tampered with in unwanted ways by 3rd parties.

Re: AHK源代码加密器 v2.6

Posted: 03 Dec 2018, 21:52
by feiyue
由于只是为了阻止菜鸟获取源代码,所以目前我没有继续改进的思路。
这种加密方法对于高手还是很容易破解的,建议还是使用AHK_H的加密方式。

Because it's just to prevent newbies from getting the source code,
I don't have any ideas for further improvement at present.

This encryption method is easy to crack for the master.
It is suggested to use the encryption method of AHK_H.

Re: AHK源代码加密器 v2.7

Posted: 07 Dec 2018, 20:44
by feiyue
Updated to 2.7 version - 2018/12/08
1. Add togetcode() function, It is used to contain the user's script itself.
2. The C source code of the machine code has been published.

Re: AHK源代码加密器 v2.7

Posted: 08 Dec 2018, 00:51
by SOTE
Well done. Teaches an informative lesson in coding and gives the user more options on how they want to construct or utilize this impressive script.

Re: AHK源代码加密器 v2.7

Posted: 12 Dec 2018, 23:49
by syko
Hi, What is the purpose of this tool?
In order to prevent a process (such as game-guard) from detecting AHK?

Re: AHK源代码加密器 v2.7

Posted: 14 Dec 2018, 02:55
by SOTE
syko wrote:
12 Dec 2018, 23:49
Hi, What is the purpose of this tool?
In order to prevent a process (such as game-guard) from detecting AHK?
Your comment comes off as ill-informed, so I hope you are not trolling. If it was meant specifically for gaming, then it would be in the gaming section. It's an optional source code protection feature, that deters casual users from tampering and can possibly provide some security inside say a school or business, that is deploying AutoHotkey scripts on various machines. Many other programming languages that are interpreted or compiled into an intermediate form (such as C#, Java, or Python) utilize such protections (encryption or obfuscation). AutoHotkey is not compiled directly into machine code, like say C, C++, or Pascal. Thus it can be more easily "decompiled" (again like C#, Java, or Python) by 3rd parties.

As for GameGuard specifically, you can try, but nothing stops them from updating their program in response. Particularly if a hack or cheat gains any kind of popularity or they become aware of it. You are dealing with a company, that likely employs programming experts, that will be up to the task of developing a counter.