KaFu Posted August 28, 2009 Share Posted August 28, 2009 Hiho, based on a discussion about variable length and execution speed I wondered what happens to the comments in my scripts when compiling the source? Are they stripped? Cheers 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...
jvanegmond Posted August 28, 2009 Share Posted August 28, 2009 I'm pretty sure they are stripped. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Zedna Posted August 28, 2009 Share Posted August 28, 2009 I'm pretty sure they are stripped.Yes. I agree. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
wraithdu Posted August 28, 2009 Share Posted August 28, 2009 Just tested, seems they are stripped, yes. Link to comment Share on other sites More sharing options...
trancexx Posted August 28, 2009 Share Posted August 28, 2009 What's to be agreed with? Speculation? You either know or not. It would be nice if one of the devs would answer the question. Btw, check Manadar's number of posts. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
wraithdu Posted August 28, 2009 Share Posted August 28, 2009 (edited) It's pretty easy to test. Just add an insane amount of comments to the script, compile, and see if the resulting EXE file's size changes appreciably. In my case, I added 40K of comments and the EXE size remained the same. Good enough for you? And what does Manadar's post count have to do with anything? Edited August 28, 2009 by wraithdu Link to comment Share on other sites More sharing options...
trancexx Posted August 28, 2009 Share Posted August 28, 2009 It's pretty easy to test. Just add an insane amount of comments to the script, compile, and see if the resulting EXE file's size changes appreciably. In my case, I added 40K of comments and the EXE size remained the same. Good enough for you?And what does Manadar's post count have to do with anything?What kind of comments? "#cs/#ce" or ";" or "#"Always a speculation.Look at the number of your posts, lol ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
wraithdu Posted August 28, 2009 Share Posted August 28, 2009 (edited) You can also compile to a3x and see what the resulting appended encrypted script is. It's obvious from that whenther there are comments in there. And I tested with ';' and #cs/#ce type comments. Both are stripped. EDIT - wow, read that out of context apparently. Edited August 28, 2009 by wraithdu Link to comment Share on other sites More sharing options...
jvanegmond Posted August 28, 2009 Share Posted August 28, 2009 (edited) This thread is the spawn of satan. Both 6666 posts being reached and 666 posts being reached.Edit: Clarified myself, sometimes I feel I've been struck with a confusion of tongues. Edited August 28, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
wraithdu Posted August 28, 2009 Share Posted August 28, 2009 LOL Link to comment Share on other sites More sharing options...
KaFu Posted August 28, 2009 Author Share Posted August 28, 2009 Huh, I let loose the devil ... thanks for your replies guys! 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...
trancexx Posted August 28, 2009 Share Posted August 28, 2009 You can also compile to a3x and see what the resulting appended encrypted script is. It's obvious from that whenther there are comments in there. And I tested with ';' and #cs/#ce type comments. Both are stripped. EDIT - wow, read that out of context apparently. Could you do it for this script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_Type=a3x #AutoIt3Wrapper_UseUpx=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** # Local $hResourcesExe = Run("Resources.exe -add -compile MyRes.dll -res SomeAnimated.gif -type GIF -name 1 -lang 0", "", @SW_HIDE, 6); $STDERR_CHILD + $STDOUT_CHILD # Local $sLine, $sLineError # # While 1 # $sLineError = StderrRead($hResourcesExe) # If @error Then ExitLoop # If $sLineError Then # ConsoleWrite($sLineError) # EndIf # Sleep(100) # WEnd # # While 1 # $sLine = StdoutRead($hResourcesExe) # If @error Then ExitLoop # If $sLine Then # ConsoleWrite($sLine) # EndIf # Sleep(100) # WEnd and this: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile_type=a3x #AutoIt3Wrapper_UseUpx=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
wraithdu Posted August 28, 2009 Share Posted August 28, 2009 End-of-line comments do not seem to be stripped (adding a really long one increases a3x size). But '#' are not valid comments, at least not according to the help file, even though Au3Check and the interpreter seem to ignore them. Only ';' and #cs/#ce are documented and stripped. Link to comment Share on other sites More sharing options...
trancexx Posted August 28, 2009 Share Posted August 28, 2009 End-of-line comments do not seem to be stripped (adding a really long one increases a3x size). But '#' are not valid comments, at least not according to the help file, even though Au3Check and the interpreter seem to ignore them. Only ';' and #cs/#ce are documented and stripped.If dev - Jos is using "#" to enter comments (from AutoIt's point of view) then I would say it can't be defined as invalid. AutoIt3Wrapper would call them "directives".Au3Check.exe uses "#" too. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Valik Posted August 28, 2009 Share Posted August 28, 2009 (edited) Pre-processor statements start with the # character, not comments. The AutoIt interpreter ignores pre-processor statements it doesn't recognize (rather than throwing an error). But they ARE NOT comments. Edited August 28, 2009 by Valik Link to comment Share on other sites More sharing options...
Nutster Posted August 28, 2009 Share Posted August 28, 2009 (edited) Pre-processor statements start with the # character, not comments. The AutoIt interpreter ignores pre-processor statements it doesn't recognize (rather than throwing an error). But they ARE NOT comments. Further to this statement. Comments begin with semi-colons ( ; ). If one of your pre-processor instructions actually matched a real pre-processor instruction, then that could cause the compiler to do weird things, depending on which on you actually matched. #This is supposed to be a comment #ce is used to end most comments. ; This is a real comment. AutoIt would fail on the second line, because there was no #cs before it. BTW, when you compile a script, the obfuscater strips all the comments, even ones at the end of lines. Edited August 28, 2009 by Nutster Smiley avoidance. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
WolfWorld Posted August 28, 2009 Share Posted August 28, 2009 (edited) Okay here, All comments are striped. This include #cs #ce ; But #Region and #EndRegion ARE NOT STRIPED. See before compile #Region #AutoIt3Wrapper_Res_Comment=asdas #AutoIt3Wrapper_Res_Description=asd #AutoIt3Wrapper_Res_Fileversion=dasdasdsa #AutoIt3Wrapper_Res_LegalCopyright=sdasd #EndRegion After Decompile #Region #AutoIt3Wrapper_Res_Comment=asdas #AutoIt3Wrapper_Res_Description=asd #AutoIt3Wrapper_Res_Fileversion=dasdasdsa #AutoIt3Wrapper_Res_LegalCopyright=sdasd #EndRegion In any such case these things should be remove also, at all cost because they are useless in the program. Edited August 28, 2009 by athiwatc Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
Nutster Posted August 28, 2009 Share Posted August 28, 2009 Okay here,All comments are striped.This include #cs #ce ;But #Region and #EndRegion ARE NOT STRIPPED.#Region is a preprocessor statement, not a comment. Because preprocessor statements can change the behaviour of the compiler, they have to be left in after the preprocessor is done its job.#cs - #ce and ; comments are recognized by the obfuscater and removed. Because the the obfuscater runs before the compiler, it must leave in all the other preprocessor statements for the compiler to deal with. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
KaFu Posted August 29, 2009 Author Share Posted August 29, 2009 #Region is a preprocessor statement, not a comment. Because preprocessor statements can change the behaviour of the compiler, they have to be left in after the preprocessor is done its job.Example:#forceref $hWnd, $Msg, $iIDTimer, $dwTimeused in timer callback functions, this statement is necessary for the callback to work, thus I assume it must not be stripped.#cs - #ce and ; comments are recognized by the obfuscater and removed. Because the the obfuscater runs before the compiler, it must leave in all the other preprocessor statements for the compiler to deal with.You mention the obfuscater... but what does the compiler do? I have some scripts using call() and isdecleared() which I can't preprocess before compiling using the obfuscater, so what does the standard au compiler do to the comments? And also what wraithdu mentionedEnd-of-line comments do not seem to be stripped (adding a really long one increases a3x size).is this true? 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...
WolfWorld Posted August 29, 2009 Share Posted August 29, 2009 (edited) In any case everyone should use Obfuscator anyway before you release. <<<< Final Mr.Wolf said so. All test. This explain that Obfuscator DOES remove some part and some part the compiler remove them by default. #region --- ScriptWriter generated code Start --- $test = "hi" #EndRegion #region $testttt = "hi" #EndRegion ;Hi $tests = "tetste" ; Hiiiiii #cs fsfrfrgd #ce After #Region - - - ScriptWriter generated code Start - - - $TEST = "hi" #EndRegion #Region $TESTTTT = "hi" #EndRegion $TESTS = "tetste" With Obfuscator (No obfuscate) $test = "hi" $testttt = "hi" $tests = "tetste" Clear by my water pool! Edited August 29, 2009 by athiwatc Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! 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