32 lines
509 B
C
32 lines
509 B
C
#include <stdio.h>
|
|
|
|
#define MAX_STRINGS 32
|
|
|
|
char *normal_string = "/bin/sh";
|
|
|
|
void setup() {
|
|
setvbuf(stdin, NULL, _IONBF, 0);
|
|
setvbuf(stdout, NULL, _IONBF, 0);
|
|
setvbuf(stderr, NULL, _IONBF, 0);
|
|
}
|
|
|
|
void hello() {
|
|
puts("Howdy gamers!");
|
|
printf("Okay I'll be nice. Here's the address of setvbuf in libc: %p\n", &setvbuf);
|
|
}
|
|
|
|
int main() {
|
|
char *all_strings[MAX_STRINGS] = {NULL};
|
|
char buf[1024] = {'\0'};
|
|
|
|
setup();
|
|
hello();
|
|
|
|
fgets(buf, 1024, stdin);
|
|
printf(buf);
|
|
|
|
puts(normal_string);
|
|
|
|
return 0;
|
|
}
|