Skip to content

Instantly share code, notes, and snippets.

@st98
Last active August 29, 2015 14:22
Show Gist options
  • Save st98/6b2affd6813ae9cdd959 to your computer and use it in GitHub Desktop.
Save st98/6b2affd6813ae9cdd959 to your computer and use it in GitHub Desktop.
rep stosd
// gcc -masm=intel rep_stosd.c -o a
#include <stdio.h>
char s[16] = "Hello, world!";
int main(void) {
printf("[+] %s\n", s);
asm volatile(
"mov eax, 0x44434241;"
"mov ecx, 0x2;"
"lea edi, [s];"
"rep stosd"
);
printf("[+] %s\n", s);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment