Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <unistd.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. char flag[50];
  5. int init(){
  6.   setvbuf(stdout, 0LL, 2, 0LL);
  7.   setvbuf(stderr, 0LL, 2, 0LL);
  8.  
  9.   FILE * f=fopen("/home/ctf/flag","rb");
  10.   if (f==0){
  11.     puts("Can't find my flag >..< Exiting...");
  12.     exit(0);
  13.   }
  14.   fread(&flag,1,50,f);
  15.   fclose(f);
  16.   f=0;
  17. }
  18.  
  19. int main(){
  20.     init();
  21.     char buf[512];
  22.     while(1){
  23.         fgets(buf,512,stdin);
  24.         printf(buf);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement