Sign in to follow this  
Followers 0
qwert

How to use Obfuscator options to skip script section?

13 posts in this topic

I have a single line being flagged by Obfuscator ("Found Execute()Statement ... in _WinAPI_SetLayeredWindowAttributes).

How can I specify for Obfuscator to skip processing that one particular function? I tried including this statement at the top of my script:

#Obfuscator_Ignore_Funcs=_WinAPI_SetLayeredWindowAttributes

I also tried it directly in the WinAPI include file. Neither worked. I also tried backeting my own script with On/Off commands, which also did not work.

How are these Obfuscator options supposed to be used?

Thanks for any help.

Share this post


Link to post
Share on other sites



Just put it at the top of your script:

#Obfuscator_Ignore_Funcs=Execute

You shouldn't have to "ignore" the rest of the UDF function, just the Execute() within it.

:graduated:


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

Just put it at the top of your script:

#Obfuscator_Ignore_Funcs=Execute

You shouldn't have to "ignore" the rest of the UDF function, just the Execute() within it.

:graduated:

:( Are you sure?

This is the warning/Error generated by Obfuscator because it cannot be sure that this would work after Obfuscation:

-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.
>### current Func: _WinAPI_SetLayeredWindowAttributes
C:\Program Files (x86)\AutoIt3\include\WinAPI.au3(5364,1) Warning for line:$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2)) 

-#############################################################################################
-#### Obfuscator Found   1 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################

In this case I expect things to keep on working looking at the line but just simply test it.

Don't even know why Execute is used here.

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

I've had plenty of warnings from obfuscator about execute in the winapi udf, and also from call function when I've used it, but in my experience its never resulted in a broken exe.

So you are saying that everybody should just ignore the warning? ... I would think about it before ignoring to ensure you either do not use it at all or think about what Obfuscator does to the Strings/Variables between the brackets... simple example that breaks obfuscated that I have seen people use:

$a = "func"
For $x = 1 to 2
    Call("Func" & $x)
Next
Func Func1()
    Msgbox(1,"test1","test1")
EndFunc
Func Func2()
    Msgbox(1,"test2","test2")
EndFunc

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

Ouch. Does the #Obfuscator_Ignore_Funcs tag do anything at all? This gets the same error with or without the tag, and whether it calls out Execute or _Banzai. Am I missing what that's supposed to do?

#Autoit3Wrapper_Run_Obfuscator=y
#Obfuscator_Ignore_Funcs=Execute
; #Obfuscator_Ignore_Funcs=_Banzai

$vRET = _Banzai(0x00AABBCC)
MsgBox(64, "Test", "$vRET = " & $vRET)

Func _Banzai($i_transcolor)
    Local $iRET = Hex(String($i_transcolor), 6)
    $iRET = Execute('0x00' & StringMid($iRET, 5, 2) & StringMid($iRET, 3, 2) & StringMid($iRET, 1, 2))
    Return $iRET
EndFunc   ;==>_Banzai

:graduated:


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

Sure it does something :graduated:

Have a look at the previous posted example but now with an Ignore in there:

#obfuscator_ignore_funcs=Func1
$a = "func"
For $x = 1 to 2
    Call("Func" & $x)
Next
Func Func1()
    Msgbox(1,"test1","test1")
EndFunc
Func Func2()
    Msgbox(1,"test2","test2")
EndFunc

You will see that Obfuscator will not translate the Func1 name to something else and thus fix the problem for that function.

Obfuscator will still show a warning for the simple fact it doesn't know and unable to figure out whether something will break or not.

Does this make it any clearer?

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)

By the way: T0 fix the warning for your posted scriptlet you could do the following.

#obfuscator_ignore_funcs=_Banzai

$vRET = _Banzai(0x00AABBCC)
MsgBox(64, "Test", "$vRET = " & $vRET)

#obfuscator_off
Func _Banzai($i_transcolor)
    Local $iRET = Hex(String($i_transcolor), 6)
    $iRET = Execute('0x00' & StringMid($iRET, 5, 2) & StringMid($iRET, 3, 2) & StringMid($iRET, 1, 2))
    Return $iRET
EndFunc   ;==>_Banzai
#obfuscator_on

This assumes of course that there are many more lines to Obfuscate and only this bit is kinda untouched. :graduated:

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

So you are saying that everybody should just ignore the warning? ... I would think about it before ignoring to ensure you either do not use it at all or think about what Obfuscator does to the Strings/Variables between the brackets... simple example that breaks obfuscated that I have seen people use:

Not at all, I'm saying that a warning is just that, and it should alert the coder to something that could go wrong, not that it shouldnt be compiled.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Not at all, I'm saying that a warning is just that, and it should alert the coder to something that could go wrong, not that it shouldnt be compiled.

I was just making sure we give the right message and not tell people to ignore it but to test or think about it. :graduated:

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

Just put it at the top of your script: #Obfuscator_Ignore_Funcs=Execute

I added that just before the includes (immediately after the wrapper statments) and got exactly the same Error. BTW, I'm running Obfuscator v1.0.28.7.

Any suggestions? Can I turn off obfuscation for the entire WinAPI include file?

PS, I've read the additional dicussions since the first response and admit that they've left me a bit confused. In my mind, telling Obfuscator to ignore or skip sections of a script should take away the detection of the Execute() statement. Is that not true?

Share this post


Link to post
Share on other sites

I added that just before the includes (immediately after the wrapper statments) and got exactly the same Error. BTW, I'm running Obfuscator v1.0.28.7.

Any suggestions? Can I turn off obfuscation for the entire WinAPI include file?

PS, I've read the additional dicussions since the first response and admit that they've left me a bit confused. In my mind, telling Obfuscator to ignore or skip sections of a script should take away the detection of the Execute() statement. Is that not true?

This is were it become dangerous to give an answer because when you are not sure about what Obfuscator actually does, the risk increases you do something with the Directives that will disable a part of your script.

Just ignore the error as suggested, but only in this specific case!

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

FWIW, I have the exact same error, both in a script I'm currently working on, as well as one I wrote about a year ago. It doesn't seem to cause any problems running the compiled/obfuscated script, though. Presumably it would be a problem only if you were calling that particular function. In my case WinAPI.au3 is being included in GuiListVIew.au3. I suppose I could create a stripped down include file, but I'm too lazy to trace through all the calls... :x

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