Jump to content

Au3stripper odd behavior using #Au3Stripper_Ignore_Variables=


Rex
 Share

Recommended Posts

Hi

I have some odd behavior when using the ignore variables in au3stripper.

 

I have 3 scripts where i use winhttp.au3 to post info to a webpage, but for this to work when using the stripper some variables must be escaped

#Au3Stripper_Ignore_Variables= $sFieldId1, $sData1, $sFieldId2, $sData2, $sFieldId3, $sData3, $sFieldId4, $sData4, $sFieldId5, $sData5, $sFieldId6, $sData6, $sFieldId7, $sData7, $sFieldId8, $sData8, $sFieldId9, $sData9, $sFieldId10, $sData10
#Au3Stripper_Ignore_Variables= $sFieldId11, $sData11, $sFieldId12, $sData12, $sFieldId13, $sData13, $sFieldId14, $sData14, $sFieldId15, $sData15, $sFieldId16, $sData16, $sFieldId17, $sData17, $sFieldId18, $sData18, $sFieldId19, $sData19, $sFieldId20, $sData20
#Au3Stripper_Ignore_Variables= $sFieldId21, $sData21, $sFieldId22, $sData22, $sFieldId23, $sData23, $sFieldId24, $sData24, $sFieldId25, $sData25, $sFieldId26, $sData26, $sFieldId27, $sData27, $sFieldId28, $sData28, $sFieldId29, $sData29, $sFieldId30, $sData30
#Au3Stripper_Ignore_Variables= $sFieldId31, $sData31, $sFieldId32, $sData32, $sFieldId33, $sData33, $sFieldId34, $sData34, $sFieldId35, $sData35, $sFieldId36, $sData36, $sFieldId37, $sData37, $sFieldId38, $sData38, $sFieldId39, $sData39, $sFieldId40, $sData40

This works flawless in 2 of the scripts, but in the last the variables still gets renamed. More odd is it that using the ignore_functions works with no problem in the lass script?

I normally use ISI's autoit studio to code and compile, but the problem also exists in ScTie

 

I know that normally a script would be asked to be posted, but the script that fails is +2600 lines, and contains personal and private information's

The major difference between the 2 scripts that works and the one that fails is that I have images included as base64 strings.

I even have tried to compile on different computers (win7 / win10).

I hope that some one might point me in the direction of how to get the ignore_variables to work in the last script

 

Cheers

/Rex

Edited by Rex
Link to comment
Share on other sites

  • Developers
1 hour ago, Rex said:

I know that normally a script would be asked to be posted, but the script that fails is +2600 lines, and contains personal and private information's

mmm.. guess my only recommendation is not to use au3stripper then. ;)
Seriously, one can't expect me to do debugging without a replication script.

1 hour ago, Rex said:

I normally use ISI's autoit studio to code and compile, but the problem also exists in ScTie

My guess is he's using my utilities in his setup which I'am not a fan of.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I was afraid of that :(

But just did a debug of my own, it seems that when using #Au3Stripper_Ignore_Funcs=_WinHttpSimpleFormFill the #Au3Stripper_Ignore_Variables= don't kick in

 

Cheers

/Rex

Link to comment
Share on other sites

Hmm while testing and debugging i found some other odd thing

The one script that works, has for some unknown reason been saved as UTF-8, no BOM, that script contains some ASCII in a include witch is in ANSI

the ASCII displays correct when not using the stripper, but when using the stripper it gets converted into "???"

I fixed that by converting the files to UTF-8

I have created a simple sample, though I couldn't get it to replicate the whole not rename vars, only some of the vars did get renamed

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/tl /pe /sf /sv /rm
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Au3Stripper_Ignore_Funcs=_WinHttpCloseHandle
#Au3Stripper_Ignore_Funcs=_WinHttpSimpleFormFill
#Au3Stripper_Ignore_Funcs=_WinHttpConnect
#Au3Stripper_Ignore_Funcs=_WinHttpOpen
#Au3Stripper_Ignore_Funcs=__WinHttpDefault
#Au3Stripper_Ignore_Funcs=_WinHttpQueryOption
#Au3Stripper_Ignore_Funcs=_WinHttpSimpleSSLRequest
#Au3Stripper_Ignore_Funcs=_WinHttpSimpleRequest
#Au3Stripper_Ignore_Funcs=__WinHttpAttribVal
#Au3Stripper_Ignore_Funcs=_WinHttpCrackUrl
#Au3Stripper_Ignore_Funcs=__WinHttpFormAttrib
#Au3Stripper_Ignore_Funcs=__WinHttpURLEncode
#Au3Stripper_Ignore_Funcs=__WinHttpTrimBounds
#Au3Stripper_Ignore_Funcs=__WinHttpFinalizeCtrls
#Au3Stripper_Ignore_Funcs=__WinHttpFileContent
#Au3Stripper_Ignore_Funcs=_WinHttpSimpleReadData
#Au3Stripper_Ignore_Funcs=__WinHttpFormSend
#Au3Stripper_Ignore_Variables= $sFieldId1, $sData1, $sFieldId2, $sData2, $sFieldId3, $sData3, $sFieldId4, $sData4, $sFieldId5, $sData5, $sFieldId6, $sData6, $sFieldId7, $sData7, $sFieldId8, $sData8, $sFieldId9, $sData9, $sFieldId10, $sData10
#Au3Stripper_Ignore_Variables= $sFieldId11, $sData11, $sFieldId12, $sData12, $sFieldId13, $sData13, $sFieldId14, $sData14, $sFieldId15, $sData15, $sFieldId16, $sData16, $sFieldId17, $sData17, $sFieldId18, $sData18, $sFieldId19, $sData19, $sFieldId20, $sData20
#Au3Stripper_Ignore_Variables= $sFieldId21, $sData21, $sFieldId22, $sData22, $sFieldId23, $sData23, $sFieldId24, $sData24, $sFieldId25, $sData25, $sFieldId26, $sData26, $sFieldId27, $sData27, $sFieldId28, $sData28, $sFieldId29, $sData29, $sFieldId30, $sData30
#Au3Stripper_Ignore_Variables= $sFieldId31, $sData31, $sFieldId32, $sData32, $sFieldId33, $sData33, $sFieldId34, $sData34, $sFieldId35, $sData35, $sFieldId36, $sData36, $sFieldId37, $sData37, $sFieldId38, $sData38, $sFieldId39, $sData39, $sFieldId40, $sData40
#include "WinHttp.au3"

Opt("MustDeclareVars", 1)

Global $hOpen, $hConnect
Global $sRead, $hFileHTM, $sFileHTM = @ScriptDir & "\Form.htm"

; Example 2:
; 1. Open w3schools forms page (http://www.w3schools.com/html/html_forms.asp)
; 2. Fill form on that page with these values/conditins:
; - form is to be identified by its index -0-
; - set -Miyake- and -Issey- data to input boxes. Locate input boxes by their names -firstname- and -lastname-

; Initialize and get session handle
$hOpen = _WinHttpOpen()
; Get connection handle
$hConnect = _WinHttpConnect($hOpen, "w3schools.com")
; Fill form on this page
$sRead = _WinHttpSimpleFormFill($hConnect, "html/html_forms.asp", "index:0", "name:firstname", "Miyake", "name:lastname", "Issey")
; Close connection handle
_WinHttpCloseHandle($hConnect)
; Close session handle
_WinHttpCloseHandle($hOpen)

If $sRead Then
    MsgBox(64 + 262144, "Done!", "Will open returned page in your default browser now." & @CRLF & _
            "You should see 'Miyake Issey' somewhere on that page.")
    $hFileHTM = FileOpen($sFileHTM, 2)
    FileWrite($hFileHTM, $sRead)
    FileClose($hFileHTM)
    ShellExecuteWait($sFileHTM)
EndIf

Gives me this

Func _WinHttpSimpleFormFill(ByRef $5, $1o = Default, $1p = Default, $1q = Default, $1r = Default, $1s = Default, $1t = Default, $sFieldId3 = Default, $sData3 = Default, $sFieldId4 = Default, $sData4 = Default, $sFieldId5 = Default, $sData5 = Default, $sFieldId6 = Default, $sData6 = Default, $sFieldId7 = Default, $sData7 = Default, $sFieldId8 = Default, $sData8 = Default, $sFieldId9 = Default, $sData9 = Default, $sFieldId10 = Default, $sData10 = Default, $sFieldId11 = Default, $sData11 = Default, $sFieldId12 = Default, $sData12 = Default, $sFieldId13 = Default, $sData13 = Default, $sFieldId14 = Default, $sData14 = Default, $sFieldId15 = Default, $sData15 = Default, $sFieldId16 = Default, $sData16 = Default, $sFieldId17 = Default, $sData17 = Default, $sFieldId18 = Default, $sData18 = Default, $sFieldId19 = Default, $sData19 = Default, $sFieldId20 = Default, $sData20 = Default, $sFieldId21 = Default, $sData21 = Default, $sFieldId22 = Default, $sData22 = Default, $sFieldId23 = Default, $sData23 = Default, $sFieldId24 = Default, $sData24 = Default, $sFieldId25 = Default, $sData25 = Default, $sFieldId26 = Default, $sData26 = Default, $sFieldId27 = Default, $sData27 = Default, $sFieldId28 = Default, $sData28 = Default, $sFieldId29 = Default, $sData29 = Default, $sFieldId30 = Default, $sData30 = Default, $sFieldId31 = Default, $sData31 = Default, $sFieldId32 = Default, $sData32 = Default, $sFieldId33 = Default, $sData33 = Default, $sFieldId34 = Default, $sData34 = Default, $sFieldId35 = Default, $sData35 = Default, $sFieldId36 = Default, $sData36 = Default, $sFieldId37 = Default, $sData37 = Default, $sFieldId38 = Default, $sData38 = Default, $sFieldId39 = Default, $sData39 = Default, $sFieldId40 = Default, $sData40 = Default)
#forceref $1q, $1r, $1s, $1t, $sFieldId3, $sData3, $sFieldId4, $sData4, $sFieldId5, $sData5, $sFieldId6, $sData6, $sFieldId7, $sData7, $sFieldId8, $sData8, $sFieldId9, $sData9, $sFieldId10, $sData10
#forceref $sFieldId11, $sData11, $sFieldId12, $sData12, $sFieldId13, $sData13, $sFieldId14, $sData14, $sFieldId15, $sData15, $sFieldId16, $sData16, $sFieldId17, $sData17, $sFieldId18, $sData18, $sFieldId19, $sData19, $sFieldId20, $sData20
#forceref $sFieldId21, $sData21, $sFieldId22, $sData22, $sFieldId23, $sData23, $sFieldId24, $sData24, $sFieldId25, $sData25, $sFieldId26, $sData26, $sFieldId27, $sData27, $sFieldId28, $sData28, $sFieldId29, $sData29, $sFieldId30, $sData30
#forceref $sFieldId31, $sData31, $sFieldId32, $sData32, $sFieldId33, $sData33, $sFieldId34, $sData34, $sFieldId35, $sData35, $sFieldId36, $sData36, $sFieldId37, $sData37, $sFieldId38, $sData38, $sFieldId39, $sData39, $sFieldId40, $sData40

The $sFieldId1 and $sFieldID2  still gets renamed same goes for $sData1 and $sData2

just for some testing I added a ignore function, for a non existing function (#Au3Stripper_Ignore_Funcs=_Resource_SetToCtrlID) and this gave the result

Func _WinHttpSimpleFormFill(ByRef $5, $1o = Default, $1p = Default, $1q = Default, $1r = Default, $1s = Default, $1t = Default, $1u = Default, $1v = Default, $1w = Default, $1x = Default, $1y = Default, $1z = Default, $sFieldId6 = Default, $sData6 = Default, $sFieldId7 = Default, $sData7 = Default, $sFieldId8 = Default, $sData8 = Default, $sFieldId9 = Default, $sData9 = Default, $sFieldId10 = Default, $sData10 = Default, $sFieldId11 = Default, $sData11 = Default, $sFieldId12 = Default, $sData12 = Default, $sFieldId13 = Default, $sData13 = Default, $sFieldId14 = Default, $sData14 = Default, $sFieldId15 = Default, $sData15 = Default, $sFieldId16 = Default, $sData16 = Default, $sFieldId17 = Default, $sData17 = Default, $sFieldId18 = Default, $sData18 = Default, $sFieldId19 = Default, $sData19 = Default, $sFieldId20 = Default, $sData20 = Default, $sFieldId21 = Default, $sData21 = Default, $sFieldId22 = Default, $sData22 = Default, $sFieldId23 = Default, $sData23 = Default, $sFieldId24 = Default, $sData24 = Default, $sFieldId25 = Default, $sData25 = Default, $sFieldId26 = Default, $sData26 = Default, $sFieldId27 = Default, $sData27 = Default, $sFieldId28 = Default, $sData28 = Default, $sFieldId29 = Default, $sData29 = Default, $sFieldId30 = Default, $sData30 = Default, $sFieldId31 = Default, $sData31 = Default, $sFieldId32 = Default, $sData32 = Default, $sFieldId33 = Default, $sData33 = Default, $sFieldId34 = Default, $sData34 = Default, $sFieldId35 = Default, $sData35 = Default, $sFieldId36 = Default, $sData36 = Default, $sFieldId37 = Default, $sData37 = Default, $sFieldId38 = Default, $sData38 = Default, $sFieldId39 = Default, $sData39 = Default, $sFieldId40 = Default, $sData40 = Default)
#forceref $1q, $1r, $1s, $1t, $1u, $1v, $1w, $1x, $1y, $1z, $sFieldId6, $sData6, $sFieldId7, $sData7, $sFieldId8, $sData8, $sFieldId9, $sData9, $sFieldId10, $sData10

Now even more vars got renamed

 

Hope this helps

Ohh btw, first of I thought that using the ignore function would prevent everything in that function to be processed by the stripper, but it's only the function name that don't get renamed.

Just an idea, could a #ignore_in_this_Function maybe be added - where using that the entire function and vars would be excluded.

I tried to use the #Au3Stripper_Off and #Au3Stripper_On before the includes, but that just gave a lot of errors from au3check

Cheers

/Rex

Edited by Rex
Link to comment
Share on other sites

  • Developers

2 more questions/requests: 

  • Which version of au3stripper are you using?
  • Please PM me your version of winhttp.au3 include as the current download version has different fieldnames.

I do see I have set an arbitraty max number of ignore variables to 100 so that could be the limit you encounter, but will test that ones I have all correct code.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Glad the current Beta already solved this issue.
I will up the max ignore variable to 500 and like to say you can also ignore the variables with a mask like this:

#Au3Stripper_Ignore_Variables= $sFieldId*, $sData*

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi jos

Yeah I saw that in the help file :$

But with the beta, I have a new problem :'(

In one of my scripts I use listview an have there for included #include <ListViewConstants.au3>

But when stripping with the beta i get this (I removed the /rm parameter to get the correct variable names)

warning: $LVNI_ABOVE: possibly used before declaration.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\ids registrering\TaskManagement_stripped.Au3"(345,54) : warning: $LVNI_BELOW: possibly used before declaration.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE, $LVNI_BELOW,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(345,68) : warning: $LVNI_TOLEFT: possibly used before declaration.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE, $LVNI_BELOW, $LVNI_TOLEFT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\LFF Tids registrering\TaskManagement_stripped.Au3"(345,83) : warning: $LVNI_TORIGHT: possibly used before declaration.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE, $LVNI_BELOW, $LVNI_TOLEFT, $LVNI_TORIGHT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(365,42) : warning: $LVCFMT_RIGHT: possibly used before declaration.
Local $aAlign[3] = [0x0000, $LVCFMT_RIGHT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(365,58) : warning: $LVCFMT_CENTER: possibly used before declaration.
Local $aAlign[3] = [0x0000, $LVCFMT_RIGHT, $LVCFMT_CENTER]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(345,41) : error: $LVNI_ABOVE: undeclared global variable.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(345,54) : error: $LVNI_BELOW: undeclared global variable.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE, $LVNI_BELOW,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(345,68) : error: $LVNI_TOLEFT: undeclared global variable.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE, $LVNI_BELOW, $LVNI_TOLEFT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(345,83) : error: $LVNI_TORIGHT: undeclared global variable.
Local $aSearch[5] = [0x0000, $LVNI_ABOVE, $LVNI_BELOW, $LVNI_TOLEFT, $LVNI_TORIGHT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(365,42) : error: $LVCFMT_RIGHT: undeclared global variable.
Local $aAlign[3] = [0x0000, $LVCFMT_RIGHT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"X:\Tids registrering\TaskManagement_stripped.Au3"(365,58) : error: $LVCFMT_CENTER: undeclared global variable.
Local $aAlign[3] = [0x0000, $LVCFMT_RIGHT, $LVCFMT_CENTER]

But they are defined in the constants include

Global Const $LVCFMT_CENTER = 0x0002
Global Const $LVCFMT_RIGHT = 0x0001
Global Const $LVNI_ABOVE = 0x0100
Global Const $LVNI_BELOW = 0x0200
Global Const $LVNI_TOLEFT = 0x0400
Global Const $LVNI_TORIGHT = 0x0800

There is no problem with the old stripper (16.306.1237.0)

Cheers
/Rex

 

Edited by Rex
Typede listbox when should be listview
Link to comment
Share on other sites

  • Developers

Well... you know the drill: Give me a scriptlet that replicates the issue and I'll have a look. ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...