Jump to content

doubt about FileInstall


Luigi
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

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 Couldn't find the #AutoIt3Wrapper_Res_SaveSourcedirective in the help. o.O

 

Spoiler

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

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

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

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

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.

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

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

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers

There obviously should be a space before the word directive, but you knew that already from the helpfile. ;)

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

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

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

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

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

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

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.

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

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

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers

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

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

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

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

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

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

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

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

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

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.

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

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

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

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

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

Hi.

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

Conrad

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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

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

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

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   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.

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