GMGuard 1.0.0
GMGuard is a toolkit designed to protect your games from common cheating techniques - without too much setup required and with only couple lines of code.
Memory editing
Protect memory from being edited by debuggers such as Cheat Engine. You can supply a callback method which is triggered when a change outside of game logic is detected.
Example:
//////////////////////////////////////////////////////////////
// Init and lock
map = new gmguard.lockmap_create(); // create storage
gold = 100; // set some value
map.lock("gold", gold); // lock the value
map.callback_set(function() { game_end(); } ); // Optional: set a custom callback method or script
//////////////////////////////////////////////////////////////
// On change
map.unlock("gold", gold); // unlock
gold += 100; // change
map.lock("gold", gold); // lock
Speedhack
Prevent the game-loop from exceeding desired framerate by re-syncing the game step.
Example:
//////////////////////////////////////////////////////////////
// Step event (call only once per step)
gmguard.speedsync(); // sync the game step
if (gmguard.speedsync_fps_get() > 60) { // get true fps
game_end();
}
File tampering
Secure game-files which are sensitive to tampering. Optionally flag files to keep their backups as replacement in cases where GMGuard detects they've been tampered with.
Example:
//////////////////////////////////////////////////////////////
// Save file
var _fname = "score.dat",
_key = "mysavefile";
ini_open(_fname); // Save some data to ini
ini_write_real("score", "gold", gold);
ini_close();
gmguard.file_auth_update(_fname, _key); // Update auth
gmguard.file_auth_backup(_fname, _key); // Optional: backup to overwrite tampered files
//////////////////////////////////////////////////////////////
// Load file
var _fname = "score.dat",
_key = "mysavefile";
if !gmguard.file_auth_validate(_fname, "savefile") { // Check authenticity
game_end();
} else {
ini_open(_fname); // Load data from ini
gold = ini_read_real("score", "gold", 0);
ini_close();
}
Misc.
Disclaimer
End User Licence Agreement (EULA).