Page 4 of 4

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 09 Apr 2024, 21:25
by JoeWinograd
jsong55 wrote:Maybe I'll try UPX then.
Doesn't hurt to try it, but as I mentioned earlier, I've had terrible results over the years with it. Every so often I'll try UPX again, especially when there's been a new release, but the anti-virus/anti-malware programs always kill it. Once I found the sizing work-around for MPRESS, I've been happy with the results, although it gets very frustrating at times. I'm curious to hear how your tests go with UPX...and MPRESS. Please post back here to let us know. Regards, Joe

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 09 Apr 2024, 22:25
by jsong55
UPX works! Guess I'll stick to it for now. About the AntiVirus, it's a false positive so just have to put on allow list. I sometimes encounter Windows Defender trying to remove it even without any compression

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 10 Apr 2024, 00:05
by JoeWinograd
jsong55 wrote:it's a false positive so just have to put on allow list
Yes, of course it's a false positive, and it's easy for you to whitelist, but if you distribute your programs to other users, it's problematic to get them to whitelist...that's extremely undesirable, especially when the false positive results in deletion of the executable.

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 10 Apr 2024, 00:16
by jsong55
Good point but let's not discuss in this thread.. is there a thread to tackle that?

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 10 Apr 2024, 16:48
by JoeWinograd
jsong55 wrote:is there a thread to tackle that?
I don't know, but I think this is a fine place to discuss it. In TAC109's first post in this thread, he mentions MPRESS and UPX (in the ScriptGuard2 Restrictions section). Also, there are many other posts about compression/MPRESS/UPX during the almost four years since the thread began. That said, I've already posted most, if not all, of my relevant experience on the topic, but would be happy to keep brainstorming it here. Of course, if the author, TAC109, prefers to move discussion of this issue elsewhere, I'll certainly comply. Let's see if he gives us some direction on this. Regards, Joe

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 10 Apr 2024, 23:52
by TAC109
All good information.

Cheers

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 11 Apr 2024, 20:24
by guest3456
TAC109 wrote:
22 Aug 2020, 20:11
ScriptGuard2 is available with Ahk2Exe v1.1.34.04b or later and can be used with AutoHotkey v1.1 and v2. It is 32-bit and 64-bit compatible. It can also be used with AutoHotkey_H v2, provided that the 'Encrypt Source' parameter is set to '(none)' in the Ahk2Exe_H GUI.
which is the better method of protection? the builtin AHK_H encryption, or ScriptGuard2?

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 11 Apr 2024, 21:17
by jsong55
I go with ScriptGuard as there are some differences in _H vs _L and I don't have time to modify too much code to adjust

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 11 Apr 2024, 23:14
by TAC109
@guest3456
There is a disadvantage with AutoHotkey_H in that to change the password used, it is necessary to modify it in the AHK_H source and recompile to generate a new AutoHotkey_H executable.

With ScriptGuard a different random password key is automatically generated to encode the source, each time a script is compiled with Ahk2Exe. This makes ScriptGuard simple to use.

Cheers

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 12 Apr 2024, 02:09
by jsong55
@TAC109 can we request a feature to use our own password? Say from a disposable ini file.

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 12 Apr 2024, 20:44
by TAC109
@jsong55 Could you explain the reason for your request, please.

Cheers

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 13 Apr 2024, 20:23
by helloicanseeu
i using scriptguard for a while, everything was fine, until today
i keep getting
image.png
image.png (16.9 KiB) Viewed 1317 times
can only compile when i disable scriptguard, any idea?

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 14 Apr 2024, 03:21
by TAC109
@helloicanseeu
It looks like you usually compile with a *.bin base file. Have you inadvertently tried to compile using a *.exe base file?

If you wish to continue to compile against an *.exe base file in future you will need to change the relevant ;@Ahk2Exe- lines in your script. (See the summary in the main ScriptGuard post for generalised code that covers both these base file situations.)

Cheers

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 14 Apr 2024, 07:05
by helloicanseeu
TAC109 wrote:
14 Apr 2024, 03:21
@helloicanseeu
It looks like you usually compile with a *.bin base file. Have you inadvertently tried to compile using a *.exe base file?

If you wish to continue to compile against an *.exe base file in future you will need to change the relevant ;@Ahk2Exe- lines in your script. (See the summary in the main ScriptGuard post for generalised code that covers both these base file situations.)

Cheers
i looked at earlier posts and stumbled into version issues, the autohotkey updated itself somehow and that's why it didnt work.
i reinstalled an earlier ahk v1 version and could compile again, tyty for your tremendous effort.
these version issues break a lot of stuff, i remember in linux lol.

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 14 Apr 2024, 17:04
by TAC109
@helloicanseeu
ScriptGuard should work with all recent versions of AutoHotkey v1.1 and v2, so I suspect that something else is going on here.

Could you please supply more details about the problem you experienced, including a screenshot of Ahk2Exe with parameters supplied, and the ;@Ahk2Exe- lines in the source that you tried to compile? This will enable me to troubleshoot this problem more fully.

Thanks for your help with this.

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 19 May 2024, 09:41
by william_ahk
I'm curious about how ScriptGuard2 works. Where is the random password stored? How safe is it?

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 19 May 2024, 17:34
by TAC109
ScriptGuard is about as safe as any other method of encrypting the source. The random password is stored as a binary blob embedded in the generated machine code. Additionally there is a string of random data that is used to prime the algorithm prior to source encryption.

Cheers

Re: ScriptGuard: Helps Protect Compiled Scripts from Decompilation

Posted: 20 May 2024, 00:09
by thqby
I don't think any externally implemented encryption method prevents reading the AHK source code from resources after decryption and before the program entry function runs.