FileInstall Encapsulates files

Report problems with documented functionality
oeasyshuzj
Posts: 6
Joined: 14 Dec 2022, 21:49

FileInstall Encapsulates files

Post by oeasyshuzj » 14 Dec 2022, 23:51

The FileInstall script that compiles files of about 100MB is compressed by upx and converted to exe. If you open the file in a text editor, you can see the source code. This is not secure

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

Re: FileInstall Encapsulates files

Post by TAC109 » 15 Dec 2022, 17:11

If you want any progress on this, you will need to supply more information, such as an example script which shows this problem when compiled.
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

oeasyshuzj
Posts: 6
Joined: 14 Dec 2022, 21:49

Re: FileInstall Encapsulates files

Post by oeasyshuzj » 15 Dec 2022, 21:09

Code: Select all

;@Ahk2Exe-Cont "AutoToolGUI"
;@Ahk2Exe-UseResourceLang 0x0804
;@Ahk2Exe-AddResource D:\Total Commander\TOOLS\程序封装\提取到的图标\1.ico, 1    
;@Ahk2Exe-AddResource D:\Total Commander\TOOLS\程序封装\提取到的图标\1.ico, 159  
;@Ahk2Exe-AddResource D:\Total Commander\TOOLS\程序封装\提取到的图标\1.ico, 160  
;@Ahk2Exe-AddResource D:\Total Commander\TOOLS\程序封装\提取到的图标\1.ico, 206  
;@Ahk2Exe-AddResource D:\Total Commander\TOOLS\程序封装\提取到的图标\1.ico, 207  
;@Ahk2Exe-AddResource D:\Total Commander\TOOLS\程序封装\提取到的图标\1.ico, 208  
;@Ahk2Exe-Bin D:\Total Commander\TOOLS\AutoHotKey\AutoHotkeyU32.exe, D:\About_100MB_file-1.exe, CP65001
;@Ahk2Exe-ExeName D:\About_100MB_file-1.exe
;@Ahk2Exe-SetCompanyName [email protected]
;@Ahk2Exe-SetCopyright oeasy版权所有,盗用必纠
;@Ahk2Exe-SetDescription [email protected]
;@Ahk2Exe-SetFileVersion v1.0
;@Ahk2Exe-SetInternalName [email protected]
;@Ahk2Exe-SetLanguage 0x0804
;@Ahk2Exe-SetName [email protected]
;@Ahk2Exe-SetProductName [email protected]
;@Ahk2Exe-SetProductVersion 1.0.0.0
;@Ahk2Exe-SetVersion 0.0.1.0
#NoTrayIcon 
#SingleInstance force
username:="Administrator"
password:="123456"
password1:="234567"
password2:="345678"

FileCreateDir,C:\soft
FileInstall,D:\About_100MB_file.exe,C:\soft\About_100MB_file.exe,1
IF A_IsAdmin=1 
		Run,C:\soft\About_100MB_file.exe
try{
	RunAs,%username%, %password2%
	Run,C:\soft\About_100MB_file.exe
	ExitApp
}
try{
	RunAs,%username%, %password1%
	Run,C:\soft\About_100MB_file.exe
	ExitApp
}
try{
	RunAs,%username%, %password%
	Run,C:\soft\About_100MB_file.exe
	ExitApp
}
Last edited by lexikos on 15 Dec 2022, 21:42, edited 1 time in total.
Reason: Fixed codebox tags

oeasyshuzj
Posts: 6
Joined: 14 Dec 2022, 21:49

Re: FileInstall Encapsulates files

Post by oeasyshuzj » 15 Dec 2022, 22:31

About_100MB_file.exe is a program of about 100MB
This has been bothering me for a long time, both V1 and V2. UPX compression does not protect the source code, and MPRESS compression does not run

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

Re: FileInstall Encapsulates files

Post by TAC109 » 16 Dec 2022, 21:25

I have confirmed your findings. Unfortunately this is a UPX problem in that it appears not to be able to handle large resources, and is actually failing with Error 1. I’ll change Ahk2Exe to show an error message when this happens. As a suggestion, you may be able to compress your large file with a utility such as 7zip, and FileInstall the compressed file to avoid this problem.

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

oeasyshuzj
Posts: 6
Joined: 14 Dec 2022, 21:49

Re: FileInstall Encapsulates files

Post by oeasyshuzj » 16 Dec 2022, 21:44

Thanks for your reply! But I'm using autoit3 and I'm using upx and this won't happen. See if I can optimize it

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

Re: FileInstall Encapsulates files

Post by TAC109 » 19 Dec 2022, 16:59

@oeasyshuzj The problem with UPX seems to be related to the compressibility of the large FileInstall file. I ran a separate UPX test at the DOS prompt on an uncompressed compiled .exe and the 'failure' was because the resulting .exe was larger than the original.

You may have better luck if your large FileInstall file is more compressible.

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

oeasyshuzj
Posts: 6
Joined: 14 Dec 2022, 21:49

Re: FileInstall Encapsulates files

Post by oeasyshuzj » 19 Dec 2022, 19:07

@TAC109
It doesn't matter if it's not compressed. You may have noticed that my script contains the account password, which I don't want users to see!

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

Re: FileInstall Encapsulates files

Post by TAC109 » 19 Dec 2022, 19:39

@oeasyshuzj The point I’m trying to make is that if your 100mb file can be made compressible then UPX should be able to compress the compiled .exe, and so your script should not be viewable within the .exe. (As I don’t know what type of file this is I don’t know if this approach is possible.)

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

lexikos
Posts: 9599
Joined: 30 Sep 2013, 04:07
Contact:

Re: FileInstall Encapsulates files

Post by lexikos » 19 Dec 2022, 20:21

Are you concerned about someone viewing this 100MB+ file in a text editor and finding your password, but not concerned about them decompressing the exe and then doing the same?

Storing the password in your script will not be secure no matter what you do.

IIRC, AutoHotkey_H has script encryption that may be adequate for your purpose.

oeasyshuzj
Posts: 6
Joined: 14 Dec 2022, 21:49

Re: FileInstall Encapsulates files

Post by oeasyshuzj » 19 Dec 2022, 20:33

@lexikos

You understand very well, this is just to prevent some people who do not understand
It would be nice to have simple encryption options on the V1 compiler

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

Re: FileInstall Encapsulates files

Post by TAC109 » 02 Feb 2023, 18:29

@oeasyshuzj The new version of ScriptGuard might be useful as it will hide your script in the compiled .exe without requiring the use of a compressor such as UPX or MPRESS.

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

Post Reply

Return to “Bug Reports”