Sign in to follow this  
Followers 0
Baraoic

Obfuscator IE Error?

9 posts in this topic

Just wanted to report that when using the obfuscator that comes with scite it causes problems with IE. Specificly with _IEFormElementRadioSelect would not work but everything else I use did. I tested it many times trying different things and only cause that not to work, but the script would work normally.

Share this post


Link to post
Share on other sites



Post the code that you used.

Share this post


Link to post
Share on other sites

Just wanted to report that when using the obfuscator that comes with scite it causes problems with IE. Specificly with _IEFormElementRadioSelect would not work but everything else I use did. I tested it many times trying different things and only cause that not to work, but the script would work normally.

Hmm... the demo seems to break if you add obsfucator:
#AutoIt3Wrapper_Run_Obfuscator=y; Run Obfuscator before compilation. default=n
#include <IE.au3>

; *******************************************************
; Example 1 - Open a browser with the form example, get reference to form, select
;              each radio button byValue, then deselect the last item leaving none selected.
;              Note: You will likely need to scroll down on the page to see the changes
; *******************************************************
$oIE = _IE_Example ("form")
$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
For $i = 1 To 5
    _IEFormElementRadioSelect ($oForm, "vehicleAirplane", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleTrain", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleBoat", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleCar", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleCar", "radioExample", 0, "byValue")
    Sleep(1000)
Next

This presents the page, but the radio selection is on "Train" and never changes. Comment out the compiler directive for Obsfucator and it runs fine.

Tested on XP Pro SP3 with AutoIt 3.3.0.0.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The thing that is unique about _IEFormElementRadioSelect is that it uses Execute (line 1834):

Execute("$o_object.elements('" & $s_Name & "')")

It would be good to get Jos' feedback on this. I an not certain whether this is a regression or whether it ever worked... I did some testing with his obfuscator when it was forst released, but I doubt I tested this function specifically -- I know that I checked to insure that the Execute didn't trigger an error in the obfuscator, but didn't verify functionality.

Dale

Update: there are actually 3 functions that use Execute - _IEFormElementRadioSelect, _IEFormElementCheckboxSelect and _IEPropertyGet "vcard"

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

The thing that is unique about _IEFormElementRadioSelect is that it uses Execute (line 1834):

Execute("$o_object.elements('" & $s_Name & "')")

It would be good to get Jos' feedback on this. I an not certain whether this is a regression or whether it ever worked... I did some testing with his obfuscator when it was forst released, but I doubt I tested this function specifically -- I know that I checked to insure that the Execute didn't trigger an error in the obfuscator, but didn't verify functionality.

Dale

Update: there are actually 3 functions that use Execute - _IEFormElementRadioSelect, _IEFormElementCheckboxSelect and _IEPropertyGet "vcard"

Ouch. The help file for SciTE4AutoIt3, under the Obsfuscator tool, says:

What Obfuscator does:

Obfuscator will:

Read your script and Includes needed and create a new source file:

Rename Variable names.

Rename Func name.

Convert Strings to a Variable.

Convert Values to a Number(Variable).

Convert @Marcros to Execute(Variable)

Warn you about the use of these AutoIt3 Functions and in which File/Func/line they are used and the Parameter contains an Ampersand (&), since they will cripple the functioning of the script when used:

adlibenable()

call()

eval()

guiregistermsg()

guisetonevent()

guictrlsetonevent()

hotkeyset()

isdeclared()

trayitemsetonevent()

objevent()

Opt("OnExitFunc","OnAutoItExit")

Execute() is not on the list, but perhaps it will be now... :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanks for the reply's I didn't realize that that function used execute. I did know that you couldn't use Obfuscator with execute in the script because once I tried to double Obfuscate a script and it told me that it couldn't because it had execute in it.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Folks,

In general: Obfuscator will report that Execute could cause errors when used but probably assumes it isn't in this case. I haven't looked at the details yet but when I take the posted code it does report a bunch of Execute statements in "Func not used":

3.38 ** Error in Func not Used:

_IEFormElementCheckboxSelect-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.

>### current Func: _IEFormElementCheckboxSelect

C:\Program Files\AutoIt3\include\IE.au3(1706,1) Warning for line:$oItems = Execute("$o_object.elements('" & $s_Name & "')")

3.38 ** Error in Func not Used:

_IEFormElementRadioSelect-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.

>### current Func: _IEFormElementRadioSelect

C:\Program Files\AutoIt3\include\IE.au3(1834,1) Warning for line:$oItems = Execute("$o_object.elements('" & $s_Name & "')")

3.38 ** Error in Func not Used:

_IEPropertyGet-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.

>### current Func: _IEPropertyGet

C:\Program Files\AutoIt3\include\IE.au3(3291,1) Warning for line:$aVcard[1][$i] = Execute('$o_object.document.parentwindow.top.navigator.userProfile.getAttribute("' & $aVcard[0][$i] & '")')

3.38 ** Error in Func not Used:

_IEErrorHandlerRegister-### Obfuscation Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.

>### current Func: _IEErrorHandlerRegister

C:\Program Files\AutoIt3\include\IE.au3(3644,1) Warning for line:$oIEErrorHandler = ObjEvent("AutoIt.Error", $s_functionName)

3.38 ** Error in Func not Used:

__IEInternalErrorHandlerDeRegister-### Obfuscation Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.

>### current Func: __IEInternalErrorHandlerDeRegister

C:\Program Files\AutoIt3\include\IE.au3(4334,1) Warning for line:$oIEErrorHandler = ObjEvent("AutoIt.Error", $sIEUserErrorHandler)

(its all the way down in the Obfuscator.log)

I need to dig into the details but that won't happen today anymore... need some sleep first :)

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Add this parameter to the script and run Obfuscator again:

#Obfuscator_Parameters=/sf

It gives all the expected errors which were not shown without stripping the unused funcs parameter.

EDIT: I have uploaded an updated version to the Beta directory which will properly report the Execute() statement errors/warnings when /sf isn't specified.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

The thing that is unique about _IEFormElementRadioSelect is that it uses Execute (line 1834):

Execute("$o_object.elements('" & $s_Name & "')")

It would be good to get Jos' feedback on this. I an not certain whether this is a regression or whether it ever worked... I did some testing with his obfuscator when it was forst released, but I doubt I tested this function specifically -- I know that I checked to insure that the Execute didn't trigger an error in the obfuscator, but didn't verify functionality.

Dale

Update: there are actually 3 functions that use Execute - _IEFormElementRadioSelect, _IEFormElementCheckboxSelect and _IEPropertyGet "vcard"

A workaround for this "problem" is to add this line to the script to avoid Obfuscation of variable $o_object.

#Obfuscator_Ignore_Variables=$o_object

This will still generate the warnings but will resolve the problem in the posted example script.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0