Expand description

This is a very simple crate that protects some of your integer variables from being modified by memory tamperers such as Cheat Engine. And check that they have not been attempted to be tampered with.


use protected_integer::{ProtectedInteger, State};

let mut my_number = ProtectedInteger::new(114514); // initialize this variable

// Check and get the value
match my_number.get() {
    State::Untampered(num) => {
        println!("The variable has not been tampered with");
    State::Tampered(num) => {
        println!("The variable was tampered with, but the backup variable was not");
        println!("The restored value is {}", num);

// if you just want to get the value
println!("The value is {}", my_number.get().to_value());

// change the value

For more information, check it on GitHub


The protected integer


The state of the protected integer