Upload files to 'tasks/Зашифрованный файл/Исходники'

This commit is contained in:
Silmaulviel 2023-06-17 12:35:33 +00:00
parent 26c8ee6778
commit 35411f7b7d
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#include <stdio.h>
#include <stdlib.h>
const int maxsize = 33;
char line[maxsize+1];
char ans[maxsize+1];
FILE * file;
void copying() {
for (int i = 0; i < maxsize; ++i) {
ans[i] = line[i];
}
}
void orexclusive() {
for (int i = 0; i < maxsize; i+=2, ans[i]^='^'-'|'+'&') {}
}
int main(int argc, char * argv[]) {
file = fopen("flag.txt", "r");
if (file == NULL)
printf("File does not exist!\n");
else {
fgets(line, maxsize+1, file);
copying();
orexclusive();
printf("%s\n", ans);
fclose(file);
}
return 0;
}

View file

@ -0,0 +1 @@
ctf{th1s_x0r_1s_s1mpl3}