optimised memory alteration detection