Jump to content

WHY IS AUTOIT'S SIZE IS BIG??


Recommended Posts

I'm using these settings to get smallest exe size:

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
...

upx.exe --ultra-brute is very slow but it creates smallest exe files with UPX.

BR,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Few milliseconds lost because of that is irrelevant since this is AutoIt.

If packing then pack the best or don't pack at all.

Compressing exes make sense. Compressing dlls (made for public use) makes very little sense. The best, or just one, example of this stupidity is bass.dll.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

@Jos

Before I go there, doesn't /sf simply sort the functions?

If that's all it's doing then it still isn't the answer. I need to get only the required functions from the UDFs and add those to the bottom of the script (sorted or not) but I need it done to the script not just to the compiled file (hence compile time directives are no good here). I remember years ago someone wrote a script to do exactly that but I can't find it anymore, even though it will probably need some serious updating by now.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

@Jos

Before I go there, doesn't /sf simply sort the functions?

If that's all it's doing then it still isn't the answer. I need to get only the required functions from the UDFs and add those to the bottom of the script (sorted or not) but I need it done to the script not just to the compiled file (hence compile time directives are no good here). I remember years ago someone wrote a script to do exactly that but I can't find it anymore, even though it will probably need some serious updating by now.

Running Tidy with /SF will indeed "only" sort all Func's in alphabetic order and move to the bottom of the script source, but I said you needed to run Obfuscator first with /SOI to strip all unused Funcs and Global variables from all included files and after run Tidy on the Obfuscator generated file.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Running Tidy with /SF will indeed "only" sort all Func's in alphabetic order and move to the bottom of the script source, but I said you needed to run Obfuscator first with /SOI to strip all unused Funcs and Global variables from all included files and after run Tidy on the Obfuscator generated file.

Jos

Thanks Jos.

Is this correct?

$sObf = "C:\Program Files\AutoIt3\SciTE\Obfuscator\Obfuscator.exe"
ShellExecute($sObf, "/SOI")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

Thanks Jos.

Is this correct?

$sObf = "C:\Program Files\AutoIt3\SciTE\Obfuscator\Obfuscator.exe"
ShellExecute($sObf, "/SOI")

This should be close to run both steps in by one script creating a new output script:

$ScriptSource = "Test.au3"
$ScriptStrippedSource = "Test_Stripped.au3"  ; Don't make this the same name as input!!!!!
;
$sObf = @ProgramFilesDir & "\AutoIt3\SciTE\Obfuscator\Obfuscator.exe"
ShellExecuteWait($sObf, '"' & $ScriptSource & '" /SOI')
;Copy Stripped source to target
FileCopy(StringTrimRight($ScriptSource, 4) & "_Obfuscated.au3",$ScriptStrippedSource,1)
;Run Tidy on stripped target
$sObf = @ProgramFilesDir & "\AutoIt3\SciTE\tidy\tidy.exe"
ShellExecuteWait($sObf, '"' & $ScriptStrippedSource & '" /SF')
Exit

Jos :idea:

Edited by Jos
Fixed Script name in source

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This should be close to run both steps in by one script creating a new output script:

$ScriptSource = "Test.au3"
$ScriptStrippedSource = "Test_Stripped.au3"  ; Don't make this the same name as input!!!!!
;
$sObf = @ProgramFilesDir & "\AutoIt3\SciTE\Obfuscator\Obfuscator.exe"
ShellExecuteWait($sObf, '"' & @ScriptFullPath & '" /SOI')
;Copy Stripped source to target
FileCopy(StringTrimRight($ScriptSource, 4) & "_Obfuscated.au3",$ScriptStrippedSource,1)
;Run Tidy on stripped target
$sObf = @ProgramFilesDir & "\AutoIt3\SciTE\tidy\tidy.exe"
ShellExecuteWait($sObf, '"' & $ScriptStrippedSource & '" /SF')
Exit

Jos :idea:

Thank you.

With just a bit of minor cleanup and the use of another script I have, I finally achieved the desired result. All of my Global Constants are at the top of my script and all of the used functions at the bottom and all is now well with the world again.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

It baffles me why people complain about of one of the most important feature of AutoIt. So the size may be construed as large even for ‘small’ scripts some people have not idea about the big picture. I am not bagging anyone but you have to understand AutoIt has applications far outside simple scripting.

Trade off for larger than expected scrips is execution of an exe with no pre-installation requirements. The statement “Having each compiled script capable of acting as a full-interpreter is a very powerful feature” is a gross understatement. (Statement taken from AutoItNotOnToDoList)

When professionals’ work within customer / customer simulated environments or embedded environments the requirement for clean systems or known-good-states is paramount. If the environment is compromised then so is testing.

I have created an embedded OS (like XP but with 1/3 of the OS removed) specifically created for custom hardware and was able to run automated system tests! I have also run automated system tests in virtual PCs and on production systems – pre-release because an AutoIt exe is self contained.

Looking at other tools like QTP, which are really data driven capture/replay, look at the cost and installation requirements – AutoIt is unmatched!

I do plead this feature remains!

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Compressing dlls (made for public use) makes very little sense.

This one caught my eye... so, when does the decompression of a dll take place? This shouldn't be a problem if I open the dll at the beginning of the script, loop through the calls and then close it at the end... or am I assuming this wrong?
Link to comment
Share on other sites

This one caught my eye... so, when does the decompression of a dll take place? This shouldn't be a problem if I open the dll at the beginning of the script, loop through the calls and then close it at the end... or am I assuming this wrong?

The unpacking loop is invoked when the dll is attached to the process, so if you are using dllopen (which you are) this only happens once, However using dllcall with a filename instead of a handle on a packed library means the unpacking process happens every time the function is called because the lib is attached and detached every time.

sorry for stating the obvious KaFu, I am pretty sure yours was a rhetorical question really. :mellow:

Vlad

Edited by Mobius

wtfpl-badge-1.png

Link to comment
Share on other sites

sorry for stating the obvious KaFu, I am pretty sure yours was a rhetorical question really. :party:

Not really :party:, but exactly as I assumed... but that's the way with assumptions :mellow:, better have it confirmed, thanks :P .
Link to comment
Share on other sites

  • Moderators

Mobius,

And I was happy to learn something! :mellow: Thanks Vlad.

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

 

Link to comment
Share on other sites

This is not true.

Reference count is important.

Reference count is only used when more than one process opens a dll. If it closes it, then the reference count goes back down.

If it was used like DllCall("mydll.dll", ...) then it will be opened, called, and closed. Reference = 1, reference = 0.

Link to comment
Share on other sites

Reference count is only used when more than one process opens a dll. If it closes it, then the reference count goes back down.

If it was used like DllCall("mydll.dll", ...) then it will be opened, called, and closed. Reference = 1, reference = 0.

What if I do:

DllOpen("mydll.dll")

DllCall("mydll.dll", ...)

?

♡♡♡

.

eMyvnE

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...