cscg ist super
This commit is contained in:
17
2026/cscg/web/knowledge-base/readflag.c
Normal file
17
2026/cscg/web/knowledge-base/readflag.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user