#2524 closed Bug (Fixed)
#Obfuscator_Parameters=/mo - issue and script line on AutoIt Error message
| Reported by: | mlipok | Owned by: | Jos |
|---|---|---|---|
| Milestone: | Component: | SciTE4AutoIt | |
| Version: | Other | Severity: | None |
| Keywords: | Cc: |
Description
Pseudo repro code:
#AutoIt3Wrapper_Run_Obfuscator=Y #Obfuscator_Parameters=/mo ;~ #include <ie.au3> Global _; Com Error Handler Status Strings $IEComErrorNumber, _ $IEComErrorNumberHex, _ $IEComErrorDescription, _ $IEComErrorScriptline, _ $IEComErrorWinDescription, _ $IEComErrorSource, _ $IEComErrorHelpFile, _ $IEComErrorHelpContext, _ $IEComErrorLastDllError, _ $IEComErrorComObj, _ $IEComErrorOutput Local $aTest $sInfo = _ 'test1' & @CRLF & _ 'TEST2' ConsoleWrite($aTest[2]) $sInfo2 = _ 'test1' & @CRLF & _ 'TEST2'
now
#Obfuscator_Parameters=/mo
create that something
Global _ $IEComErrorNumber, $IEComErrorNumberHex, $IEComErrorDescription, $IEComErrorScriptline, $IEComErrorWinDescription, $IEComErrorSource, $IEComErrorHelpFile, $IEComErrorHelpContext, $IEComErrorLastDllError, $IEComErrorComObj, $IEComErrorOutput Local $aTest $sInfo = 'test1' & @CRLF & 'TEST2' ConsoleWrite($aTest[2]) $sInfo2 = 'test1' & @CRLF & 'TEST2'
but Obfuscator.exe should generate code in this way:
Global $IEComErrorNumber, $IEComErrorNumberHex, $IEComErrorDescription, $IEComErrorScriptline, $IEComErrorWinDescription, $IEComErrorSource, $IEComErrorHelpFile, $IEComErrorHelpContext, $IEComErrorLastDllError, $IEComErrorComObj, $IEComErrorOutput Local $aTest $sInfo = 'test1' & @CRLF & 'TEST2' ConsoleWrite($aTest[2]) $sInfo2 = 'test1' & @CRLF & 'TEST2'
SUMMARY:
These scripts are only examples - that is an easy way to show where the problem is.
But in order to show the result of the problem, I will present a different example:
Try to compile this
#AutoIt3Wrapper_Run_Obfuscator=Y #Obfuscator_Parameters=/mo #include <ie.au3> Local $aTest ConsoleWrite($aTest[2])
Run that exe file.
and you got something like this:
AutoIt Error OK Line 2573 (File "L:\TEST_obfuscator_3.exe"): Error: Subscript used with non-Array variable.
but this is not true - I mean the correct line is 2577.
When you look to obfuscated file, then you see that the problem is in:
Global _ $IEComErrorNumber, $IEComErrorNumberHex, $IEComErrorDescription, $IEComErrorScriptline, $IEComErrorWinDescription, $IEComErrorSource, $IEComErrorHelpFile, $IEComErrorHelpContext, $IEComErrorLastDllError, $IEComErrorComObj, $IEComErrorOutput Global Enum _ $_IEStatus_Success = 0, $_IEStatus_GeneralError, $_IEStatus_ComError, $_IEStatus_InvalidDataType, $_IEStatus_InvalidObjectType, $_IEStatus_InvalidValue, $_IEStatus_LoadWaitTimeout, $_IEStatus_NoMatch, $_IEStatus_AccessIsDenied, $_IEStatus_ClientDisconnected Global Enum Step * 2 _ $_IENotifyLevel_None = 0, $_IENotifyNotifyLevel_Warning = 1, $_IENotifyNotifyLevel_Error, $_IENotifyNotifyLevel_ComError Global Enum Step * 2 _ $_IENotifyMethod_Silent = 0, $_IENotifyMethod_Console = 1, $_IENotifyMethod_ToolTip, $_IENotifyMethod_MsgBox
I mean:
Global _ Global Enum _ Global Enum Step * 2 _ Global Enum Step * 2 _
Attachments (0)
Change History (7)
comment:1 by , 12 years ago
| Version: | → Other |
|---|
comment:2 by , 12 years ago
I am confuse the compiledexample contains an error as $aTest[2] is not defined
comment:3 by , 12 years ago
This error is caused on purpose, and then after that to demonstrate how it is erroneously indicated line errors in the compiled EXE file.
comment:4 by , 12 years ago
I mean:
Run that exe file.
and you got something like this:
AutoIt Error OK Line 2573 (File "L:\TEST_obfuscator_3.exe"): Error: Subscript used with non-Array variable.
But this is not true - I mean the correct line is 2577.
This problem is caused by the bug, connecting lines
ie
Obfuscator.exe wrong in the event that combines line continuation character is the last character in the line, ie after the character following comments yet.
just like here:
Global _; Com Error Handler Status Strings $IEComErrorNumber, _ $IEComErrorNumberHex, _
As a result, the output file generated by Obfuscator.exe still contains the line continuation character, which results in the incorrect display of line numbers in messages like:
AutoIt Error OK Line 2573 (File "L:\TEST_obfuscator_3.exe"): Error: Subscript used with non-Array variable.
comment:5 by , 12 years ago
| Status: | new → accepted |
|---|
comment:7 by , 12 years ago
Thanks Jos
The problem I spent sleepless nights.
Now I will sleep peacefully.
I really appreciate the quick and so a positive response.
btw.
I see you also added the removal of redundant tabs.
I mean now is:
Global $IEComErrorNumber, $IEComErrorNumberHex, $IEComErrorDescription, $IEComErrorScriptline, $IEComErrorWinDescription, $IEComErrorSource, $IEComErrorHelpFile, $IEComErrorHelpContext, $IEComErrorLastDllError, $IEComErrorComObj, $IEComErrorOutput
and before that was:
Global _ $IEComErrorNumber, $IEComErrorNumberHex, $IEComErrorDescription, $IEComErrorScriptline, $IEComErrorWinDescription, $IEComErrorSource, $IEComErrorHelpFile, $IEComErrorHelpContext, $IEComErrorLastDllError, $IEComErrorComObj, $IEComErrorOutput

Automatic ticket cleanup.