Guest User

Untitled

a guest
Apr 17th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int hide_file(char *host, char *hidden, char *name);
  5.  
  6. int show_file(char *hostfile, char *filename);
  7.  
  8. int main(void){
  9.  
  10.  char hostfile[75], hiddenfile[75], hiddenFileName[15];
  11.  int status1, status2;
  12.  
  13.  printf("Enter the name(with extension) and path of the file whose behind you want to hide another file: ");
  14. scanf("%75s", hostfile);
  15.  
  16. printf("Enter the path(with name and extension of the file) to the file you want to hide: ");
  17. scanf("%75s", hiddenfile);
  18.  
  19. printf("Enter the name of the file you want to hide: ");
  20. scanf("%15s", hiddenFileName);
  21.  
  22.  status1 =  hide_file(hostfile, hiddenfile, hiddenFileName);
  23.  
  24.   if (status1 == 0) {
  25.     printf("Stream created and file is hidden. \n");
  26.     status2 = show_file(hostfile, hiddenFileName);
  27.  
  28.  } else{
  29.  
  30.    printf("Something went wrong");
  31.  
  32.         }
  33.  
  34.  getchar();
  35.  getchar();
  36. return 0;
  37. }
  38.  
  39.  
  40. int hide_file(char *host, char *hidden, char *name){
  41.  
  42. int status = 0;
  43. char everything[150];
  44.  
  45. sprintf(everything, "type \"%s\" > \"%s:%s\"", hidden, host, name);
  46. status = system(everything);
  47.  
  48. return status;
  49. }
  50.  
  51.  
  52. int show_file(char *hostfile, char *filename){
  53.   int status_2 = 0;
  54.   char see_hidden[150];
  55.  
  56. sprintf(see_hidden ,"notepad %s:%s",hostfile, filename );
  57. status_2 = system(see_hidden);
  58.  
  59.  return status_2;
  60.  }
Advertisement
Add Comment
Please, Sign In to add comment