rudi Posted January 28, 2009 Share Posted January 28, 2009 Hi.For one of the customers, that I have to write quite a lot of scripting things I started to move all the old CMD versions to autoit.The customers first reaction: "I can't read the script, when compiled. Forget it!" It's just one of my customers, but the one I work for quite a lot of my time...What's the easiest way to *AUTOMATICALLY* add the program source to the compiled EXE, so that the full source (including includes) can be retrieved easyly, like it was offered with the decompiler for scripts written in Autoit Version 3.2.5.1 and prior?I tried e.g.#AutoIt3Wrapper_Res_File_Add=c:\temp\RetrieveSource.au3When I use this with a invalid path, I get an error, so I assume, that the code was added to the exe.1.) How to get the source back this way?2.) I can't use "@ScriptFullPath" this way, it has to be a litteral full path (same as for FileInstall), and all the includes ("#include <someinclude.au3>") aren't included this way as well.PS - @Developers: Is there any way to add the source code plus all includes with the CURRENT compiler (or any other tool, or trick, or whatsoever) in a way, that the existing decompiler for Version 3.2.5.1 and older could get me back the full source code?There are scripts, where I want to keep my code secret (at some level), no doubt.But for quite a lot of small scripts I'd prefer to have an option to easyly add the full source in an easy recoverable way to the EXE. I don't want to carefully save the source for each and every QND minor task script...Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 28, 2009 Share Posted January 28, 2009 Hi. For one of the customers, that I have to write quite a lot of scripting things I started to move all the old CMD versions to autoit. The customers first reaction: "I can't read the script, when compiled. Forget it!" It's just one of my customers, but the one I work for quite a lot of my time... What's the easiest way to *AUTOMATICALLY* add the program source to the compiled EXE, so that the full source (including includes) can be retrieved easyly, like it was offered with the decompiler for scripts written in Autoit Version 3.2.5.1 and prior? I tried e.g. #AutoIt3Wrapper_Res_File_Add=c:\temp\RetrieveSource.au3 When I use this with a invalid path, I get an error, so I assume, that the code was added to the exe. 1.) How to get the source back this way? 2.) I can't use "@ScriptFullPath" this way, it has to be a litteral full path (same as for FileInstall), and all the includes ("#include <someinclude.au3>") aren't included this way as well. PS - @Developers: Is there any way to add the source code plus all includes with the CURRENT compiler (or any other tool, or trick, or whatsoever) in a way, that the existing decompiler for Version 3.2.5.1 and older could get me back the full source code? There are scripts, where I want to keep my code secret (at some level), no doubt. But for quite a lot of small scripts I'd prefer to have an option to easyly add the full source in an easy recoverable way to the EXE. I don't want to carefully save the source for each and every QND minor task script... Regards, Rudi. You could put in a command line switch that triggered FileInstall(): If ($CmdLine[0] >= 1) And ($CmdLine[1] = "/source") Then _ FileInstall("C:\MyDir\MySubDir\MyScript.au3", @ScriptDir & "\MyScript.au3") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
rudi Posted January 28, 2009 Author Share Posted January 28, 2009 Hi. You could put in a command line switch that triggered FileInstall(): If ($CmdLine[0] >= 1) And ($CmdLine[1] = "/source") Then _ FileInstall("C:\MyDir\MySubDir\MyScript.au3", @ScriptDir & "\MyScript.au3") Yes, of course. But with fileinstall() I *MUST* use a literal path. So I will have to type it in each and every time. This also will miss any used include files. Therefor I'm searching for a comfortable, easy to use solution to "pack" all code lines + include files with the EXE. Like this: ; include file: packcodewithexe.au3 func PackCodeWithExe() ; do whatever will pack the source + includes to the EXE endfunc Then, in the script that really doesn't need to hide it's code just call this function, done After that, use the old decompiler (or any other tool) to retrieve the code of this non-secret script. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2009 Developers Share Posted January 28, 2009 Just use #AutoIt3Wrapper_Res_SaveSource=y This will add the source for you to the program resources. To retrieve it again you need to decompress the program with UPX after which you can view the source with Reshacker under RCDATA\999. 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 More sharing options...
Moderators Melba23 Posted January 28, 2009 Moderators Share Posted January 28, 2009 (edited) rudi,There is an AutoItWrapper directive #AutoIt3Wrapper_Res_SaveSource=y which puts the source into the exe. If you were to use Zedna's Resource UDF, you should be able to display it from within the exe.I have checked and the source is definitely in the exe and visible with ResHacker (as long as you do not use upx).Over to you,M23Edit: Jos, I have got to learn to type faster! Edited January 28, 2009 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2009 Developers Share Posted January 28, 2009 Edit: Jos, I have got to learn to type faster!Shit happens... I have checked and the source is definitely in the exe and visible with ResHacker (as long as you do not use upx).You can use UPX if you want as long as you do a "UPX -d program.exe" to decompress it before trying to view it.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 More sharing options...
Valuater Posted January 28, 2009 Share Posted January 28, 2009 I used this a few times... ; Command Line decompile to desktop ; Author Skruge If $CMDLine[0] > 0 Then If $CMDLine[1] = "/decompile" Then GetSource() EndIf ; Main Code Here Func GetSource() FileInstall("MyScript.au3", @DesktopDir & "\") Exit EndFunc;==>GetSource 8) Link to comment Share on other sites More sharing options...
Mobius Posted January 28, 2009 Share Posted January 28, 2009 (edited) it is not necessary to upx -d the binary, packed resources can be manipulated with Zedna's resource udf no probs. Although having your client simply decompress and then view the resources with a resource editor is the easiest method for both them and you. Edited January 28, 2009 by Mobius Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 28, 2009 Moderators Share Posted January 28, 2009 Mobius, You are quite correct, I was not clear enough in my post. You only need an non-packed exe if you wish to see the result in Reshacker - Zedna's UDF copes admirably with packed resources if you wanted to display during execution. I must look more closely at Valuater's solution though - no need to have the exe actually "doing its thing" to get at the source. Perhaps with the addition of a read-only editbox..... M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rudi Posted January 28, 2009 Author Share Posted January 28, 2009 Hi Valuater. FileInstall("MyScript.au3", @DesktopDir & "\") As stated above I want to avoid to have to change for every script the required literal string for the source of fileinstall Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
rudi Posted January 28, 2009 Author Share Posted January 28, 2009 Hi Jos.Just use #AutoIt3Wrapper_Res_SaveSource=yThis will add the source for you to the program resources.To retrieve it again you need to decompress the program with UPX after which you can view the source with Reshacker under RCDATA\999.As I'm reading your post I remember, that I've seen that one before Doing a qick check it looks like this wrapper switch does NOT pack includes into the EXE, beside the main code?Maybe there is another switch to also pack #include <someinclude.au3> code with the script? That would be useful for UDF includes and to proove, that the right version of includes is packed into the EXE?I can find some posts citeing Zedna's Resource UDF, but not the UDF itself: Where to get it? Is it command line capable, e.g. to use one run() call to save the code to <scriptname>.au3?Thanks, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2009 Developers Share Posted January 28, 2009 (edited) Hi Jos.As I'm reading your post I remember, that I've seen that one before Doing a qick check it looks like this wrapper switch does NOT pack includes into the EXE, beside the main code?Maybe there is another switch to also pack #include <someinclude.au3> code with the script? That would be useful for UDF includes and to proove, that the right version of includes is packed into the EXE?Correct it doesn't do that at this moment, only the original base sourcecode.It is doable because I have written and posted a scriptlet before that expands the script with all included files, but I am not sure if this is something many people would want/use.Jos Edited January 28, 2009 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 More sharing options...
trancexx Posted January 28, 2009 Share Posted January 28, 2009 Correct it doesn't do that at this moment, only the original base sourcecode.It is doable because I have written and posted a scriptlet before that expands the script with all included files, but I am not sure if this is something many people would want/use.JosBut he could run your obfuscator with /striponly parameter and compile obfuscated script with #AutoIt3Wrapper_Res_SaveSource=y ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2009 Developers Share Posted January 28, 2009 But he could run your obfuscator with /striponly parameter and compile obfuscated script with #AutoIt3Wrapper_Res_SaveSource=yYes, but did you try that and did it include the obfuscated script? 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...
trancexx Posted January 28, 2009 Share Posted January 28, 2009 Yes, but did you try that and did it include the obfuscated script? To compile the obfuscated script with #AutoIt3Wrapper_Res_SaveSource=yYou... teaser ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2009 Developers Share Posted January 28, 2009 (edited) To compile the obfuscated script with #AutoIt3Wrapper_Res_SaveSource=y You... teaser I started working on a new release of AutoIt3Wrapper that will drop support for ANSI OSes like win98 since Autoit3 stopped supporting that too. I just made a small change to it that it will store the obfuscated source when you specify: #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so Its available in the BETA download directory when you want to play with it... Jos Edited January 28, 2009 by Jos corrected typo 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...
trancexx Posted January 28, 2009 Share Posted January 28, 2009 I started working on a new release of AutoIt3Wrapper that will support ANSI OSes like win98 since Autoit3 stopped supporting that too. I just made a small change to it that it will store the obfuscated source when you specify: #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Run_Obfuscator=n #Obfuscator_Parameters=/so Its available in the BETA download directory when you want to play with it... JosWell, you obviously know my learning drill. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 28, 2009 Moderators Share Posted January 28, 2009 Jos,Are you going to keep that syntax? Because I find it most confusing:#AutoIt3Wrapper_Res_SaveSource=y#AutoIt3Wrapper_Run_Obfuscator=n#Obfuscator_Parameters=/soWill it still strip, despite the #AutoIt3Wrapper_Run_Obfuscator=n, or do you have to run Obfuscator again to get rid of the unused functions/constants?Or am I missing something? (More than likely - it has been a long day!)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2009 Developers Share Posted January 28, 2009 Jos,Are you going to keep that syntax? Because I find it most confusing:#AutoIt3Wrapper_Res_SaveSource=y#AutoIt3Wrapper_Run_Obfuscator=n#Obfuscator_Parameters=/soWill it still strip, despite the #AutoIt3Wrapper_Run_Obfuscator=n, or do you have to run Obfuscator again to get rid of the unused functions/constants?Or am I missing something? (More than likely - it has been a long day!)M23mmm... Same here I guess ...mucchhhh to long day... Ofcourse that needs to be, but you knew that already:#AutoIt3Wrapper_Res_SaveSource=y#AutoIt3Wrapper_Run_Obfuscator=y#Obfuscator_Parameters=/so 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...
Moderators Melba23 Posted January 28, 2009 Moderators Share Posted January 28, 2009 Jos, Thank you for that (wipes brow in relief!). I look forward to playing with the beta! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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