Skip to content
Permalink
Browse files
Flow Three added
  • Loading branch information
aa9863 committed Oct 27, 2022
1 parent e023690 commit b4f0bdb878a8e0a095c1233561fc5c882a455720
Showing 1 changed file with 58 additions and 0 deletions.
@@ -0,0 +1,58 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define BUFFSIZE 30

int getPassword(char* buffer){
/* Get the Password */
printf("Enter Password> ");
fgets(buffer, BUFFSIZE, stdin);
//Remove the Newlines
buffer[strcspn(buffer, "\r\n")] = 0;
printf("\nYou put %s\n", buffer);
}

void showSuperWin(char* command){
printf("Super Win\n");
system(command);
}

void showWin(void){
printf("Congratulations you win\n");
}

void showLose(void){
printf("Lose\n");
}

void main(void){
char buffer[BUFFSIZE];
char *expected = "Swordfish";

getPassword(buffer);

if (strcmp(buffer, expected) == 0){
__asm__("nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop");
showWin();
}
else{
showLose();
}
}

0 comments on commit b4f0bdb

Please sign in to comment.