Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <string.h>
- #define BUFSIZE 16
- #define PASSWORD "toutoune"
- int main(int argc, char **argv)
- {
- int len_user = 0;
- int auth = 0;
- char pass[16];
- char *user = (char *)malloc(BUFSIZE);
- char *password = (char *)malloc(BUFSIZE);
- len_user = strlen(argv[2]);
- strcpy(pass, argv[1]);
- strncpy(password, argv[1], strlen(argv[1]));
- if (strncmp(password, PASSWORD, strlen(PASSWORD))) {
- printf("FAILED\n");
- return 1;
- }
- strncpy(user, argv[2], strlen(argv[2]));
- if (strlen(user) == strlen(password)) {
- printf("FAILED\n");
- return 1;
- }
- if (auth < 0 && !strncmp(user, password, strlen(password))) {
- printf("THE FLAG SHOULD BE HERE ;)\n");
- return 0;
- }
- printf("FAILED\n");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement