Luigi

doubt about FileInstall

20 posts in this topic

Greetings,

 

If include my own sourcecode.au3 through fileinstall and compile...

How this file is encoded?
Is secure?

Today a 7zip can extract any types of files from my .exe, but I can't find my sourcecode.au3

The reason of this topic is, I have a simple (or stupid) idea: "include the sourcecode in .exe file".

How?

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include-once
#include <FileConstants.au3>
 
If $CmdLine[0] Then
    If $CmdLine[1] = "sourcecode" And $CmdLine[2] = "please" Then FileInstall("teste.au3", "teste" & @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & ".au3", $FC_OVERWRITE)
EndIf
 
ConsoleWrite("Hello world" & @LF)

This is only example, but, with a simple word's combination, I have my sourcecode, simple, fast and formated.

But, the great doubt is: is secure?

Perhaps this way is more easy to get sourcecode without a decompiler?


Visit my repository

Share this post


Link to post
Share on other sites



34 minutes ago, Luigi said:

Is secure?

No

36 minutes ago, Luigi said:

This is only example, but, with a simple word's combination, I have my sourcecode, simple, fast and formated.

No idea what you are saying here.

36 minutes ago, Luigi said:

But, the great doubt is: is secure?

No

36 minutes ago, Luigi said:

Perhaps this way is more easy to get sourcecode without a decompiler?

Decompiling is a topic we don't want to discuss here but maybe you should first properly explain why you want a second copy of the source in the compiled script?
(There is actually a #AutoIt3Wrapper_Res_SaveSourcedirective to save the Master script without #includes in the PE Header. It is described in the SciTE4AutoIt3 helpfile))

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

18 minutes ago, Jos said:

Decompiling is a topic we don't want to discuss here but maybe you should first properly explain why you want a second copy of the source in the compiled script?

I do not want use decompile.

Example, if I need work in a compilad script made a long long long time ago... I don't have the source code? No backup or the worst: have a thounsand of scripts, and can't locate the the main script.

It's a simple idea, as I say, probaly stupid, include the source code in the .exe file, protect by command line options.

And the main question is: If I use this, I create another way more easy to get a source code "without" decompiler? Is this...

Sorry Jon, english is not my native language, and is hard express some ideas in english.

Don't worry, is not my intention broke any forum's rules, I know it very well, agree and respect.

For me, it's just a language difficulty.

You give me the answer: Is secure? Not.

For me, that's enough.

Thanks! 8D

Edited by Luigi

Visit my repository

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Regarding including source code with the script, I do this for all of mine:

If StringInStr($cmdlineRaw, "/Extract") Then
    FileInstall("<path to script>", @TempDir & "\Extracted.au3", 1)
    Exit
EndIf

But the answer to your other question is the more important one; it is not going to be secure.

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

1 hour ago, Luigi said:

Sorry Jon, english is not my native language, and is hard express some ideas in english.

It's Jos, not Jon, and English isn't my native language either. ;)

Jos

 

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Sorry J:shocked:s


Visit my repository

Share this post


Link to post
Share on other sites

i Couldn't find the #AutoIt3Wrapper_Res_SaveSourcedirective in the help. o.O

 


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I guess i was not in the correct help file, the only way for me to get there is to have the carret (is that the name?) on top of one directive such as that one or another, and press F1, then it takes me to a different help, and does show a lot of directives, if i simply press f1 and search, i get nothing, i just think this should be all in one.

 

Capture.PNG

Capture2.PNG

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Did you look under the Help menu option in SciTE?

They are totally separate helpfiles and I have modified the AutoIt3Help.exe, used to start the helpfile, to select the SciTE4AutoIt3 helpfile in case it involves something specific to the SciTE4AutoIt3.chm.

Jos

 

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#11 ·  Posted

I found only "#AutoIt3Wrapper_Res_SaveSource=".

Google does not have "AutoIt3Wrapper_Res_SaveSourcedirective".


Visit my repository

Share this post


Link to post
Share on other sites

#12 ·  Posted

mmmm...  thought that would have been pretty clear by now:  

That was a typo from me as it should have read:  AutoIt3Wrapper_Res_SaveSource directive

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#13 ·  Posted

5 hours ago, Jos said:

They are totally separate helpfiles and I have modified the AutoIt3Help.exe, used to start the helpfile, to select the SciTE4AutoIt3 helpfile in case it involves something specific to the SciTE4AutoIt3.chm.

Yes, i noticed it's a different help file, i would like to suggest that the contents from scite to be included in the autoit help.

But anyway, it's all clear to me.

Thanks for clarification Jos.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

#14 ·  Posted

Just now, careca said:

i would like to suggest that the contents from scite to be included in the autoit help.

Not happening as the full version of SciTE4AutoIt3 is considered a separate project and only the lite version of SciTE is included in the AutoIt3 installer. 
That decision as based on the fact that everybody needs to be able to use the Editor they prefer.

Jos  


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#15 ·  Posted

Hi.

If I include source file via  AutoIt3Wrapper_Res_SaveSource how can I extract the source later?

Conrad


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

#17 ·  Posted

That's exactly what @JLogan3o13 said in post #4. But I didn't asked for the variant with FileInstall() because there I had to know exactly the source path (@ScriptDirFullpath etc. is not working in this function). 

I want to know how to get the source when it is included via AutoIt3Wrapper_Res_SaveSource. There seemed to be no path needed.

In the end I want always #include <myStandardInclude.au3> with #AutoIt3Wrapper_Res_SaveSource inside and many other things like my standard tray menu etc in all my scripts. So I will never forget to have my source included and not to define the path of the source.

Conrad


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

sigh.

Steals Jos' bottle of wine. :sweating:

 

Edited by Somerset
needed a bib for the wine, i am about to guzzle.

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

11 hours ago, Simpel said:

I want to know how to get the source when it is included via AutoIt3Wrapper_Res_SaveSource. There seemed to be no path needed.

Just open with ResHacker and look at RCDATA,999 as indicated by the console message when compiling the script or run a script like this:

#AutoIt3Wrapper_Res_SaveSource=y

; To extract the source
#include<ResourcesEx.au3>
$InputEXE = "test.exe"
$sResNameOrID=999
$sFilePath="extracted_source.au3"
$rc=_Resource_SaveToFile($sFilePath, $sResNameOrID,$RT_RCDATA,Default,Default,$InputEXE)
ConsoleWrite('$rc= = ' & $rc & ' >Error code: ' & @error & @CRLF)

This requires the include made by @guinness : 

Jos

Edited by Jos
2 people like this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#20 ·  Posted

Hi.

Thanks @Jos. I managed it this way (inside <myStandardInclude.au3>):

#include<ResourcesEx.au3>

_ExtractSource()

Func _ExtractSource()
    If @Compiled Then
        If StringRegExp($cmdlineraw, "(?i)(extract|extrakt|source|quelle|code|au3)") Then
            Local $sInputExe = @ScriptFullPath
            Local $sResNameOrID = 999
            Local $sFilePathAu3 = StringLeft(@ScriptFullPath, StringInStr(@ScriptFullPath, ".", 0, - 1) - 1) & "_extracted_source.au3"
            Local $bReturn = _Resource_SaveToFile($sFilePathAu3, $sResNameOrID, Default, Default, Default, $sInputExe)
            Local $sErrorAddon
            If @error = 6 Then $sErrorAddon = " - Kein Quellcode gefunden."
            MsgBox(0, 'Sourcecode', 'Extrahiert: ' & $bReturn & @CRLF & @CRLF & 'Error: ' & @error & $sErrorAddon & @CRLF & 'Extended: ' & @extended & @CRLF & @CRLF & "Pfad: " & $sFilePathAu3)
            Exit
        EndIf
    EndIf
EndFunc

And inside \SciTE\AutoIt3Wrapper\AutoIt3Wrapper.ini I added in section [Res]:

SaveSource=y

That indeed took some time to find the correct section and the correct key name.

Now my source code is always included (if I included <myStandardInclude.au3>) to source. That's cool.

Conrad


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
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