How can i protect my molecule class variables values such as bond length and inversion probability of NH3 from people like cheat-engine users (without slowing much)?
Does this protect from outer-effects?
class molecule
{
public:
molecule()
{
...
}
protected:
int *bond_length;
int *probability;
}
Is this safer?
class molecule
{
...
private:
int *bond_length;
int *probability;
}
If all above are vulnerable against cheat-engine-like softwares, then can below be logical?
class molecule
{
public:
molecule(){... ... ...}
...
...
//still public
int *bond_length_fake;
int *bond_length;
int *prob_fake;
int *prob;
}
...
//somewhere in the program
void thread_real_to_fake(void * molecule_parameters)
{
int bond_length_backup;
molecule * param=(molecule *)molecule_parameters;
while(working)
{
if((param->bond_length_fake)!=(param->bond_length))
{
param->bond_length_fake=param->bond_length;
}
}
_endthread();
}
Okay, this protects the fake by making it equal to real one always. But how to protect real one? Can I use random-pointer to get the real value? If yes, how can I?
You cannot protect your computer against running software. If someone is in control of the machine, they can manipulate it at will, and this includes modifying the state of a running program.
The safest thing you could do is run the program on a separate, inaccessible server and forward the I/O through the network (e.g. to a browser window).
Edit: As an alternative, you could run the engine part of your program as a service that runs as a separate user. This provides a certain amount of protection. The engine would have to check that the submitted user input (e.g. key strokes) come in at a reasonable rate. This allows you to enforce rules to a certain degree, but doesn’t prevent for example the user from seeing through walls by manipulating the graphics rendering in the client.