Jump to content
Sign in to follow this  
4Eyes

Compiler option FileInclude Compression - wassat?

Recommended Posts

4Eyes

folks,

Can somebody please tell me what the compiler option 'FileInclude Compression' actually does beside make the code size smaller? What does it do to the exe file for the different settings of Lowest to Highest?

Thanks,

4Eyes

Share this post


Link to post
Share on other sites
Melba23

4Eyes,

Although not privy to the internal working of Aut2Exe, I understand the option to work this way. Using FileInstall includes the code of the required files within the compiled AutoIt executable. This setting determines the compression applied to the included code - basically a tradeoff between final size of the executable and the speed of extracting the file when installing it.

I seem to recall that in earlier versions of AutoIt this option referred to overall compression of the FileInstalled and script code - it is only when I looked just now that I saw it was labelled only "FileInstall Compression". The algorithm used is one devised by Jon ("Hardest thing I've written was the compression code used in Aut2Exe that I wrote from scratch").

Standing by to be corrected by Jon. :mellow:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
4Eyes

Melba23,

Thanks for your reply.

I was looking for a way to make the source code included in a compiled exe harder to read (of course obfuscated), should someone decide to do some hacking. I did some testing on this before posting with a simple 1 liner that pops a MsgBox. No includes and no FileInstalls. The resultant exe file does change size marginally when varying the 'FileInclude Compression' option, though. So, it makes me wonder what is going on.

Regards,

4Eyes

Share this post


Link to post
Share on other sites
Melba23

4Eyes,

a way to make the source code included in a compiled exe harder to read (of course obfuscated), should someone decide to do some hacking

Searching the forums will provide you with a lot more information in greater detail, but in brief:

- Your plain language script is within the compiled .exe, but in compressed form. It is not immediately viewable with a hex editor, but is by no means secure as it is expanded in memory when the .exe is run.

- Obfuscator (part of the full SciTE4AutoIt3 package) will obscure your script by changing variable and constant names (and a lot more!), which makes it harder to decompile but again does not render the .exe secure.

So, compiling an AutoIt script will prevent quick snooping, but a determined, experienced hacker can relatively easily get your source - including passwords, specific filenames, etc - or the encryption routines you have used in your script to encrypt/decrypt them if they are stored in another file. :)

JohnOne,

Obfuscation does not add anything to your script. It produces a new source file My_Script_Obfuscated.au3 based on the directives you use. It is this file which is passed to Aut2Exe for compilation. Of interest, it is this file which can help you with the dreaded "Error on Line ###" problem when running compiled files as all comments and blank lines are removed and all includes included - so the line number is valid within this file. :)

Both of you,

If you choose your Obfuscator directives to remove all unused constants and function from the include files (/StripOnly or /so) and/or to replace all variable and constant names with random 3-character trigraphs (/ObfuscateMinimum or /om) you can reduce the size of the executable file considerably. Bear in mind that if you want both of those options you need to spell it out fully (/sf /sv /om /cs=0 /cn=0) as Obfuscator looks no further than /so if that is included. :)

I hope that helps. :mellow:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
JohnOne

I once used something like resource hacker on an obfuscated compiled script, and it extracted some .tbl (or similar) file from it, so thats what I thought might cause the difference in size when the OP uses compression.

Saying that, I might have been looking at something totally different, it was over a year ago :mellow:

As always, thanks for your tips M23 :)


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Melba23

JohnOne,

I have been doing a little research and you are quite right - Obfuscator will FileInstall a .tbl file to the Temp folder if you set the encryption parameters. It is needed to decrypt the script when run. As I never set those parameters I have never seen it in any of my scripts. :)

Thanks for pushing me into a better understanding of Jos' excellent utility. :mellow:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
4Eyes

Thanks guys.

Knew most of what you wrote Melba23 but thanks again. Also knew about tbl file as I've been looking hard at this stuff.

Not that it makes a huge amount of difference but on my test script:

- highest compression made a 1.27MB exe and took 81.7 seconds (on a flash drive)

- normal made a 1.33MB exe and took 87 seconds

- lowest made a 1.61MB exe and took 97 seconds

It's really quite bizarre to see that higher compression is faster. Scratching head.... Maybe that effort that Jon put into the compression really paid off.

Regards to you both.

4Eyes

Share this post


Link to post
Share on other sites
SecretLanguage

Does this mean there is only one compiler setting or are there additional


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×