Protecting IoT Devices through a Hardware-driven Memory Verification