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

Post here messages if you have any problems with working of Enigma Protector
Post Reply
SpecForce
Posts: 2
Joined: Fri Sep 16, 2022 6:13 am

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

Post 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
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

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

Post 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.
SpecForce
Posts: 2
Joined: Fri Sep 16, 2022 6:13 am

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

Post 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?
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

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

Post 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 6543 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
Attachments
winexec.zip
(120 KiB) Downloaded 277 times
Post Reply