Sign in to follow this  
Followers 0
mary

FileLoad without FileInstall on disk

40 posts in this topic

As you know there is FileInstall ( "source", "dest" [, flag] ) function to include a file in autoit compiled script. but is there a way to load this file directly without copying it on disk ?

some think like FileLoad("source")

thinks a lot for any help

Share this post


Link to post
Share on other sites



Hi,

I don't think so, why not copying it to disc using it and after all deleting it again?

But maybe, somebody knows how to load it directly. :">

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

I don't think so, why not copying it to disc using it and after all deleting it again?

But maybe, somebody knows how to load it directly. :">

So long,

Mega

i know this solution (install and delete after ...) but the pb is that you have to wait before deleting it ( you can not delete file immediatly, specially exe, from disk when it is loaded: system protection)

so my question is how to load an embeded exe without copying it on disk

Share this post


Link to post
Share on other sites

Hi,

yes you are right, but what exe are you installing? Another autoitscript.exe? You can use the selfdelete func to make sure that this script is deleted after it did its job by itself.

Just a thoght.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

yes you are right, but what exe are you installing? Another autoitscript.exe? You can use the selfdelete func to make sure that this script is deleted after it did its job by itself.

Just a thoght.

So long,

Mega

thinks ! so we have a solution only if the embeded file is an autoitscript.exe ? But how about an other exe file ?

Share this post


Link to post
Share on other sites

You just have to replace ScriptFullPath with the name of the file you wish to delete.

If you want to do it in AutoIt and no cmd-stuff, try this:

While ProcessExists(X)
    ProcessClose(X)
WEnd
FileDelete(X)
Hi,

I guess that is not the point. Mary wants to include a file in the executeable like FileInstall does, but she doesn't want to fileinstall. She wants to use the included file directly without saving it again anywhere on the disk.

I dunno whether it is possible but I don't think so, because then there wouldn't be FileInsall() without the option. :P

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

I guess that is not the point. Mary wants to include a file in the executeable like FileInstall does, but she doesn't want to fileinstall. She wants to use the included file directly without saving it again anywhere on the disk.

I dunno whether it is possible but I don't think so, because then there wouldn't be FileInsall() without the option. :P

So long,

Mega

Exactly th.meger !

I know that other languages (i.e delphi...) can do that (embeding technique).

Share this post


Link to post
Share on other sites

I know it's a little bit too late, but I just want to clearify I understood the request.

So we have a solution only if the embeded file is an autoitscript.exe ?

So I just thought the selfdelete was excepted as a solution. :P

Must admit that it would be really nice if it would be possible...

Share this post


Link to post
Share on other sites

I never tried resource hacker to add stuff, but maybe possible.

Lar.

sorry, i just can't get my head around 'why?'. i mean fileinstall works. a file can be put anywhere (including a temporary folder) and executed. execution of the program can be stopped at any time, the file name to be deleted is already known, and it is not difficult to have the script wait for the process to close before deleting the file, you can even setup functions to make sure that the file is deleted before the script exits, or make and launch a second (third, fourth, fifth?) script to make sure your script is restarted if that process stops and the file is still present. there are only a few reasons (good or bad) that i can think of to even want to do this, and the only 'good' one is because it sounds like a limitation. While it seems that being able to run an executable file that, even if noticed cannot be located on the hard drive to delete, could have all kinds of negative applications. It's because of that, that i suspect you're going to run into this limitation with most high level languages.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

..... there are only a few reasons (good or bad) that i can think of to even want to do this, and the only 'good' one is because it sounds like a limitation. While it seems that being able to run an executable file that, even if noticed cannot be located on the hard drive to delete, could have all kinds of negative applications. It's because of that, that i suspect you're going to run into this limitation with most high level languages.

Classique message de type "Procès dintention" !!!

did you give the same replay in other language forum (c++ or delphi or any other language) ? I dont think so ...

there are a lot af articles about Embedding files as resources.....so try to have a positive attitude....

Here is an example of Embedding files as resources

http://howtodothings.com/computers/a1176-e...executable.html

Edited by mary

Share this post


Link to post
Share on other sites

See my post about successfull adding and using icons in resources in AutoIt GUI here

About another resource types (for images) search for "LoadImage" "LoadBitmap" there was some attempts to do it.

About executing EXE's directly from memory I have seen some good post from Valik about this - not solution rather explanation.

Share this post


Link to post
Share on other sites

Is there a specific reason why this executable cannot be written to disk? If the executable contains passwords or other security information, an experienced cracker could read the sensitive information that the executable contains even while it is in memory by attaching a debugger to it. I know you can load resources from memory(bitmaps, ico, cursors, mp3, wav, html, jpg, etc) but i am not sure about executables.

The only way i can see code being executed directly from memory is if you wrote the code in assembly and then have autoit allocate memory with memory allocation functions and then write the assembly code to memory and then somehow run it as another thread.

w0uter did something similar to that here:

http://www.autoitscript.com/forum/index.ph...st&p=209346

However, that really isn't executing another program, just simply writing assembly code to memory and executing it.

I just don't think that executing an executable from memory is possible. It just has to be run from the disk, AFAIK, unless Valik or someone else wants to come in here and tell me that it can be done. :P


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Is there a specific reason why this executable cannot be written to disk? If the executable contains passwords or other security information, an experienced cracker could read the sensitive information that the executable contains even while it is in memory by attaching a debugger to it. I know you can load resources from memory(bitmaps, ico, cursors, mp3, wav, html, jpg, etc) but i am not sure about executables.

The only way i can see code being executed directly from memory is if you wrote the code in assembly and then have autoit allocate memory with memory allocation functions and then write the assembly code to memory and then somehow run it as another thread.

w0uter did something similar to that here:

http://www.autoitscript.com/forum/index.ph...st&p=209346

However, that really isn't executing another program, just simply writing assembly code to memory and executing it.

I just don't think that executing an executable from memory is possible. It just has to be run from the disk, AFAIK, unless Valik or someone else wants to come in here and tell me that it can be done. :P

I know that is possible with delphi !

Share this post


Link to post
Share on other sites

I like the idea to have all needed resources included in one file. It doesn't need to create files on a possibly write protected volume...

An idea could be to encode the binary object (icons, graphics, sound, ...) at compiletime to strings using base64 (see http://www.autoitscript.com/forum/index.ph...&hl=base64).

These data strings have to be included to the autoit program.

At runtime initialisation the binary objects are created im memory and initialised with the encoded data.

It's still an idea ans needs thinking ...

Share this post


Link to post
Share on other sites

I like the idea to have all needed resources included in one file. It doesn't need to create files on a possibly write protected volume...

An idea could be to encode the binary object (icons, graphics, sound, ...) at compiletime to strings using base64 (see http://www.autoitscript.com/forum/index.ph...&hl=base64).

These data strings have to be included to the autoit program.

At runtime initialisation the binary objects are created im memory and initialised with the encoded data.

It's still an idea ans needs thinking ...

thinks KAX ! Finally a positive thinking without suspicious questions about the goal of this technique.

I dont know if delphi language use windows APi to embed ressources ...if it is the case so maybe we can do same thing with DllCall

Share this post


Link to post
Share on other sites

thinks KAX ! Finally a positive thinking without suspicious questions about the goal of this technique.

I dont know if delphi language use windows APi to embed ressources ...if it is the case so maybe we can do same thing with DllCall

How do you do this in Delphi? I know a little bit about how to use resources in Delphi, to run a program that is stored as a resource for example, but I don't know how to load the program into memory from a resource and run it. I know this isn't a Delphi forum but it might give a clue as to how to do it in Autoit.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Look here

Hello Zedna,

thanks for your reply. But I have a different idea in mind.

What I want is to have a single source AU3 file containing ALL needed resources.

I.e. used icons were previously encoded (base64) to ascii strings. That constant resource-strings are stored as AU3 source (may also be included). The strings can be compiled. At runtime, when the icon-resource is needed, the string is decoded into memory (icon image). And the remaining thing is to initialise the Gui-Control with that memory instead of icon-file.

If this would work then a compiled AU3 program contains all needed data.

Share this post


Link to post
Share on other sites

How do you do this in Delphi? I know a little bit about how to use resources in Delphi, to run a program that is stored as a resource for example, but I don't know how to load the program into memory from a resource and run it. I know this isn't a Delphi forum but it might give a clue as to how to do it in Autoit.

look this article about embedding files as resources in a delphi code

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
Sign in to follow this  
Followers 0