topic:
Featuring the following C class
Class A
{
Int value;
PUBLIC:
A (int n = 0): value (n) {}
Int getValue ()
{
Return Value;
}
}
Use some way to change the value of the private member A :: Value outside the class.
Possible method of programmers:
Class A
{
Int value;
PUBLIC:
A (int n = 0): value (n) {}
Int getValue ()
{
Return Value;
}
Void SetValue (int N)
{
Value = n;
}
}
Void f ()
{
A a a;
A.SetValue (5);
}
Hacker's possible practices:
Void f ()
{
A a a;
* (INT *) & a) = 5;
}
in conclusion:
Programmers are accustomed to following existing restrictions to increase existing things.
Hackers are used to using existing things to break existing restrictions.