Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #define PASSFILE "/home/passtest/flag"
- #define MAX_SIZE 100
- int main(int argc, char **argv)
- {
- FILE * f;
- char password[MAX_SIZE + 1] = {0};
- if (argc < 2 || (f=fopen(PASSFILE, "r")) == NULL || fgets(password, MAX_SIZE, f) == NULL)
- {
- printf("Fail.\n");
- exit(1);
- }
- if (strncmp(argv[1], password, MAX_SIZE) == 0)
- {
- printf("Good Job =)\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement