I have a program which compiles and runs scripts.

To create a standalone version of the script, I reserve a large static buffer to hold the compiled script. The compiled script is copied into a copy of the program and it can then be run from that copy.

This works fine. It has some disadvantages however:

* the buffer is static and takes up space if there's no compiled
program in it.
* if the script to be included exceeds the buffer's size, I need to build a new version with a larger buffer.

I'd like to add the compiled script to the end of the program, but naively doing so doesn't work as the exe loader chokes on the new file size.

Is there a way to manipulate the exe so it would be acceptable for the loaders (mind this is a cross platform program)?