QWXFB-2024/热身赛/Re_ezxor/ez_xor.c
2024-09-16 11:35:04 +08:00

18 lines
405 B
C

#include <stdio.h>
#include <string.h>
unsigned char xor_flag[] = {0, 10, 7, 1, 29, 50, 14, 87, 21, 57, 87, 21, 57, 31, 86, 19, 20, 57, 0, 10, 82, 1, 27};
int main() {
char buf[0x200];
read(0, buf, 0x100);
buf[20] = 0;
for(int i = 0; i < 23; ++i) {
buf[i] ^= 0x66;
}
if(!strcmp(buf, xor_flag)) {
puts("You win!");
} else {
puts("You failed!");
}
}