ProgAndy Posted June 14, 2008 Posted June 14, 2008 (edited) 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 / ExeThanks. It's OK and also OnAutoItStart() works OK.Does it work, if you use Opt("SetOnExitFunc","..."), too? Edited June 14, 2008 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
Developers Jos Posted June 14, 2008 Author Developers Posted June 14, 2008 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 / ExeDoes 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.
ProgAndy Posted June 15, 2008 Posted June 15, 2008 (edited) 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 EnumWindowsDllCall("user32.dll", "int", "EnumWindows", "ptr", DllCallbackGetPtr($handle), "lparam", 10); Delete callback functionDllCallbackFree($handle); Callback ProcedureFunc _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 enumerationEndFuncObfuscated error:\test_callback_Obfuscated.au3 (4) : ==> Badly formatted "Func" statement.:$A2300204537 = DLLCallbackRegister($A5000301244, $A3C00405721, $A1D00504602)??????????????? Edited June 15, 2008 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
Developers Jos Posted June 15, 2008 Author Developers Posted June 15, 2008 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.
ProgAndy Posted June 15, 2008 Posted June 15, 2008 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
Champak Posted August 6, 2008 Posted August 6, 2008 (edited) 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 August 6, 2008 by Champak
igorm Posted August 6, 2008 Posted August 6, 2008 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 Office 2000/XP/2003/2007 Slipstreamer
Developers Jos Posted August 6, 2008 Author Developers Posted August 6, 2008 (edited) 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 mmm... yes, make the record(s) shorter than 2047 would be the right answer I guess. Edited August 6, 2008 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.
igorm Posted August 6, 2008 Posted August 6, 2008 (edited) mmm... yes, make the record(s) shorter than 2047 would be the right answer I guess. 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 Edited August 6, 2008 by igorm Office 2000/XP/2003/2007 Slipstreamer
Moderators SmOke_N Posted August 6, 2008 Moderators Posted August 6, 2008 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 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.
Developers Jos Posted August 6, 2008 Author Developers Posted August 6, 2008 (edited) 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 August 6, 2008 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.
caramen Posted August 6, 2008 Posted August 6, 2008 just wanna say thx this is just too powerfull 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 - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Developers Jos Posted August 6, 2008 Author Developers Posted August 6, 2008 (edited) 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 August 6, 2008 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.
Champak Posted August 6, 2008 Posted August 6, 2008 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?
Developers Jos Posted August 6, 2008 Author Developers Posted August 6, 2008 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.
Champak Posted August 6, 2008 Posted August 6, 2008 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".
Developers Jos Posted August 6, 2008 Author Developers Posted August 6, 2008 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.
igorm Posted August 6, 2008 Posted August 6, 2008 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)JosOK, 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 Office 2000/XP/2003/2007 Slipstreamer
Champak Posted August 6, 2008 Posted August 6, 2008 Got you. I have another error, but have a feeling it's popping up because of these function errors. I'll check on that first.
Developers Jos Posted August 6, 2008 Author Developers Posted August 6, 2008 (edited) 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 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 August 6, 2008 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.
Recommended Posts