Jump to content
Sign in to follow this  
this-is-me

@Jos, Obfuscator /striponly problems and Au3Stripper future

Recommended Posts

this-is-me

I am interested in using Obfuscator with the /striponly option to reduce the size of an output file. I use obfuscator exclusively through AutoIt3Wrapper, where I can't see output of obfuscator to see if there are problems. A few of my scripts are showing issues. This is a short example of how the problem happens.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

_SetTimeout(2000, Bugme, 5)

Sleep(5000)

Func Bugme($number)
    MsgBox(0,$number,"bugged")
EndFunc

Func _SetTimeout($time, $func, $param1)
    Sleep($time)
    Call(FuncName($func), $param1)
EndFunc

The output from Au3Check on the Obfuscated file is as so:

 

"C:Users-----Desktoptest_Obfuscated.au3"(1,24) : error: Bugme(): undefined function.

_SetTimeout(2000, Bugme,
~~~~~~~~~~~~~~~~~~~~~~~^
C:Users-----Desktoptest_Obfuscated.au3 - 1 error(s), 0 warning(s)

Which means that Obfuscator removed Bugme.

Will this happen when Au3Stripper replaces Obfuscator?


Who else would I be?

Share this post


Link to post
Share on other sites
Zedna

There are two possible problems with your script:

1) missing apostrophes around Bugme

try _SetTimeout(2000, 'Bugme', 5)
instead of _SetTimeout(2000, Bugme, 5)
 

2) try to add: #Obfuscator_Ignore_Funcs=BugMe

 

So I think this is NOT bug of obfuscator

EDIT:

I'm not familiar with new AutoIt's syntax so maybe those missing apostrophes are "by purpose".

If so then ignore my post ...

Edited by Zedna

Share this post


Link to post
Share on other sites
mLipok

A few of my scripts are showing issues. This is a short example of how the problem happens.

 

Did you try:

#Obfuscator_Ignore_Funcs=_SetTimeout, Bugme

or

#Obfuscator_Off

#Obfuscator_On

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Run_Obfuscator=y
;~ #Obfuscator_Ignore_Funcs=_SetTimeout, Bugme
#Obfuscator_Parameters=/striponly
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

_SetTimeout(2000, Bugme, 5)

Sleep(5000)

#Obfuscator_Off
Func Bugme($number)
    MsgBox(0, $number, "bugged")
EndFunc   ;==>Bugme

Func _SetTimeout($time, $func, $param1)
    Sleep($time)
    Call(FuncName($func), $param1)
EndFunc   ;==>_SetTimeout
#Obfuscator_On

 

Will this happen when Au3Stripper replaces Obfuscator?

 

Very interesting question.


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library
 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites
Jos

Au3stripper is able to handle the new Bugme() func notation but obviously not the Call() statement.

 

D:DevelopmentAutoIt3programstesttest.au3(16,1) Warning for line:Call(FuncName($func), $param1)

 

Jos


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

Share this post


Link to post
Share on other sites
this-is-me

Au3stripper is able to handle the new Bugme() func notation but obviously not the Call() statement.

 

Jos

I am sorry to say I don't know what might be wrong with the call statement. Is it formatted incorrectly, or are you simply saying that it will throw an ignorable error?


Who else would I be?

Share this post


Link to post
Share on other sites
FireFox

Use this syntax instead :

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

_SetTimeout(2000, "Bugme", 5)

Sleep(5000)

Func Bugme($number)
    MsgBox(0,$number,"bugged")
EndFunc

Func _SetTimeout($time, $func, $param1)
    Sleep($time)
    Call($func, $param1)
EndFunc

There is no reason to use FuncName in anyway...


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
DatMCEyeBall

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

_SetTimeout(2000, Bugme, 5)

Sleep(5000)

Func Bugme($number)
    MsgBox(0,$number,"bugged")
EndFunc

Func _SetTimeout($time, $func, $param1)
    Sleep($time)
    $func($param1)
EndFunc


"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Share this post


Link to post
Share on other sites
Jos

I am sorry to say I don't know what might be wrong with the call statement. Is it formatted incorrectly, or are you simply saying that it will throw an ignorable error?

There is no syntax error but Obfuscator (and au3stripper) have no way to determine the value of the variable ... hence the warning.

This has been explained too many time by me to go in further details. ;)

Jos

Edited by Jos

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

Share this post


Link to post
Share on other sites
this-is-me

@Jos et al, Thanks for your help.

@Zedna, @Firefox, The reason I use the function name without quotes is for ease of access in SciTE4AutoIt3. If you quote the function you can't do a CTRL+J to jump to the function. Unquoted functions can be jumped to.


Who else would I be?

Share this post


Link to post
Share on other sites
FireFox

Then use the syntax DatMCEyeBall showed :)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
this-is-me

@FireFox, nice idea, but I can also add more parameters with a CallArgArray if I use call instead of $func(). See an example:
 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

_SetTimeout(2000, MsgBox, param(0, "bugged", "hello"))

Sleep(5000)

Func _SetTimeout($time, $func, $param1)
    Sleep($time)
    Call($func, $param1)
EndFunc



Func param($1=0, $2=0, $3=0, $4=0, $5=0, $6=0, $7=0, $8=0, $9=0, $10=0, $11=0, $12=0, $13=0, $14=0, $15=0, $16=0, $17=0, $18=0, $19=0, $20=0, $21=0, $22=0, $23=0, $24=0, $25=0, $26=0, $27=0, $28=0, $29=0, $30=0, $31=0, $32=0, $33=0, $34=0, $35=0, $36=0, $37=0, $38=0, $39=0, $40=0, $41=0, $42=0, $43=0, $44=0, $45=0, $46=0, $47=0, $48=0, $49=0, $50=0, $51=0, $52=0, $53=0, $54=0, $55=0, $56=0, $57=0, $58=0, $59=0, $60=0, $61=0, $62=0, $63=0, $64=0, $65=0, $66=0, $67=0, $68=0, $69=0, $70=0, $71=0, $72=0, $73=0, $74=0, $75=0, $76=0, $77=0, $78=0, $79=0, $80=0, $81=0, $82=0, $83=0, $84=0, $85=0, $86=0, $87=0, $88=0, $89=0, $90=0, $91=0, $92=0, $93=0, $94=0, $95=0, $96=0, $97=0, $98=0, $99=0, $100=0)
    Local $arr[@NumParams + 1] = ["CallArgArray"]
    For $i = 1 To @NumParams
        $arr[$i] = Eval($i)
    Next
    Return $arr
EndFunc

EDIT: removed funcname

Edited by this-is-me

Who else would I be?

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  

×