create personalized binary without having to recompile
Hello,
I would like to create personalized compiled application - which should be a single-exe-file on windows, and a single application-bundle on mac.
The user should download the file through http - and the webserver should personalize the file for every use - without having to compile the application every time.
Is there a possibility to have somewhere in the binary some "space" where I can place such user-data without corrupting the binary? When running the binary it could open itself and get the personalized data out of it.
thanks,
niko
Re: create personalized binary without having to recompile
Why not put the personalized data in a separate file, with a generic format?
The application can read the data from that file.
Re: create personalized binary without having to recompile
I would like to provide a single-exe the user just has to start
(no installer, no zip-file to extract, just one exe)
Re: create personalized binary without having to recompile
You can place a static const char* buffer in the application. Then after the compilation simply find the buffer in memory and replace that part of file with something else when you need it. Should work fine...
Re: create personalized binary without having to recompile
thanks, I will try that!
however it won't work when packing the executable using UPX (to get a smaller download-filesize)
any ideas for that case?
niko
Re: create personalized binary without having to recompile
You could write something similar to UPX, that will take the executable and the data and combine them into a new executable, that loads the data into memory and starts the original application.
Re: create personalized binary without having to recompile
Or you can call upx on the resulting executable after substituting the block.
Re: create personalized binary without having to recompile
Some installers are scriptable. You could generate the installer on the fly when the user requests the download. I know of a few companies that "inject" personal license keys this way.
Re: create personalized binary without having to recompile
much thanks for those tips!!
niko