Assembly Shorts – Clearing Memory with XOR, REPNE, and STOSD

Clearing memory is a common task, whether manually done by the programmer or added by something like a compiler. In this video, we’ll explore how to clear memory using a few x86 instructions.

How to build the sample program with Visual Studio:
First, assemble with NASM:
nasm -f win32 zero_mem_xor.asm -o zero_mem_xor.obj

Then link with MSVC:
link /SUBSYSTEM:WINDOWS /ENTRY:start zero_mem_xor.obj kernel32.lib /OUT:zero_mem.exe /MACHINE:X86

Join this channel to get access to perks:
https://www.youtube.com/channel/UCI8zwug_Lv4_-KPT62oeDUA/join

Cybersecurity, reverse engineering, malware analysis and ethical hacking content!
🎓 Courses on Pluralsight 👉🏻 https://www.pluralsight.com/authors/josh-stroschein
🌶️ YouTube 👉🏻 Like, Comment & Subscribe!
🙏🏻 Support my work 👉🏻 https://patreon.com/JoshStroschein
🌎 Follow me 👉🏻 https://twitter.com/jstrosch, https://www.linkedin.com/in/joshstroschein/
⚙️ Tinker with me on Github 👉🏻 https://github.com/jstrosch
🤝 Join the Discord community and more 👉🏻 https://www.thecyberyeti.com