I am currently working on an encryptor/decryptor. I want it to work in the following way:
1: You start the encryptor in CMD and give it an argument for which file should be encrypted.
2: The encryptor encrypts the file according to the argument.
3 - here comes the hard part:
The third step is to generate the key/decryptor, which will be used to decrypt the encrypted file. This key contains information about which file this specific key should encrypt and how it should be encrypted. I want this key to be an exe-file or a C++-program itself, that is generated by the encryptor.
How do I generate C++ code and compile it from another program that is already running? I want this to be portable and work on most Windows 7 machines.
My current thought is to first simply write the code from the program and then send a command to Windows cmd that then compiles it. But different computers will have different compilers, won't they? So how do I do this? :S
you can always use write to file on fstream and use system to compile, but honestly i think making a basic ml-like generator would be better. dont use ml itself, as its os specific, but you could use binary or hex