Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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 Changed 6 years ago by TicketCleanup

  • Version set to Other

Automatic ticket cleanup.

comment:2 Changed 6 years ago by Jpm

I am confuse the compiledexample contains an error as $aTest[2] is not defined

comment:3 Changed 6 years ago by anonymous

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 Changed 6 years ago by anonymous

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 Changed 6 years ago by Jos

  • Status changed from new to accepted

comment:6 Changed 6 years ago by Jos

  • Resolution set to Fixed
  • Status changed from accepted to closed

Fixed in Beta v1.0.30.14

comment:7 Changed 6 years ago by mlipok

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.