Protecting code

Ask for help, how to use AHK_H, etc.
HotKeyIt
Posts: 1500
Joined: 29 Sep 2013, 18:35
Contact:

Re: Protecting code

14 Jun 2017, 15:42

Can you show/create an example script?
Ayni
Posts: 4
Joined: 14 Jun 2017, 15:26

Re: Protecting code

14 Jun 2017, 16:10

HotKeyIt wrote:Can you show/create an example script?

Simple scripts works fine. I just can put test file.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Or more simple but with same error.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Attachments
2017-06-15_000333.png
2017-06-15_000333.png (30.29 KiB) Viewed 401 times
2017-06-15_000308.png
2017-06-15_000308.png (179.45 KiB) Viewed 401 times
HotKeyIt
Posts: 1500
Joined: 29 Sep 2013, 18:35
Contact:

Re: Protecting code

14 Jun 2017, 17:04

Just tested it with a fresh download and both scripts work fine.
Did you do the step 3. properly? 3. Copy ahkdll-v1-release-master\Win32w\AutoHotkey.exe to ahkdll-v1-release-master\Compiler\Ahk2Exe.exe.
Ahk2Exe.exe should be in Compiler folder!
User avatar
masheen
Posts: 226
Joined: 06 Dec 2016, 14:10

Re: Protecting code

14 Jun 2017, 17:09

Ayni wrote:
HotKeyIt wrote:Sorry, I should have mentioned that you need to use compiler included in download pack.
1. Download
2. Extract ahkdll-v1-release-master.zip
3. Copy ahkdll-v1-release-master\Win32w\AutoHotkey.exe to ahkdll-v1-release-master\Compiler\Ahk2Exe.exe
4. Double click Ahk2Exe.exe
5. Select correct Base File (.bin)
6. Use compression or/and encryption checkboxes.
7. Press > Compile Executable <

When I ran PC first time I did sucessful compile my script by your quote. After I did some changes via SciTe for my script and tryied again compile it, and now "Could not extract script from EXE." error message. But simple scripts (like MsgBox, Hello!) he still sucesfull compile and I can run them for full stability.
In Base File I select v1.1.26.0 AutoHotkeySC.bin (..\Win32w)
My AHK_Hv1 into C:\Program Files\AutoHotkey_H v1 (here is I call Ahk2Exe.exe)
My AHK into C:\Program Files\AutoHotkey

This is a bug?


u need choose AutoHotKey.exe(..\Win32w) for x86
u need choose AutoHotKey.exe(..\x64w) for x64

and it will work
Ayni
Posts: 4
Joined: 14 Jun 2017, 15:26

Re: Protecting code

14 Jun 2017, 18:52

Well "Could not extract script from EXE." coz of SmartScreen by AntiVirus (Kaspersky). Now I disabled it and it fixed for me. Sorry for that, compile works good.

But I do:
1. Deleted original "Compiler" C:\Program Files\AutoHotkey
2. Copy "Compile" folder from ahkdll-v1-release-master and put to C:\Program Files\AutoHotkey
3. Deleted original "AutoHotkey.exe" C:\Program Files\AutoHotkey
4. Copy "AutoHotkey.exe" from ahkdll-v1-release-master\Win32w and put to C:\Program Files\AutoHotkey
5. Copy "AutoHotkeySC.bin" from ahkdll-v1-release-master\Win32w and put to C:\Program Files\AutoHotkey\Compiler
6. I run Ahk2Exe.ahk from C:\Program Files\AutoHotkey\Compiler
7. As Base File I select "v1.1.26.0 AutoHotkeySC.bin (..\Compiler)
8. Checked all checkboxes with leave default password "AutoHotkey"
It works.

Now I trying recompile downloaded "ahkdll-master" by Visual Studio Community 2017.
So I have issues.. Let's start from begin.
1. I downloaded Visual Studio Community 2017 and I run setup. What I should to select for install? Because here is a lot of offers and I don't know what need only for AHK. See picture:
2017-06-14_194711.png
2017-06-14_194711.png (82.79 KiB) Viewed 381 times

2. I selected first (Windows) and latest (C++). Now I opened file "AutoHotkey.sln". By use finder for "g_default_pwd" I got 3 differents files with it:
until.cpp , script.cpp , globaldata.cpp
Which one I should to edit and how it should look like? Can you give me examples?

Code: [Select all] [Download] GeSHi © Codebox Plus

(TCHAR) _T("A\0\0\0\0u\0\0\0\0t\0\0\0\0o\0\0\0\0H\0\0\0\0o\0\0\0\0t\0\0\0\0k\0\0\0\0e\0\0\0\0y\0\0\0\0")

Here is AutoHotKey text I think.
Or need to edit this: ?

Code: [Select all] [Download] GeSHi © Codebox Plus

TCHAR g_default_pwd0 = 'X';
TCHAR g_default_pwd1 = 0;
TCHAR g_default_pwd2 = 0;
TCHAR g_default_pwd3 = 0;
TCHAR g_default_pwd4 = 0;
TCHAR g_default_pwd5 = 0;
TCHAR g_default_pwd6 = 0;
TCHAR g_default_pwd7 = 0;
TCHAR g_default_pwd8 = 0;
TCHAR g_default_pwd9 = 0;

3. How to compile with changes into Visual Studio Community?
User avatar
masheen
Posts: 226
Joined: 06 Dec 2016, 14:10

Re: Protecting code

14 Jun 2017, 19:20

Ayni wrote:Well "Could not extract script from EXE." coz of SmartScreen by AntiVirus (Kaspersky). Now I disabled it and it fixed for me. Sorry for that, compile works good.

But I do:
1. Deleted original "Compiler" C:\Program Files\AutoHotkey
2. Copy "Compile" folder from ahkdll-v1-release-master and put to C:\Program Files\AutoHotkey
3. Deleted original "AutoHotkey.exe" C:\Program Files\AutoHotkey
4. Copy "AutoHotkey.exe" from ahkdll-v1-release-master\Win32w and put to C:\Program Files\AutoHotkey
5. Copy "AutoHotkeySC.bin" from ahkdll-v1-release-master\Win32w and put to C:\Program Files\AutoHotkey\Compiler
6. I run Ahk2Exe.ahk from C:\Program Files\AutoHotkey\Compiler
7. As Base File I select "v1.1.26.0 AutoHotkeySC.bin (..\Compiler)
8. Checked all checkboxes with leave default password "AutoHotkey"
It works.

Now I trying recompile downloaded "ahkdll-master" by Visual Studio Community 2017.
So I have issues.. Let's start from begin.
1. I downloaded Visual Studio Community 2017 and I run setup. What I should to select for install? Because here is a lot of offers and I don't know what need only for AHK. See picture:
2017-06-14_194711.png
2. I selected first (Windows) and latest (C++). Now I opened file "AutoHotkey.sln". By use finder for "g_default_pwd" I got 3 differents files with it:
until.cpp , script.cpp , globaldata.cpp
Which one I should to edit and how it should look like? Can you give me examples?

Code: [Select all] [Download] GeSHi © Codebox Plus

(TCHAR) _T("A\0\0\0\0u\0\0\0\0t\0\0\0\0o\0\0\0\0H\0\0\0\0o\0\0\0\0t\0\0\0\0k\0\0\0\0e\0\0\0\0y\0\0\0\0")

Here is AutoHotKey text I think.
Or need to edit this: ?

Code: [Select all] [Download] GeSHi © Codebox Plus

TCHAR g_default_pwd0 = 'X';
TCHAR g_default_pwd1 = 0;
TCHAR g_default_pwd2 = 0;
TCHAR g_default_pwd3 = 0;
TCHAR g_default_pwd4 = 0;
TCHAR g_default_pwd5 = 0;
TCHAR g_default_pwd6 = 0;
TCHAR g_default_pwd7 = 0;
TCHAR g_default_pwd8 = 0;
TCHAR g_default_pwd9 = 0;

3. How to compile with changes into Visual Studio Community?



https://autohotkey.com/boards/viewtopic ... 22&t=13373

this work vs 2017
Ayni
Posts: 4
Joined: 14 Jun 2017, 15:26

Re: Protecting code

14 Jun 2017, 20:43

LoL You created the topic very opportunely time =) Will watch tomorrow

Need make togever all topics for protecting source code.
HotKeyIt
Posts: 1500
Joined: 29 Sep 2013, 18:35
Contact:

Re: Protecting code

30 Jun 2017, 15:28

Can you try again with latest release?

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 1 guest