Jump to content

A customer is asking to be able to get the source from .EXE


rudi
 Share

Recommended Posts

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.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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 :lmao:

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

  • Developers

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

  • Moderators

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,

M23

Edit: Jos, I have got to learn to type faster!

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Developers

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

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 by Mobius

wtfpl-badge-1.png

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi Jos.

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.

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

  • Developers

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 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

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

But 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

  • Developers

But he could run your obfuscator with /striponly parameter and compile obfuscated script with #AutoIt3Wrapper_Res_SaveSource=y

Yes, 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

  • Developers

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... :lmao:

Jos

Edited 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

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... :)

Jos

Well, you obviously know my learning drill.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

  • Moderators

Jos,

Are you going to keep that syntax? Because I find it most confusing:

#AutoIt3Wrapper_Res_SaveSource=y

#AutoIt3Wrapper_Run_Obfuscator=n

#Obfuscator_Parameters=/so

Will 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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Developers

Jos,

Are you going to keep that syntax? Because I find it most confusing:

#AutoIt3Wrapper_Res_SaveSource=y

#AutoIt3Wrapper_Run_Obfuscator=n

#Obfuscator_Parameters=/so

Will 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

mmm... 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

  • Moderators

Jos,

Thank you for that (wipes brow in relief!).

I look forward to playing with the beta!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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