Proph Posted October 14, 2007 Share Posted October 14, 2007 (edited) It works perfectly now. Thanks Jos! Edit: BTW, Do these exist in v1.0.21? #Obfuscator_Ignore_Funcs= #Obfuscator_Ignore_Variables= I tried to test them but during compile it says they do not exist. Edit2: I ignored the warnings that these do not exist and tested anyways. It works! Very well in fact. I will be testing it some more this week. I will keep you posted. As for the warnings I suppose they are only there because these new features are only in the testing stages and are not yet officially a part of obfuscator. Edited October 14, 2007 by Proph Link to comment Share on other sites More sharing options...
rover Posted November 12, 2007 Share Posted November 12, 2007 I had a problem with OnAutoItStart causing a runtime error I found a solution by editing the obfuscated script, but other posts in this thread indicate OnAutoItStart is now supported. (i.e. function isn't renamed, string declaration moved into top of functions etc.) is this fix I came up with or something like it supposed to be done by the obfuscator code and somethings not working on my AutoIt/SciTe install? compiled on 2 pc's with same versions of AutoIt3/SciTe/Obfuscator Using: AutoIt3 v3.2.8.1, Obfuscator.exe v1.0.22.0, SciTE4AutoIt3 v1.74 09092007 full install reproducer example from the help file illustrates this on my system. #AutoIt3Wrapper_Run_Obfuscator=y MsgBox(0,"","first statement") ;#Obfuscator_Off ; works if I use #Obfuscator_Off and #Obfuscator_On or comment out all lines in OnAutoItStart in this and any other script Func OnAutoItStart() MsgBox(0,"","Before first statement") EndFunc ;#Obfuscator_OnoÝ÷ ÙÊ&¦)^uì^éÞ«^²»§¶)zºè®g¬±¨ªê-.)ÞÔJ뢵Z®&ë¬yÜ"¶.µ·¢^rV«yÚ®¢Ùèzºè®È§9·î±Æ¢²èߺǵç¡×¢{(é²Æ y«¢+ÙèÀäÈíAɽɴ¥±ÌÀäÈíÕѽ%ÐÌÀäÈíáµÁ±ÌÀäÈí½äµÑÍÑ}=ÕÍѹÔÌ Ü¤èôôÐìYÉ¥±ÕÍݥѡ½ÕÐ¥¹±É¸è)±½°ÀÌØíMÐÄÀÀÜÀÈÄÁõÑÀÀÀÀÐÌÁ ÀÌØí=ÍlÁàÍt¤°ÀÌØíMÉÀÀàÀÀäÀÐõÑÀÀÀÀÐÌÁ ÀÌØí=ÍlÁàÑt¤)±½°ÀÌØíMÐÄÀÀÜÀÈÄÁõÑÀÀÀÀÐÌÁ¡xII=oÝ÷ Ù§³zºè¯^iÝ)Þ¡ûazߺǵçlr¸©¶+¢v)í éÀºÚµ+Z®×îËb¢z-êðǴߣ¬jºÚÊ+'ßÛi¢¥j×o 8M4Óôl!zs§ëh"Ôj»kº{»-jëh×6global $Os A4C0000430D2() global $SA6300503C1D=A4C0000430D($Os[0x1]),$SA0800604E30=A4C0000430D($Os[0x2]) MsgBox(Number($SA6300503C1D),"",$SA0800604E30 ) Func OnAutoItStart() A4C0000430D2() ; works without error after I manually copy 2nd line of script to here and compile If Not Isdeclared("SSOnAutoItStart") Then Global $SA410070210D=A4C0000430D($Os[0x3]),$SA2F00800904=A4C0000430D($Os[0x4]) Global $SSOnAutoItStart=0x01 EndIF MsgBox(Number($SA410070210D),"",$SA2F00800904 ) EndFunc Func A4C0000430D2() FileInstall('oby-test.au3.tbl',Execute(A4C0000430D("4074656D70646972"))&A4C0000430D("5C4F74"),1) Global $Os = StringSplit(FileRead(Execute(A4C0000430D("4074656D70646972"))&A4C0000430D("5C4F74")),'O',1) Local $fl = FileGetSize(Execute(A4C0000430D("4074656D70646972"))&A4C0000430D("5C4F74")) Local $fh = FileOpen(Execute(A4C0000430D("4074656D70646972"))&A4C0000430D("5C4F74"),2) For $x = 1 to $fl/10 FileWrite($fh,'0000000000') Next FileClose($fh) FileDelete(Execute(A4C0000430D("4074656D70646972"))&A4C0000430D("5C4F74")) EndFunc ; ; snip ; I see fascists... Link to comment Share on other sites More sharing options...
Developers Jos Posted November 12, 2007 Author Developers Share Posted November 12, 2007 (edited) I will have a look at this ... Jos Edited November 12, 2007 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. Link to comment Share on other sites More sharing options...
rover Posted November 13, 2007 Share Posted November 13, 2007 I will have a look at this ...JosThanks Jos I see fascists... Link to comment Share on other sites More sharing options...
Developers Jos Posted November 13, 2007 Author Developers Share Posted November 13, 2007 Uploaded Obfuscator v 1.0.23 that fixes this issues. 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...
rover Posted November 13, 2007 Share Posted November 13, 2007 (edited) Uploaded Obfuscator v 1.0.23 that fixes this issues. JosThanks again Jos and thank you for your work on this easily learned well documented language Edited November 13, 2007 by rover I see fascists... Link to comment Share on other sites More sharing options...
Developers Jos Posted November 27, 2007 Author Developers Share Posted November 27, 2007 (edited) I have been playing with the thought of adding an option to remove all "Global" records from the inputscript and its includes since Obfuscator has this Information internally already available. As you (might) know, Obfuscator already has a switch /SF that will tell Obfuscator to remove the Unused Functions. This Beta version has 2 extra switches: /SV /StripUnusedVars 1 ; Remove All "Global ???" Lines when all declared variables are unused by the script. (Default = 0) /SO /StripOnly ; Set the options to: /SF /SV /CV=0 /CF=0 /CS=0 /CN=0 So when you add these lines to the top of your script: #AutoIt3Wrapper_run_obfuscator=y #Obfuscator_parameters=/striponly Obfuscator will Merge the Inputscript and the Included files into Scriptname_obfuscated.au3 and Strip all: - UnUsed Func 's - Unused Vars - Comments - Leading Spaces/Tabs This will substantially reduce the output EXE size. It will do a couple of Iterations that will first remove the unused Func. Then Iterate till there are no more Variables the remove. That normally takes 2 iterations. As Example this script: #include<date.au3> MsgBox(0,"Current Date",_Now()) Will produce a 323Kb exe. and this version:#AutoIt3Wrapper_run_obfuscator=y #Obfuscator_parameters=/striponly #include<date.au3> MsgBox(0,"Current Date",_Now()) Produces a 254 Kb exe. The Log in SciTE will show this information: >Running Obfuscator (1.0.24.0) from:C:\Program Files\AutoIt3\SciTE cmdline: - Iteration 1 Strip Functions result: Output 1573 lines and stripped 2510 lines - Iteration 2 Strip Variables result: Output 294 lines and stripped 1279 lines - Iteration 3 Strip Variables result: Output 287 lines and stripped 7 lines +> Source 13907 lines 785556 Characters. +> Stripped 3796 Func/Var lines and 9005 comment lines, Total 775381 Characters. +> Saved 92% lines 98% Characters. +> Obfuscator v1.0.24 finished created:C:\Development\winutil\AutoIt3\programs\OpenInSciTE\CapturedScripts\OpenInScite20_Obfuscated.au3 +>19:10:38 Obfuscator ended.rc:0 I need people to test this version and give me feedback before I will release it in the standard SciTE4AutoIt3 installer. Edited November 27, 2007 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. Link to comment Share on other sites More sharing options...
Dickb Posted November 27, 2007 Share Posted November 27, 2007 Hi Jos, I have run the obfuscator with the #AutoIt3Wrapper_run_obfuscator=y #Obfuscator_parameters=/striponlyparameters on a reasonably complex program. The program compiled without problems and still runs fine. It saved me 121627 bytes on the executable. I hope this helps. Thanks, Dick This are the results: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "C:\Scripts\Obf_Test.au3" +>23:15:14 Starting AutoIt3Wrapper GUI v.1.9.4 -> No changes made.. +>23:16:17 Starting AutoIt3Wrapper v.1.9.4 >Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3 +>23:16:17 AU3Check ended.rc:0 >Running Obfuscator (1.0.24.0) from:C:\Program Files\AutoIt3\SciTE cmdline: - Iteration 1 Strip Functions result: Output 4654 lines and stripped 6102 lines - Iteration 2 Strip Variables result: Output 2349 lines and stripped 2305 lines - Iteration 3 Strip Variables result: Output 2294 lines and stripped 55 lines - Iteration 4 Strip Variables result: Output 2287 lines and stripped 7 lines +> Source 25130 lines 1299282 Characters. +> Stripped 8469 Func/Var lines and 12916 comment lines, Total 1216517 Characters. +> Saved 85% lines 93% Characters. +> Obfuscator v1.0.24 finished created:C:\Scripts\Obf_Test_Obfuscated.au3 +>23:16:58 Obfuscator ended.rc:0 >Running AU3Check for obfuscated file(1.54.10.0) from:C:\Program Files\AutoIt3 +>23:16:58 AU3Check Obfuscated code ended.rc:0 >Running:(3.2.10.0):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe +>23:17:00 Aut2exe.exe ended.rc:0 ->Warning: This is an Unicode compiled script and will not run on Win9x/ME. +>23:17:01 RC.exe ended.rc:0 +>23:17:01 ResHacker ended.rc:0 >Running (3.1.0.0): C:\Program Files\AutoIt3\aut2exe\upx.exe +>23:17:02 UPX.exe ended.rc:0 >Updated the Source Version to:2.2.1.379... +>23:17:03 AutoIt3Wrapper Finished >Exit code: 0 Time: 109.028 Link to comment Share on other sites More sharing options...
Zedna Posted November 27, 2007 Share Posted November 27, 2007 (edited) I need people to test this version and give me feedback before I will release it in the standard SciTE4AutoIt3 installer.I tested it quickly:- it's quite slow --> dozens of seconds when included <A3LTreeView.au3> --> but that's information only not bug- removes #AutoIt3Wrapper_icon=someicon.ico directive from output _Obfuscated.script (but EXE has proper icon) - ??- there were no problems/errors with my scriptsThis is really awesome!! Good work.I don't need Project Manager tool anymore.Idea: Make some keyboard definition for placing#AutoIt3Wrapper_run_obfuscator=y#Obfuscator_parameters=/striponlyinto script (at cursor position) It's definition place in au3abbrev.properties Edited November 27, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Developers Jos Posted November 28, 2007 Author Developers Share Posted November 28, 2007 (edited) I tested it quickly:- it's quite slow --> dozens of seconds when included <A3LTreeView.au3> --> but that's information only not bugDoes a lot of processing but I am working on some optimization at this moment... but it will never be a lot faster since it reads all syntax lines and need to lex them all to find out what Funcs and Vars are really used... - removes #AutoIt3Wrapper_icon=someicon.ico directive from output _Obfuscated.script (but EXE has proper icon) - ??- there were no problems/errors with my scriptsThats simple because AutoIt3Wrapper reads all directives first before processing Obfuscator and knows what to add in the next steps Idea: Make some keyboard definition for placing#AutoIt3Wrapper_run_obfuscator=y#Obfuscator_parameters=/striponlyinto script (at cursor position) It's definition place in au3abbrev.propertiesCould be done... Mhz is maintaining the standard abbreviations file and helpfile page till now although I have not seen him around much lately . Edited November 28, 2007 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. Link to comment Share on other sites More sharing options...
Proph Posted November 29, 2007 Share Posted November 29, 2007 Holy sh!t !!! My original exe without obfuscation was 476 KB After Obfuscation using the new beta switch my file size is only 332 KB !!! You are amazing Jos! Allthough when I view the ScriptName_Obfuscated.au3 afterwards it doesn't look very Obfuscated anymore. Is this normal? So then I compiled my script using the new ScriptName_Obfuscated.au3 using the obfuscator without /striponly which creates a new ScriptName_Obfuscated_Obfuscated.au3 that is Obfuscated and the new file size is now only 485 KB. which is still very much smaller than an original exe compiled with the Obfuscator. Thanks a lot. BTW I notice that Scite still complains about: #Obfuscator_Ignore_Funcs and #Obfuscator_Ignore_Variables= being Invalid Compiler directives even though they seem to function perfectly (even with using the /striponly switch. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 29, 2007 Author Developers Share Posted November 29, 2007 (edited) Holy sh!t !!!My original exe without obfuscation was 476 KBAfter Obfuscation using the new beta switch my file size is only 332 KB !!!You are amazing Jos!Allthough when I view the ScriptName_Obfuscated.au3 afterwards it doesn't look very Obfuscated anymore. Is this normal?So then I compiled my script using the new ScriptName_Obfuscated.au3 using the obfuscator without /striponly which creates a new ScriptName_Obfuscated_Obfuscated.au3 that is Obfuscated and the new file size is now only 485 KB. which is still very much smaller than an original exe compiled with the Obfuscator.Thanks a lot.That is what /Striponly does... only strip the script.Use: /sv /sf (or /StripUnusedFunc /StripUnusedVars) to Strip and do the standard Obfuscation ...BTW I notice that Scite still complains about:#Obfuscator_Ignore_Funcs and #Obfuscator_Ignore_Variables= being Invalid Compiler directives even though they seem to function perfectly (even with using the /striponly switch. You mean they don't show up in the AutoComplete dropdown box and down color correctly? .... will fix that in the AutoitInstaller tables.Jos Edited November 29, 2007 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 29, 2007 Author Developers Share Posted November 29, 2007 Does a lot of processing but I am working on some optimization at this moment... but it will never be a lot faster since it reads all syntax lines and need to lex them all to find out what Funcs and Vars are really used...Uploaded v 1.0.24.1 which has some speed improvement for the different steps but it will still be "slow"since it has to process each line to find out if Funcs or Vars are used in Functions like IsDeclared(), GUICtrlSetOnEvent ( controlID, "function" ) ect...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...
Proph Posted December 5, 2007 Share Posted December 5, 2007 1.0.24.1 Gives me an invalid Func name when I try to use it. But 1.0.24.0 seems to work fine. I think 1.0.24.1 is a tad quicker... but 1.0.24.0 seemed to be a tad smaller in final file size. I can't zip up the source right this second but I will send it to you later if you need it. Thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted December 5, 2007 Author Developers Share Posted December 5, 2007 1.0.24.1 Gives me an invalid Func name when I try to use it. But 1.0.24.0 seems to work fine. I think 1.0.24.1 is a tad quicker... but 1.0.24.0 seemed to be a tad smaller in final file size. I can't zip up the source right this second but I will send it to you later if you need it. ThanksWould appreciate if you can zip it for me and send me the 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...
Developers Jos Posted December 9, 2007 Author Developers Share Posted December 9, 2007 (edited) Updated the Beta Obfuscator fixing an issue with "Global " lines that have continuation characters at the end.http://www.autoitscript.com/autoit3/scite/.../Obfuscator.zip Edited December 9, 2007 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. Link to comment Share on other sites More sharing options...
Drew Posted May 1, 2008 Share Posted May 1, 2008 Works beautifully. Great job. Link to comment Share on other sites More sharing options...
Zedna Posted May 13, 2008 Share Posted May 13, 2008 Sorry JosI posted Obfuscator BUG report at wrong place.It's here Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Developers Jos Posted May 13, 2008 Author Developers Share Posted May 13, 2008 Sorry JosI posted Obfuscator BUG report at wrong place.It's hereI saw it already. There is an updated version in the Beta directory that should fix this problem.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...
Zedna Posted May 13, 2008 Share Posted May 13, 2008 I saw it already. There is an updated version in the Beta directory that should fix this problem.JosThanks. It's OK and also OnAutoItStart() works OK. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts