Xandy Posted December 23, 2011 Share Posted December 23, 2011 (edited) I would like to obfuscate my script before release. I have 900 functions that look like this. Where 0= 0 .. 900 func functionfunction0() hotkeyset($hk[0][9]);unset the hotkey to prevent spamming the function dofunction(0);Do it! hotkeyset($hk[0][9], "functionfunction0");reset the hotkey for future use Endfunc Basically what this means is that I have to use the /cf 0 flag or the hotkeyset() will not match the function() name (I think). I tested it without the /cf 0 flag and my hotkeys failed to trigger the functions, the hotkeys work with the flag. So all is good, except I'd like to use the /cf 1 on all other functions in my script. My program/script wrote those 900 functions it'self so if there is away to change the flag inline, no matter how tedious I'm sure I could do it. Is there a way to change the /cf flag in a precompiler sort of way for the obfuscator? I may have not understood the help file and if that is the case please help me understand how to accomplish this goal. Telling me it cannot be done is useful too, thank you. Edited December 27, 2011 by songersoft Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Xandy Posted December 27, 2011 Author Share Posted December 27, 2011 One solution I found is to manually change the function names. example: replace all makewindow( with foggylamp1( replace all loaddialogdata( with foggylamp2( Seems like the wrong way to go about this though, as I would want to keep the original source unmodified and only obfuscate released executables. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Developers Jos Posted December 27, 2011 Developers Share Posted December 27, 2011 What is it exactly what you want to accomplish with Obfuscator?Just strip the Included files but leave the main script untouched? (/SOI) 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...
Xandy Posted December 27, 2011 Author Share Posted December 27, 2011 (edited) I want to protect my source code from decompulation. I am wondering if there is away I can take advantage of obfuscator renaming functions. Obfuscator works very well by the way, my 10535 lines of code become 31682 of functioning jibber jabber. I understand obfuscator is thanks to you. ;this line is an example of how I use 900 functions with specific variable names hotkeyset($hk[$hks][9], "functionfunction"&$hks) ;below is an example of the function definitions func functionfunction898() hotkeyset($hk[898][9]) dofunction(898) hotkeyset($hk[898][9], "functionfunction898") Endfunc func functionfunction899() hotkeyset($hk[899][9]) dofunction(899) hotkeyset($hk[899][9], "functionfunction899") Endfunc func functionfunction900() hotkeyset($hk[900][9]) dofunction(900) hotkeyset($hk[900][9], "functionfunction900") Endfunc Data used to determine what to do with the hotkey is paired to the index... All I can say is it works. Otherwise I wouldn't be able to match the function in the hotkeyset() with the data. Perhaps you see why /cf 1 is difficult for me to use. Perhaps I don't know enough about what I am trying to say. Thank you for your hard work, time, and effort. Edited December 27, 2011 by songersoft Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Developers Jos Posted December 27, 2011 Developers Share Posted December 27, 2011 (edited) There will be no way that Obfuscator can know the names of the function you are trying to form in the formula like this: hotkeyset($hk[$hks][9], "functionfunction"&$hks) So it cannot rename them. But, having said that: I cannot see what obfuscating the names you have would buy you as there are just consecutive names already. Don't forget that what Obfuscator does can be undone partially and renaming funcs back is one of them, so Obfuscator doesn't protect your script at all, just makes it harder to read. Jos Edited December 27, 2011 by Jos Xandy 1 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...
Xandy Posted December 27, 2011 Author Share Posted December 27, 2011 But, having said that: I cannot see what obfuscating the names you have would buy you as there are just consecutive names already.Right. I was wondering if I could obfuscate all the other function names in the script leaving the 'functionfunctionN' unmodified. However, if it were possible you would have likely mentioned it to me.Thank you for your time Jos. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
ProgAndy Posted December 27, 2011 Share Posted December 27, 2011 It is possible to keep some function names. You have to add the names to the following directive as a comma separated list: #Obfuscator_Ignore_Funcs= Xandy 1 *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 More sharing options...
Xandy Posted December 27, 2011 Author Share Posted December 27, 2011 My fault for completely over looking that segment in the help file. ProgAndy you provided me with the solution I was looking for. Thank you. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) 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