taurus905 Posted September 19, 2007 Share Posted September 19, 2007 The following code runs fine unless it is obfuscated. I would appreciate any help in finding a work-around for this since the obfuscator is one of the best features of AutoIt. And that is saying a lot since AutoIt is so fantastic. Thanks for any suggestions. taurus905 ; Variable Function Name - Hotkey Example.au3 ; Use variable as function name to set hotkey Dim $HKey[4] = ["", "One", "Two", "Three" ] ; Variable For $i = 1 To 3 HotKeySet("{" & "F" & $i & "}", $HKey[$i]) ; Set f-key (1 to 3) as hotkey Next While 1 Sleep(10) WEnd Exit Func One() MsgBox(0, "You Pressed", "F1" & " Key", 1) EndFunc ;==>One Func Two() MsgBox(0, "You Pressed", "F2" & " Key", 1) EndFunc ;==>Two Func Three() MsgBox(0, "You Pressed", "F3" & " Key", 1) EndFunc ;==>Three "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
BrettF Posted September 19, 2007 Share Posted September 19, 2007 What is your exact problem with the obfuscated code? It worked fine for me Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
taurus905 Posted September 19, 2007 Author Share Posted September 19, 2007 What is your exact problem with the obfuscated code? It worked fine for me Bert,Could you please post your obfuscated code of the above example so I can run it? I am using the latest AutoIt and SciTE, but when I obfuscate the scirpt, I get the error that is in the title of this post. Maybe something is corrupted.Thanks for taking the time.taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
BrettF Posted September 19, 2007 Share Posted September 19, 2007 Bert,Could you please post your obfuscated code of the above example so I can run it? I am using the latest AutoIt and SciTE, but when I obfuscate the scirpt, I get the error that is in the title of this post. Maybe something is corrupted.Thanks for taking the time.taurus905Ok... When i last posted, it ran. I think. It appears yes, it is corrupt. The creater will know the answer. He knows all Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shevilie Posted September 19, 2007 Share Posted September 19, 2007 (edited) I think the problem is, that the way obfuscator works, can't determanite the parameters in the HotKeySet..The same problem that does, that you cant use CallFrom the forumWarn you about the use of these AutoIt3 Functions and in which File/Func/line they are used and the Parameter contains an Ampersand (&), since they will cripple the functioning of the script when used: * adlibenable() * call() * eval() * guiregistermsg() * guisetonevent() * guictrlsetonevent() * hotkeyset() * isdeclared() * trayitemsetonevent() * objevent() * Opt("OnExitFunc","OnAutoItExit") Edited September 19, 2007 by Shevilie Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Developers Jos Posted September 19, 2007 Developers Share Posted September 19, 2007 (edited) The issue is that Obfuscator will rename the FUNCnames to some random name after which they don't match with the Array values anymore. The only solution I have is to do it this way: Dim $HKey[4] = ["", "One", "Two", "Three" ]; Variable For $i = 1 To 3 HotKeySet("{" & "F" & $i & "}", $HKey[$i]); Set f-key (1 to 3) as hotkey Next While 1 Sleep(10) WEnd Exit #Obfuscator_off Func One() #Obfuscator_on MsgBox(0, "You Pressed", "F1" & " Key", 1) EndFunc;==>One #Obfuscator_off Func Two() #Obfuscator_on MsgBox(0, "You Pressed", "F2" & " Key", 1) EndFunc;==>Two #Obfuscator_off Func Three() #Obfuscator_on MsgBox(0, "You Pressed", "F3" & " Key", 1) EndFunc;==>Three The Obfuscator Warnings will remain because it will never be able to figure out if the script is vald or not. Edited September 19, 2007 by JdeB 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 More sharing options...
taurus905 Posted September 19, 2007 Author Share Posted September 19, 2007 The issue is that Obfuscator will rename the FUNCnames to some random name after which they don't match with the Array values anymore. The only solution I have is to do it this way: Dim $HKey[4] = ["", "One", "Two", "Three" ]; Variable For $i = 1 To 3 HotKeySet("{" & "F" & $i & "}", $HKey[$i]); Set f-key (1 to 3) as hotkey Next While 1 Sleep(10) WEnd Exit #Obfuscator_off Func One() #Obfuscator_on MsgBox(0, "You Pressed", "F1" & " Key", 1) EndFunc;==>One #Obfuscator_off Func Two() #Obfuscator_on MsgBox(0, "You Pressed", "F2" & " Key", 1) EndFunc;==>Two #Obfuscator_off Func Three() #Obfuscator_on MsgBox(0, "You Pressed", "F3" & " Key", 1) EndFunc;==>Three The Obfuscator Warnings will remain because it will never be able to figure out if the script is vald or not.' JdeB, Thank you for the solution. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now