Jump to content

Workaround found: Unexpected behaviour of AU3Stripper


 Share

Recommended Posts

Hello World,

after using AutoIt3 v3.3.10.2 till now - a new PC was needed.
New PC, never been in touch with AutoIt before, new Userprofile - no connection, except The Sources from the SVN and some(many) User-includes.

After trying for hours - to compile some of our scripts - we can not get it to work.

As some things have changed over time (Constants-Names in the original Includes)
we changed our scripts to reflect the new names.

+>17:52:34 AU3Check ended.rc:0
>Running Au3Stripper (21.316.1639.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper cmdline: /Beta
- 2.44 Iteration 1 Strip Functions result: Output  10078 lines, stripped 19620 Func lines and 20353 Commentlines
- 8.11 Iteration 2 Strip Variables result: Output  3561 lines and stripped 6517 lines
- 8.34 Iteration 3 Strip Variables result: Output  3305 lines and stripped 256 lines
- 8.53 Iteration 4 Strip Variables result: Output  3289 lines and stripped 16 lines
- 8.72 Iteration 5 Strip Variables result: Output  3288 lines and stripped 1 lines
+> Source    51198 lines 2358898 Characters.
+> Stripped  26410 Func/Var lines and  20353 comment lines, Total 2221425 Characters.
+> Saved     91% lines 94% Characters.

But as soon as we use the Au3Stripper - before, we were using a somewhat "thrown together" Version to keep the obfuscator solely for stripping - we get many variables, which ARE declared in the different includes, reported as "possibly used before declaration"

When scambling around the order of the includes, the falsely as "missing" reported variables change.
i mean - they ARE missing in the *_stripped.au3 ... but they should'nt be missing.
Like $GUI_SHOW or $GUI_HIDE which are used in the source with a standard GuiCtrlSetState-Command
image.thumb.png.5ed6e7beeaba26cd5d5f9ad037bf5777.png

The Main-Scripts do have (partly User-)includes, in which other - needed - includes are included, and so on.

The used functions are all making it into the *_stripped.au3
Many Constants are missing in the _stripped.au3 - but they are used !

i am still trying to build something to have a reproducer, but it might have to do with the pure SIZE of the Projects.

Which steps can i use to further narrow down the problem?

Edited by KnutJ

rsRVpv.gif

Link to comment
Share on other sites

Found a workaround myself.

There were DLLCallback-Functions and their corresponding variables. which i advised the AU3Stripper to ignore, by excluding them and using #AU3Stripper_Off / _On pairs.

This did not work too well, therefore i inserted a "never-gonna be executed"  block in which all the vars and functions are listed that would otherwise be removed:

If 1=2 then ; ### FAKE IF-Block to trick AU3Stripper, so that the function and the variables LOOK like they are being used - but will never be executed.
    __LcFOD_Callback_Proc()
    $hFOD_Callback =0
    $iFOD_SetTimer =0
EndIf


If someone should ever encounter such behaviour/result - just use a never-executes-if-block.... and document it properly :)
i spent a total of ~ 4 hours ... to find out qhat was going on ... because teh undeclared vars were NOT those vars and not even in the same area of the source/includes.

Edited by KnutJ

rsRVpv.gif

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...