int main(int argc, char **argv){ int *ptr = &secret; printf(argv[1]); if (secret == 1337){ give_shell(); } return 0; }
void vuln(char *input) { char buf[16]; int secret = 0; strcpy(buf, input); if (secret == 0xDEADBEEF) { give_shell(); } else { printf("Sorry, secret = 0x%08X\n", secret); } }
void vuln(){ char buf[16]; int fd; int secret = 0; printf("Read from file\n"); fd = open("./input.txt", O_RDONLY); read(fd, buf, 32); close(fd); if (secret == 0xc0deface){ give_shell(); } else{ printf("The secret is %x\n", secret); } }