Guest User

sousdom.c by vincesafe

a guest
Jan 20th, 2014
305
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* sousdom.c version alpha 1
  2. This code is under CC BY-NC-SA 3.0 license.
  3. For more information, please visit the link below:
  4. https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
  5.  
  6. Ce code est sous licence CC BY-NC-SA 3.0.
  7. Plus d'informations à l'adresse suivante :
  8. https://creativecommons.org/licenses/by-nc-sa/3.0/fr/legalcode
  9.  
  10. By vincesafe
  11. http://vincesafe.fr/
  12. https://twitter.com/vincesafe
  13.  
  14. */
  15.  
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18.  
  19. #define FNAME "req"
  20.  
  21. int main(void)
  22. {
  23.     FILE *f = NULL;
  24.     f = fopen(FNAME, "rb");
  25.     if(f == NULL)
  26.         return -1;
  27.  
  28.     char str[140] = {0};
  29.     char c = 0, i = 0;
  30.  
  31.     fseek(f, 13, SEEK_SET);
  32.  
  33.     do {
  34.         c = fgetc(f);
  35.         str[i] = c;
  36.         i++;
  37.     }   while(c > 9); /* pas un "point dns" */
  38.     str[i-1] = 0; /* reset fin de chaine */
  39.  
  40.     printf("%s", str);
  41.    
  42.     return 0;
  43. }
RAW Paste Data