Jump to content

packing an executable in au3 program


dragonlord
 Share

Recommended Posts

Hi i need to execute an external .exe file to be called from my code. Is there anyway to PACK it into my code.Say something like generating the executable on the fly.

My thought : Is is possible to take the hex code from the third party exe, put it into a variable and use that to generate the exe somehow ?

Link to comment
Share on other sites

  • Moderators

Thanx Smoke,

But, if i use the fileinstall program, the executable must be present in the source path right ? i dont want to distribute this exe file separately with my au3 exe.

any other alternatives ?

You could always "sneak" your way around other ways I'm sure.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 6 months later...

Hi i need to execute an external .exe file to be called from my code. Is there anyway to PACK it into my code.Say something like generating the executable on the fly.

My thought : Is is possible to take the hex code from the third party exe, put it into a variable and use that to generate the exe somehow ?

Hi dragonlord,

I need to do the same. I can do it easily with other .au3 by using #include <scriptname.au3> but I can't do it with .exe.

Did you find a way to do it?

thanks

Link to comment
Share on other sites

As SmOke_N said, use FileInstall.

e.g:

FileInstall("C:\myapp.exe, "C:\myapp.exe")

The first one is where the code will get the file from to pack into the exe when compiled, the second one is where the exe is unpacked to when your script runs.

Link to comment
Share on other sites

As SmOke_N said, use FileInstall.

e.g:

FileInstall("C:\myapp.exe, "C:\myapp.exe")

The first one is where the code will get the file from to pack into the exe when compiled, the second one is where the exe is unpacked to when your script runs.

thanks for the reply Saldous,

But I'm looking for a solution where somehow I can run a .exe without installing/copying the exe to the destination machine. Maybe some function that packs the exe inside my script and I can run from inside it without copying any data to the destination machine.

tks

Link to comment
Share on other sites

  • Moderators

thanks for the reply Saldous,

But I'm looking for a solution where somehow I can run a .exe without installing/copying the exe to the destination machine. Maybe some function that packs the exe inside my script and I can run from inside it without copying any data to the destination machine.

tks

What possible legitimate reason would you have for doing this, and be willing to risk driving every AV software out there mad?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

What possible legitimate reason would you have for doing this, and be willing to risk driving every AV software out there mad?

Hi SmOke_N,

the legitimate reason is live forensic investigation where we should not install any file in the infected machine. so if I send my autoit script that will run listdlls.exe (sysinternals), it's actually running from within the script and not from a file copied to the malware infected machine.

If there is no other way I will need to find another way of doing it :-)

Link to comment
Share on other sites

Hi SmOke_N,

the legitimate reason is live forensic investigation where we should not install any file in the infected machine. so if I send my autoit script that will run listdlls.exe (sysinternals), it's actually running from within the script and not from a file copied to the malware infected machine.

If there is no other way I will need to find another way of doing it :-)

I'm confused by this, if you are doing foresic work on a PC, that PC would typically just be a copy of the "Suspect" drive that is being accessed from a "Forensic Testing" workstation. It should not be running the O/S, as just by starting it up it will (or could) be modifying the very data you are trying to find.

And if we are talking about a system that has been infected by a virus that you are attempting to clean, why would you care about adding another file to it... are you not planning on copying the original script there anyway? If your planning on putting the scrip on some Flash or floppy drive, then just put listdlls.exe on the same medium and reference it accordingly [maybe with Run or _RunDOS()]

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

I'm confused by this, if you are doing foresic work on a PC, that PC would typically just be a copy of the "Suspect" drive that is being accessed from a "Forensic Testing" workstation. It should not be running the O/S, as just by starting it up it will (or could) be modifying the very data you are trying to find.

And if we are talking about a system that has been infected by a virus that you are attempting to clean, why would you care about adding another file to it... are you not planning on copying the original script there anyway? If your planning on putting the scrip on some Flash or floppy drive, then just put listdlls.exe on the same medium and reference it accordingly [maybe with Run or _RunDOS()]

Hi SpookMeister,

you are correct with your forensic statements. I have actually finished the script to run from the FlashDrive(which will leave only the trace of the flashdrive recognition). There are some other scenarios where I still need to have the script to be self-contained but looks like I will need to spend more time trying to write some other scripts that will do the job for me.

thanks guys for your inputs.

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