Created
January 29, 2020 22:53
-
-
Save ArchdukeTim/51c6061d2f00eeb5a7ce22bb063230c0 to your computer and use it in GitHub Desktop.
old data
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void foo() { | |
volatile int i = 0; | |
volatile char x[] = "exploit"; | |
printf("Doing something with %s\n", x); | |
} | |
void bar() { | |
char x[8]; | |
char y[8] = {'\0'}; | |
fgets(y, 8, stdin); | |
if (strcmp(y, "exploit")) { | |
for (int i = 0; i < 8; i++) { | |
if (y[i] == '\0') break; | |
x[i] = y[i]; | |
} | |
} else exit(0); | |
printf("Running %s\n", x); | |
} | |
int main() { | |
foo(); | |
bar(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment