Skip to content

Instantly share code, notes, and snippets.

@ArchdukeTim
Created January 29, 2020 22:53
Show Gist options
  • Save ArchdukeTim/51c6061d2f00eeb5a7ce22bb063230c0 to your computer and use it in GitHub Desktop.
Save ArchdukeTim/51c6061d2f00eeb5a7ce22bb063230c0 to your computer and use it in GitHub Desktop.
old data
#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