Skip to content

Instantly share code, notes, and snippets.

@trietptm
Created October 30, 2013 10:03
Show Gist options
  • Save trietptm/7230008 to your computer and use it in GitHub Desktop.
Save trietptm/7230008 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
char flag[] = "not_the_real_flag";
int main(int argc, char *argv[]) {
int data = 0xdeadbeef;
char buf[1024];
printf("What's your name? ");
fflush(stdout);
gets(buf);
printf("Hi %s\n", buf);
fflush(stdout);
if (data != 0xdeadbeef) {
printf("How did this happen? Here is your flag: \"%s\"\n", flag);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment