ZaR...@gmail.com wrote:
Hi all,
i want to build an executable, wich take in parameter a path to another
executable. My executable add a protection like a password with a
window or an expiration time out. My executable build a new executable
with new protections.
This is my idea but i don't find on a network some tutorials or group
to help me
If anyome has done a similar projetc or can help me ...
#include <cstdlib>
#include <iostream>
#include <string>
int main()
{
std::cout << "Please enter your password: " << std::flush;
std::string password;
std::cin >password;
if(password != "helloworld")
{
std::cout << "Sorry, wrong password." << std::endl;
return EXIT_FAILURE;
}
std::system("my_other_program.exe");
return 0;
}
The above is just a simplified example. You probably want to read the
password from some (possibly encrypted) file and have more error
checking. Of course, to protect against the user running the executable
directly you would probably have to encrypt it as well.
Regards,
Bart.