Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download code and execute on-the-fly

Tags:

delphi

Is it possible to download code and execute / inject it when application is executed?

I want to keep my .exe small and up2date without using an updater.

Been searching google for a while, but couldn't find anything execpt for just downloading other .exe's which always triggers Antivir's.

like image 934
Marius Prollak Avatar asked Jan 21 '13 22:01

Marius Prollak


2 Answers

You should put your business logic in dll(s) and only the update logic in the exe. Each time you start the application it should check for updates. If it needs to, it will download new dll(s) and update its functionality.

By making the dll(s) to be dynamically loaded, you need not even restart the application when an update is performed IF you check for updates the first thing after your exe starts.

The process inside the exe would be the following: 1. Start small exe 2. Check for updates. If needed, download dll(s) in the specific location for dll(s). 3. Load dll(s) from that specific location

Of course, for ease in working with it, you should not allow multiple instances because if you already have it started and you start another instance, you will have another case to handle: you try to make an update but the files you need to overwrite are in use...

like image 165
GeorgeVremescu Avatar answered Sep 19 '22 00:09

GeorgeVremescu


There is a way in which you can run an exe, injecting it in other process's address space. But for sure your software will be marked as malware by heuristic av's.

Here is the unit that does the trick if you are interested about the concept.

like image 26
opc0de Avatar answered Sep 18 '22 00:09

opc0de