Advertisement
Combreal

level04.c

Aug 20th, 2020
1,305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. #define COMMANDE "/bin/cat /home/level04/.password"
  6.  
  7. int main(int argc, char ** argv)
  8. {
  9.         char text[1024];
  10.         static int check=168;
  11.         if(argc!=2)
  12.         {
  13.                 printf("Usage : %s <texte>\n",argv[0]);
  14.                 return 1;
  15.         }
  16.         strncpy(text,argv[1],1023);
  17.         printf("Voici votre texte :\n");
  18.         printf(text);
  19.         printf("\n");
  20.         if(check==75)
  21.         {
  22.                 printf("check @ 0x%08x = %d : 0x%08x\n",&check,check,check);
  23.                 system(COMMANDE);
  24.         }
  25.         else
  26.         {
  27.                 printf("check @ 0x%08x = %d : 0x%08x\n",&check,check,check);
  28.         }
  29.         return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement