Files
ctf/2026/cscg/web/knowledge-base/readflag.c
2026-04-10 03:31:12 +02:00

18 lines
269 B
C

#include <stdio.h>
int main(void) {
char flag[256] = {0};
FILE* fp = fopen("/flag.txt", "r");
if (!fp) {
perror("fopen");
return 1;
}
if (fread(flag, 1, 256, fp) < 0) {
perror("fread");
return 1;
}
puts(flag);
fclose(fp);
return 0;
}