Page 1 of 1

How to execute a file after it is extracted in a virtual box

Posted: Fri Sep 16, 2022 6:21 am
by SpecForce
I got a virtualized file inside a protected module. I want the file "ETAP2100_ps.exe" to be silently executed. In particular, when the file is extracted, I want the following command lines to be executed as administrator

Code: Select all

cd %temp%
ETAP2100_ps.exe /S
exit
Is this possible?

Image

Re: How to execute a file after it is extracted in a virtual box

Posted: Sun Sep 18, 2022 5:59 pm
by Enigma
Hi, it is not possible using standard interface of Enigma Protector, but quite easy to do using plugins system.

You may develop a plugin, and simulate your script inside Enigma_Plugin_OnFinal plugin function.

Please let us know if you have any questions, we can guide you a bit for this.

Re: How to execute a file after it is extracted in a virtual box

Posted: Wed Sep 21, 2022 3:20 pm
by SpecForce
Enigma wrote: Sun Sep 18, 2022 5:59 pm Hi, it is not possible using standard interface of Enigma Protector, but quite easy to do using plugins system.

You may develop a plugin, and simulate your script inside Enigma_Plugin_OnFinal plugin function.

Please let us know if you have any questions, we can guide you a bit for this.
Thanks for the answer. I am not sure how to do this. May you guide me?

Also, may you add this as a feature?

Re: How to execute a file after it is extracted in a virtual box

Posted: Fri Oct 07, 2022 4:15 pm
by Enigma
Attached is a plugin for Lazarus (rather simple IDE to develop), this you can use as a core for more complex changes.

Logic is placed to the plugin function Enigma_Plugin_OnFinal.
lazarus1.png
lazarus1.png (14.11 KiB) Viewed 6605 times
Enigma_Plugin_OnFinal in plugin is being called by protection when it finalized all things to prepare execution of main file code. So at this step the files of Virtual Box, that are specified as "Write to Disk" are extracted to disk and can be executed.

Using WinExec function the desired exe file is being executed. You may also need to call SetCurrentDirectory function to determine the folder where the exe file is located.

Please read this thread in order to understand how to use plugins in Enigma Protector: http://forum.enigmaprotector.com/viewto ... f=26&t=655