Skip to content

Instantly share code, notes, and snippets.

@gomasy
Created October 16, 2015 05:58
Show Gist options
  • Select an option

  • Save gomasy/18d15a1032b9de99e00e to your computer and use it in GitHub Desktop.

Select an option

Save gomasy/18d15a1032b9de99e00e to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char msg[1024];
static int flag = 0;
if (argc < 2) {
printf("[*] Error: no argument specified.\n");
return 1;
}
strcpy(msg, argv[1]);
printf(msg);
printf("\n\n[*] flag @ 0x%08x = %d 0x%08x\n", &flag, flag, flag);
if (flag)
printf("Rewrite successed!\n");
else
printf("Rewrite failed...\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment