AHK源代码加密器 v3.3

许多实用脚本和封装函数, 可以让您编写脚本更加便捷高效

Moderators: tmplinshi, arcticir

GreenLeafGL4
Posts: 12
Joined: 22 Oct 2021, 19:35

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

Post by GreenLeafGL4 » 09 Nov 2021, 04:33

i encrypted my script with the encrytor, however whenever i open the encoded file it shows the following message

Script file not found:
\\.\pipe\AHKXXXXXXXX


The XXXXXXXX varies every time, but it always give me this error message whenever i try to open my encoded ahk file, do you have any idea about how to solve this

DarkSider
Posts: 50
Joined: 29 May 2019, 11:06

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

Post by DarkSider » 22 Nov 2021, 04:42

Hi, the script works but i'm trying to make it work on a file which should be executed as administrator. I got this test script which works both as .ahk or compiled before encrypting. However after encryption, i get the same error as user above me

Code: Select all

#Singleinstance Force
full_command_line := DllCall("GetCommandLine", "str")

if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
    try
    {
        if A_IsCompiled
            Run *RunAs "%A_ScriptFullPath%" /restart
        else
            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
    }
    ExitApp
}

j::
{
if A_IsAdmin
msgbox, works
return
}

Logitope
Posts: 19
Joined: 13 Feb 2021, 14:44

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

Post by Logitope » 26 Nov 2021, 04:04

Dystopia wrote:
26 Jun 2020, 12:08
1) When encoded, the name of my script in the taskbar changes to a seemingly random string. Can I make it retain the original name of my script?
It seems no one ever answered this question? Include the following line in your script:

Menu, Tray, Tip, [Desired Name]

Recca
Posts: 35
Joined: 18 Jan 2016, 21:44

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

Post by Recca » 27 Nov 2021, 07:03

GreenLeafGL4 wrote:
09 Nov 2021, 04:33
i encrypted my script with the encrytor, however whenever i open the encoded file it shows the following message

Script file not found:
\\.\pipe\AHKXXXXXXXX


The XXXXXXXX varies every time, but it always give me this error message whenever i try to open my encoded ahk file, do you have any idea about how to solve this
I am also having the same problem with this Script file not found error

feiyue
Posts: 348
Joined: 08 Aug 2014, 04:08

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

Post by feiyue » 27 Nov 2021, 10:31

Don't use A_ScriptDir, but use A_ScriptDir2. Don't use Reload, but use Reload().

GreenLeafGL4
Posts: 12
Joined: 22 Oct 2021, 19:35

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

Post by GreenLeafGL4 » 11 Dec 2021, 10:00

@feiyue
i already typed the following statement in my script
SetWorkingDir %A_ScriptDir2%
but it still shows the same error message
did i miss any steps or do anything wrong?

Neresho
Posts: 2
Joined: 21 Apr 2021, 05:23

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

Post by Neresho » 28 Mar 2022, 15:20

Hello,
I was looking for a solution since a long time, I tried many things (by trying to debug it by myself)
And with A_ScriptDir2, it seems to be a blank value (cf : https://ibb.co/tDXp4jd) (DirTo := A_ScriptDir2) (I've also tried with DirTo = %A_ScriptDir2% and not working too) (Even if I use A_ScriptDir2\exe\Keygen_moi.exe)

henriquehassi
Posts: 24
Joined: 29 Jul 2020, 17:11

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

Post by henriquehassi » 08 Apr 2022, 09:13

hello @feiyue i was looking your script, and its amazing, but i have one doubt, i already encrypted my script, and how can i decrypt that? i saw that have one part in your code to decrypt, but how i use that correctly?

homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

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

Post by homezonebenny » 13 Apr 2022, 12:21

I have a script which will be compiled to an .exe file.
But this script needs to put a "sdelete64.exe" file into the user %temp% path.

You do that with:

Code: Select all

FileInstall, sdelete64.exe, %temp%\sdelete64.exe, 1
But if you Encrypt this script now with the method of this post, nothing happening anymore.

There will be no file in:

Code: Select all

%temp%\sdelete64.exe
You can replicate this with any other .exe file for example.
Compile a script with the code above and a dummy.exe and execute the compilede.exe file.
This will put your dummy.exe into %temp%!
But if you encode it, and then compile it, nothing happens!


And the normal compiled.exe got a different "right click menu" see image:
Image
The normal one only got 3 menu points, "Suspend Hotkeys", "Pause", "Exit".
That's what I want.
The encrypted variant gets the WHOLE Autohotkey menu stuff, I try to prevent...

Any ideas?


Basically the normal compile method is great, putting my "sdelete64.exe" into users %temp% folder and the menu only got those 3 points!
BUT it's decompile able with payload.dll where this posts encrypt comes into play.
But those 2 issues are stopping me from completing the mission. :cry:

feiyue
Posts: 348
Joined: 08 Aug 2014, 04:08

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

Post by feiyue » 14 Apr 2022, 04:18

1. Release file: Do not use FileInstall in the source file, but use FileInstall in the encrypted script.

2. Customize tray menu: First clear the default menu, and then add custom menus.

Code: Select all

Menu, Tray, NoStandard
Menu, Tray, Add, Suspend Hotkeys, MySuspend
Menu, Tray, Add, Pause Script, MyPause
Menu, Tray, Add, Exit, MyExit
MySuspend() {
  Suspend
}
MyPause() {
  Pause,, 1
}
MyExit() {
  ExitApp
}

homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

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

Post by homezonebenny » 14 Apr 2022, 11:17

Wow, thanks for the quick response!

If you open the compiled .exe file with Notepad++ you can find something like this in it:

Code: Select all

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:v3="urn:schemas-microsoft-com:asm.v3"><assemblyIdentity version="1.1.00.00" name="AutoHotkey" type="win32" />
Do you know how to change the

Code: Select all

name="AutoHotkey"
to something else since this could give a hint what this program is or better said how to decompile?!

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

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

Post by TAC109 » 14 Apr 2022, 17:17

See the compiler directive :arrow: UpdateManifest. This directive needs to be processed by Ahk2Exe and so must be in the source that is processed by the compiler.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

lhgqcvxacdapecceuq
Posts: 1
Joined: 26 Apr 2022, 11:06

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

Post by lhgqcvxacdapecceuq » 26 Apr 2022, 11:20

writes that I was successful and where can I find this file encrypt?
because he didn't show up.
https://ibb.co/mBsJyZT screenshot
Attachments
ahkx.png
ahkx.png (6.52 KiB) Viewed 6314 times

underbe
Posts: 3
Joined: 26 Apr 2022, 18:31

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

Post by underbe » 22 May 2022, 13:07

ive read this whole thread and seen a few people ask but i didnt really understand the answers... can someone hold my hand and explain how to find the running files name please? unencrypted i can use A_ScriptName but once encrypted it seems to return random character as previous users have said.

here is an example of the code ive been having issues with.
postdata=
(
{
"content": "%A_ScriptName% STOPPED on server %ServerName% (%ServerIP%) by %A_UserName% (%A_ComputerName%)"
}
)

feiyue
Posts: 348
Joined: 08 Aug 2014, 04:08

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

Post by feiyue » 24 May 2022, 21:58

EnvGet, file, My_ScriptFullPath
global A_ScriptFullPath2:=file
global A_ScriptDir2:=RegExReplace(file, "\\[^\\]*$")
global A_ScriptName2:=RegExReplace(file, "^.*\\")

underbe
Posts: 3
Joined: 26 Apr 2022, 18:31

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

Post by underbe » 25 May 2022, 15:18

tyvm sir

GiandosoG
Posts: 2
Joined: 28 May 2022, 08:38

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

Post by GiandosoG » 28 May 2022, 18:41

@feyue

Please help me. I'm not able to fit your script together with Laszlo in any way. I tried to do what you said at the beginning of this topic and I couldn't. The script does not load. an example of part of my script is like this:

Code: Select all

F1::
vaidnv:
Random, tempoLoop, 36093, 37141
Loop % tempoLoop
{
	PixelSearch, x, y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xD8385A,, RGB Fast  ; marcação tiuzin cor runelite FFEA274C
	if (ErrorLevel = 0)
	{
		Random, movimentoMouse, 10, 12
		SetMouseDelay, %movimentoMouse%
		auxX:= x+random(1, 6)
		auxY:= y+random(7, 17)
		tempo(65, 90)
		Click, %auxX%, %auxY%
		
		ImageSearch, x, y, 414, 37, 751, 109, *15 C:\Users\user\Desktop\bot ahk\bot thiev\Knight ardy\+dobank.png ;reconhece q ta no bank
		if (ErrorLevel = 0)
		{	
			Send, {Esc}
		}
	}
[Mod edit: [code][/code] tags added.]

and I already inserted Laszlo's script in it. Please help me

sama
Posts: 1
Joined: 29 Aug 2022, 06:17

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

Post by sama » 29 Aug 2022, 06:25

#Include xxx.ahk

不包括任何文件.

User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

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

Post by ibieel » 07 Sep 2022, 00:37

is there any way to allow the encrypted script to run on "SingleInstance, OFF" ?
I already changed in every script, but it keeps closing what is already open to open another one.

wyrover
Posts: 3
Joined: 19 May 2015, 20:50

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

Post by wyrover » 03 Dec 2022, 02:24

有点费劲啊,ahk 源码有,自己编译一个,在关键函数上写一个 _asm {int 3} ,然后附加调试器调试, 断在关键函数加载脚本处,观察上下文,弄一个字节序列匹配,然后写个 hook 输出源码缓冲区。

关键功能还是 C++ 实现吧。

Post Reply

Return to “脚本函数”