Jump to content

Recommended Posts

Posted

Hey,

I've noticed that my script get relatively very big just when I add one extra function that requires an additional #Include. So, is there such a tool in here that would scan my script and then filter out the Globals and the constant included so that only the ones really needed remains?

I'm asking this because; first of all I want my script to be smaller in size (even if it was just for 100 KB, it worth it to my needs). Only if it would make it less in size, that is. And secondly, I believe that it would decrease the amount of false alarms that appears in AV's scans. Yeah, I've got a feeling that it's related to this matter somehow.

So, any ideas? :D

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

  • Moderators
Posted

Derak,

If you are using the full SciTE package (and if not, why not?) then add these lines to the beginning of your script:

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/SO

Then Jos' little marvel will strip out all unused functions and constants from your code.

Of course, remember that your script is a pretty small part of the .exe - the majority is the AutoIt stub. However, as a major grocery chain here says: "Every little helps!".

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:

  Reveal hidden contents

 

Posted (edited)

  Melba23 said:

Derak,

If you are using the full SciTE package (and if not, why not?) then add these lines to the beginning of your script:

#AutoIt3Wrapper_Run_Obfuscator=y
 #Obfuscator_Parameters=/SO

Then Jos' little marvel will strip out all unused functions and constants from your code.

Of course, remember that your script is a pretty small part of the .exe - the majority is the AutoIt stub. However, as a major grocery chain here says: "Every little helps!".

M23

I do use the full SciTE package all the time. Also, I always use this one

#AutoIt3Wrapper_Run_Obfuscator=y

But never heard of the other till now actually.

And it's doing the trick pretty well! ^^

After adding #Obfuscator_Parameters=/SO, my .exe got smaller by 130 KB :o

Thanks for you great help, Melba23. ^^

Do you know any extra methods that will get it even smaller in size? :D

For some technical reasons, I need my exe to be less than 250 KB and now it has reached 258 KB (almost there xD)

So, could there be extra things that I can still do to decrease the size even more?

Edited by Derak

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

  • Developers
Posted (edited)

  Derak said:

I do use the full SciTE package all the time. Also, I always use this one

#AutoIt3Wrapper_Run_Obfuscator=y

But never heard of the other till now actually.

And it's doing the trick pretty well! ^^

After adding #Obfuscator_Parameters=/SO, my .exe got smaller by 130 KB :D

Actually just running Obfuscator will increase the size as this Obfuscates the source which makes the source bigger.

The /SO (/StripOnly) option isn't really related to the Obfuscation process but it rather simple to implement as all the lexing for Variables and Functions was already in the program. Just felt the challenge of stripping out all unused Global variables and (Included) Funcs a nice challenge.

  Derak said:

So, could there be extra things that I can still do to decrease the size even more?

Not really... only older versions will lead to a smaller footprint.

The previous mentioned compression works only on included files by FileInstall().

Jos

Edited by 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.
  :)

Posted

  KaFu said:
Not doing any changes, I'm still at 258 KB.

Anyway, thanx for replying, KaFu. ^^

  Jos said:

Actually just running Obfuscator will increase the size as this Obfuscates the source which makes the source bigger.

I've thought like that a while ago, and tried to compile without Obfuscating.

The result were surprisingly negative!

The exe gets bigger by about 10 KB when it's not Obfuscated. :D

  Quote

The /SO (/StripOnly) option isn't really related to the Obfuscation process but it rather simple to implement as all the lexing for Variables and Functions was already in the program. Just felt the challenge of stripping out all unused Global variables and (Included) Funcs a nice challenge.

I've to admit, this /SO is the best thing I've learned today.

I was really annoyed by the fact that I have unused funcs included along with my script. >.<

You've done a perfect job with the /SO! :o

  Quote

Not really... only older versions will lead to a smaller footprint.

The previous mentioned compression works only on included files by FileInstall().

Jos

Too bad, then. :D

Well, thanx for your time and help, Jos. ^^

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

Posted

Hi,

one thing you can do is ...

writing a little script which renames all your variables like this

1 = $1

2 = $2

and so on. This way, you can strip some bytes :D

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

  • Developers
Posted

  Derak said:

I've thought like that a while ago, and tried to compile without Obfuscating.

The result were surprisingly negative!

The exe gets bigger by about 10 KB when it's not Obfuscated. :o

Ahh, you that person that is the exception and does a lot of inline commenting the source? :D

That could be the reason it becomes smaller as the whitespace and Comments are stripped. The Variable and Function names become longer in general and the obfuscated literal strings & number could become longer as well.

The /so does make a substantial difference as it will strip out up to 90%+ of the actual source size.

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.
  :)

Posted (edited)

  Xenobiologist said:

Hi,

one thing you can do is ...

writing a little script which renames all your variables like this

1 = $1

2 = $2

and so on. This way, you can strip some bytes :(

Mega

Sounds interesting to me :D

I will try it right away!

I kinda like making string split scripts. :P

I will reply back with the results as soon as I get them.

  Jos said:

Ahh, you that person that is the exception and does a lot of inline commenting the source? :D

That could be the reason it becomes smaller as the whitespace and Comments are stripped. The Variable and Function names become longer in general and the obfuscated literal strings & number could become longer as well.

The /so does make a substantial difference as it will strip out up to 90%+ of the actual source size.

Well, yeah.

I do include some comments, but space out a lot for the sake of organizing, you know. :o

And thanx for explaining the end result of obfuscating.

Edited by Derak

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

Posted

Sorry for double posting but I promised to post the results ^^

I've done some interesting tries as well: (all of them with \SO and obfuscator=y)

Xenobiologist's method: 253 KB (with obfuscator=n)

Using a different icon: 236 KB (By coincidence, the icon is taking some size!)

Target is archived here! (Less than 50 KB)

:D

The first icon I was using: 26.0 KB!

the second icon I'm using now: 4.73 KB xD

Compiling an empty script: 234 KB

Wow, 234 KB is way too big for an empty script. ^^

I've heard that I would get way smaller than that using other programming languages like C++.

As far as I can remember from my friend who codes in C++.

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

Posted

  Derak said:

Compiling an empty script: 234 KB

Wow, 234 KB is way too big for an empty script. ^^

I've heard that I would get way smaller than that using other programming languages like C++.

As far as I can remember from my friend who codes in C++.

'Compiling' as far as AutoIT is concerned is simply putting the script in one file along with the script interpreter. So basically, most of the code you are seeing is the AutoIT script interpreter.

C++ on the other hand is *not* an interpreted language, so it does compile into machine code, which doesn't require anything else to interpret it. HOWEVER, C++ does have libraries that are linked to it depending on the functions or framework you use, so those are included in the final size as well.

My contributions:

  Reveal hidden contents

Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFsProcess CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen)Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery

Wrappers/Modifications of others' contributions:

_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)

UDF's added support/programming to:

_ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne)

(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)

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
  • Recently Browsing   0 members

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