Skip to content

Instantly share code, notes, and snippets.

@ChoiSG
Last active October 15, 2020 18:11
Show Gist options
  • Save ChoiSG/15405f45d3371a4df5a3c0dc579bdd28 to your computer and use it in GitHub Desktop.
Save ChoiSG/15405f45d3371a4df5a3c0dc579bdd28 to your computer and use it in GitHub Desktop.
testo.c
#include <stdio.h>
#include <time.h>
#include <string.h>
int main(){
printf("Opening blahblahblah\n");
int n, a = 0;
char psy[20];
//printf("Please enter the original digit of the sentence\n");
//scanf("%d%*c",&n);
printf("Look at the hint and figure out the original sentence\n");
printf("hint: The original sentence is very long\n\n\n");
while(1){
printf("[DEBUG] Initial a value = %d\n\n",a);
gets(psy);
printf("You typed : \n");
puts(psy);
printf("\n");
/* // This if-statement is resetting the a value. Get rid of it.
if(!strcmp(psy,"password_doesnt_exist")){
a = 1;
}
else{
a = 0;
}
*/
printf("[DEBUG] BoF'ed a value = %d\n\n",a);
if(a){
printf("Congratulations! You've solved the puzzle\n");
break;
}
else{
printf("Nope. Try again.\n");
}
sleep(1000);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment