1

I would like to know how can i generate an executable using python or c/c++ (or any other langagues) from a program already compiled.

For instance: I have an executable program.exe with a textbox and a button. You type any text you want in the textbox and when you click the button, it generates an executable that can display text you have typed before.

Many keylogger or malware builder does this, they generate a server.exe depends on parameters you have given (email / ftp address).

I would have suggested to generate a source code on a file and compiled it after but what if you don't have the compiler installed in your computer? Do you have any clues doing this?

voyager_1
  • 61
  • 6

1 Answers1

0

One way you could do this is by replacing a dummy value in the compiled program. e.g.

char* ipAddress = "255.255.255.255";

You can than find this string in the application and replace it with the real IP address, or whatever you need. (For C and a lot of other languages, make sure your string is 0 byte terminated.)

The only problem is that it breaks signing, but there are ways around that.

Rick Rongen
  • 719
  • 5
  • 10
  • Isn't it possible to embed a compiler in the program itself? – voyager_1 Mar 23 '18 at 08:40
  • @kirin technically you probably could do that, but a compiler is a pretty complex piece of software, it is not easy to embed. In the case of C# you can create an executable since the .NET runtime comes with a compiler. – Rick Rongen Mar 23 '18 at 09:22