Jump to content

Obfuscator (discontinued)


Jos
 Share

Recommended Posts

I have found a BUG:

In one Script, I use a Callback.

When I obfuscate the Script, the Functionname is changed, but not the String used in DllCallbackRegister.

So I get an error, when I want to run the obfuscated Script / Exe

Thanks. It's OK and also OnAutoItStart() works OK.

Does it work, if you use Opt("SetOnExitFunc","..."), too? Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • Developers

I have found a BUG:

In one Script, I use a Callback.

When I obfuscate the Script, the Functionname is changed, but not the String used in DllCallbackRegister.

So I get an error, when I want to run the obfuscated Script / Exe

Does it work, if you use Opt("SetOnExitFunc","..."), too?

Post a working example that fails when Obfuscated and I will have a look. :)

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

Just using the DllcallbackRegister-Example:

CODE
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Run_Obfuscator=y

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

; Create callback function

$handle = DLLCallbackRegister ("_EnumWindowsProc", "int", "hwnd;lparam")

; Call EnumWindows

DllCall("user32.dll", "int", "EnumWindows", "ptr", DllCallbackGetPtr($handle), "lparam", 10)

; Delete callback function

DllCallbackFree($handle)

; Callback Procedure

Func _EnumWindowsProc($hWnd, $lParam)

If WinGetTitle($hWnd) <> "" And BitAnd(WinGetState($hWnd), 2) Then

$res = MsgBox(1, WinGetTitle($hWnd), "$hWnd=" & $hWnd & @CRLF & "lParam=" & $lParam & @CRLF & "$hWnd(type)=" & VarGetType($hWnd))

If $res = 2 Then Return 0 ; Cancel clicked, return 0 to stop enumeration

EndIf

Return 1 ; Return 1 to continue enumeration

EndFunc

Obfuscated error:

\test_callback_Obfuscated.au3 (4) : ==> Badly formatted "Func" statement.:

$A2300204537 = DLLCallbackRegister($A5000301244, $A3C00405721, $A1D00504602)

???????????????

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • Developers

Just add this row to Obfuscator.dat :)

dllcallbackregister,1,0

I will add it also for the next release.

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

Ahh, OK :) If I knew it was so easy...

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • 1 month later...

I'm getting a few errors

-### Obfuscation Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Tester\Second PC.au3(572,1) Warning for line:ObjEvent($SINK, "_CDROMCheck_") 

-### Obfuscation Error: Found GUICtrlSetOnEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Tester\Second PC.au3(3930,1) Warning for line:GUICtrlSetOnEvent($OSK_Layout[$i][0], $OSK_Click_N[$i]) 

-### Obfuscation Error: Found GUICtrlSetOnEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Tester\Second PC.au3(4187,1) Warning for line:GUICtrlSetOnEvent($recent_1[$i][0], "_Menu_Click_5_" & $i)

There are actually five more, but the function patterns are all the same. How can I fix these?

I've tried on Obfuscator v1.0.23.1 and v1.0.24.20

Edited by Champak
Link to comment
Share on other sites

  • Developers

I'm trying to obfuscate my script but I'm getting in the log:

!File contains records longer than 2047 ..  stopping process.

Is there anything I can do here?

Cheers :P

mmm... yes, make the record(s) shorter than 2047 would be the right answer I guess. :P 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

mmm... yes, make the record(s) shorter than 2047 would be the right answer I guess. :P

Well I can't make it shorter. Also, I'm not sure that I understand meaning of word record. I know what that word means itself, but what means in this case? Number of lines? Also, why this limit exist, can you extend it?

Cheers :P

Edited by igorm
Link to comment
Share on other sites

  • Moderators

Well I can't make it shorter. Also, I'm not sure that I understand meaning of word record. I know what that word means itself, but what means in this case? Number of lines? Also, why this limit exist, can you extend it?

Cheers :P

BCX has a limitation of 2048 characters for each string variables. I'm going to assume that Jos has written a function that checks the string length of a variable value, and if it is more than 2047 characters, it throws the exception error you are receiving.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

BCX has a limitation of 2048 characters for each string variables. I'm going to assume that Jos has written a function that checks the string length of a variable value, and if it is more than 2047 characters, it throws the exception error you are receiving.

This is true by default but can be changed. Obfuscator can handle longer script records since the last couple of versions, so it does read them or else it would crash. The reason is that AutoIt3 handles records up to 4095 characters and there would be a problem obfuscating records that are longer then 2047 as they will "grow" while being converted.

I seriously do not understand why a record would need to be longer. To only times I have seen it was with the SQL udf that contains the binary info inside the func.

You can easily cut your long scriptlines into multiple lines by using the continuation character "_".

A record is a single scriptline. (hope that clarifies it for you)

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

just wanna say thx this is just too powerfull :P

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Developers

I'm getting a few errors

-### Obfuscation Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Tester\Second PC.au3(572,1) Warning for line:ObjEvent($SINK, "_CDROMCheck_") 

-### Obfuscation Error: Found GUICtrlSetOnEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Tester\Second PC.au3(3930,1) Warning for line:GUICtrlSetOnEvent($OSK_Layout[$i][0], $OSK_Click_N[$i]) 

-### Obfuscation Error: Found GUICtrlSetOnEvent() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Tester\Second PC.au3(4187,1) Warning for line:GUICtrlSetOnEvent($recent_1[$i][0], "_Menu_Click_5_" & $i)

There are actually five more, but the function patterns are all the same. How can I fix these?

I've tried on Obfuscator v1.0.23.1 and v1.0.24.20

It is telling you that there will be a problem after obfuscation for the simple fact that when Func names are renamed during the Obfuscation process, it will also have to rename all references to it. These lines point to Funcnames Obfuscator cannot find or translate in case of a use Variable. 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 pretty much understand that, I guess I will have to find a different way to work the last two functions, but I thought you fixed it where at least the objevent functions would work. I'm assuming it is not working because the call is "_CDROMCheck_" and the actual function is "_CDROMCheck_OnObjectReady" so it can't match them, but as I said, I thought that issue was corrected. Is there a workaround, or am I just unable to use this if I'm using objevent functions?

Link to comment
Share on other sites

  • Developers

I pretty much understand that, I guess I will have to find a different way to work the last two functions, but I thought you fixed it where at least the objevent functions would work. I'm assuming it is not working because the call is "_CDROMCheck_" and the actual function is "_CDROMCheck_OnObjectReady" so it can't match them, but as I said, I thought that issue was corrected. Is there a workaround, or am I just unable to use this if I'm using objevent functions?

It will work with exact named functions, but I don't know how I could properly translate those COM functions.

You could put all Comobject Funcs in this statement which should avoid the script not to work anymore:

#Obfuscator_Ignore_Funcs=function1,functions2

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

A little confused here. Where am I suppose to put that? I put "#Obfuscator_Ignore_Funcs=_CDROMCheck_,_CDROMCheck_OnObjectReady" at the top of my script, and also tried it in the dat file...error still there. Also, if I put it at the top of the script, I get "Invalid Compiler Directive".

Link to comment
Share on other sites

  • Developers

A little confused here. Where am I suppose to put that? I put "#Obfuscator_Ignore_Funcs=_CDROMCheck_,_CDROMCheck_OnObjectReady" at the top of my script, and also tried it in the dat file...error still there. Also, if I put it at the top of the script, I get "Invalid Compiler Directive".

IT goes at the top of your script and needs to contain all functions you donot want to have renamed.

The Errors listed will remain but are really Warnings, but they are worded in a way that when you know what you are doing there is no issue.

The Obfuscator process continues and wil finsh its task. Just make sure you test properly!

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

This is true by default but can be changed. Obfuscator can handle longer script records since the last couple of versions, so it does read them or else it would crash. The reason is that AutoIt3 handles records up to 4095 characters and there would be a problem obfuscating records that are longer then 2047 as they will "grow" while being converted.

I seriously do not understand why a record would need to be longer. To only times I have seen it was with the SQL udf that contains the binary info inside the func.

You can easily cut your long scriptlines into multiple lines by using the continuation character "_".

A record is a single scriptline. (hope that clarifies it for you)

Jos

OK, thanks for explanation. I found the problem. When I add

#include <SQLite.dll.au3>

to my script then Obfuscator won't work. Any suggestion?

Cheers :P

Link to comment
Share on other sites

  • Developers

OK, thanks for explanation. I found the problem. When I add

#include <SQLite.dll.au3>

to my script then Obfuscator won't work. Any suggestion?

Cheers :P

Download the latest Obfuscator from the Beta directory and add some lines to your script that it looks like this:

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Ignore_Funcs=__SQLite_Inline_Modified,__SQLite_Inline_Version,__SQLite_Inline_SQLite3Dll



#Obfuscator_Off                                       ;Stop the Obfuscation process below this line
#include <SQLite.dll.au3>
#Obfuscator_On                                        ;Start the Obfuscation process below this line

It should leave the SQLite.dll.au3 functions alone and things should work fine.

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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