Basically, I just wan't to know how can this be achieved.
For example, suppose that I have to exe files, app1.exe and app2.exe. Now, app2.exe does a specific job basing on some settings defined on it's variables. I wan't to know how can I code the app1.exe to generate app2.exe files while defining different settings (variables) for it, without using any config file, registry or similar.
I don't have a specific project with this problem, but I was just wondering how this can be done.
--Inspired by the famous Trojan Horse ProRat. It does the same thing, it generates server.exe file with predefined settings from its server creator (another exe file). Furthermore it can bound with other files such as images, audio, video etc.
After this period of time, I found a solution to this problem by using code injection on file.
Below is my solution on steps:
string setting1 = "${MYVAR}"
), then compile and save the exe (app2.exe).setting1
variables value of app2.exesetting1
variable (by firstly converting it also in byte array then in HEX string), and then replace it with the input you got in step 2 (by also converting in byte array then in HEX string).If someone want to see an example, I can put some code as proof of concept.