UEZ Posted May 20, 2010 Share Posted May 20, 2010 (edited) 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 May 24, 2010 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 More sharing options...
Shafayat Posted May 21, 2010 Share Posted May 21, 2010 Doesn't the ultra brute option slow down the loading of exe on runtime? [Not using this account any more. Using "iShafayet" instead] Link to comment Share on other sites More sharing options...
jvanegmond Posted May 21, 2010 Share Posted May 21, 2010 Doesn't the ultra brute option slow down the loading of exe on runtime?Yes, UPX needs to pack when compiling and then unpack at runtime of course. It's obvious that when you use a slower compression at compile time, there will also be a slower decompression at run time. github.com/jvanegmond Link to comment Share on other sites More sharing options...
trancexx Posted May 21, 2010 Share Posted May 21, 2010 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 More sharing options...
Shafayat Posted May 21, 2010 Share Posted May 21, 2010 If packing then pack the best or don't pack at all.- Thanks. That was illuminating. [Not using this account any more. Using "iShafayet" instead] Link to comment Share on other sites More sharing options...
GEOSoft Posted May 21, 2010 Share Posted May 21, 2010 @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 More sharing options...
Developers Jos Posted May 22, 2010 Developers Share Posted May 22, 2010 @JosBefore 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 More sharing options...
GEOSoft Posted May 22, 2010 Share Posted May 22, 2010 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 More sharing options...
Developers Jos Posted May 22, 2010 Developers Share Posted May 22, 2010 (edited) 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 Edited May 22, 2010 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 More sharing options...
GEOSoft Posted May 22, 2010 Share Posted May 22, 2010 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 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 More sharing options...
bo8ster Posted May 28, 2010 Share Posted May 28, 2010 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 More sharing options...
KaFu Posted May 28, 2010 Share Posted May 28, 2010 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? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Mobius Posted May 28, 2010 Share Posted May 28, 2010 (edited) 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. Vlad Edited May 28, 2010 by Mobius Link to comment Share on other sites More sharing options...
KaFu Posted May 28, 2010 Share Posted May 28, 2010 sorry for stating the obvious KaFu, I am pretty sure yours was a rhetorical question really. Not really , but exactly as I assumed... but that's the way with assumptions , better have it confirmed, thanks . OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 28, 2010 Moderators Share Posted May 28, 2010 Mobius, And I was happy to learn something! Thanks Vlad. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted May 29, 2010 Share Posted May 29, 2010 ...because the lib is attached and detached every time.This is not true.Reference count is important. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 29, 2010 Share Posted May 29, 2010 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 More sharing options...
trancexx Posted May 29, 2010 Share Posted May 29, 2010 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 More sharing options...
Richard Robertson Posted May 29, 2010 Share Posted May 29, 2010 What if I do:DllOpen("mydll.dll")DllCall("mydll.dll", ...)?Then you'd make me change my opinion of you as one of the better coders on this forum. Link to comment Share on other sites More sharing options...
trancexx Posted May 29, 2010 Share Posted May 29, 2010 Then you'd make me change my opinion of you as one of the better coders on this forum.And reference count thing? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now