#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
bool pw_check(char *input) {
char flag[] = {0x4d, 0x44, 0x46, 0x4e, 0x46, 0x56, 0x40, 0x46, 0x28, 0x7e, 0x63, 0x34, 0x73, 0x36, 0x76, 0x5a, 0x52, 0x30, 0x56, 0x5a, 0x51, 0x6d, 0x36, 0x5a, 0x47, 0x36, 0x76, 0x51, 0x5a, 0x56, 0x35, 0x69, 0x61, 0x34, 0x60, 0x77, 0x78};
int inputLength = strlen(input);
int flagLength = strlen(flag);
int i = 0;
if (inputLength != flagLength) {
return false;
}
for (i = 0; i < inputLength; i++) {
if (input[i] != flag[i]) {
return false;
}
}
return true;
}
void operation_fives(char *input, char *output) {
int inputLength = strlen(input);
int i = 0;
for (i = 0; i < inputLength; i++) {
output[i] = input[i] ^ 5;
}
}
int main(int argc, char **argv) {
if (argc == 2) {
char *input;
char output[128];
bool result;
input = argv[1];
operation_fives(input, output);
result = pw_check(output);
if (result == true) {
printf("Success!\n");
} else {
printf("Failure!\n");
}
} else {
printf("Invalid input!\n");
}
}
New Videos Every other Sunday!