Last active
August 29, 2015 14:22
-
-
Save st98/6b2affd6813ae9cdd959 to your computer and use it in GitHub Desktop.
rep stosd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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