0

It's been asked how to automate the task of embedding binary data into source code (Embedding resources in executable using GCC), but I would like to know whether it is possible to just write binary data into a compiled executable, i.e. without having to compile from source. My first thought would be to include a "constant variable" large enough to hold the data, but I don't know how to find out where to write the data.

Community
  • 1
  • 1
none
  • 11
  • 3

1 Answers1

0

The answer is YES, at least with MINGW on win32 an executable can read itself and it can be appended data. So its last few bytes can be the data's header (offset).

none
  • 11
  • 3