Advertisement
raisep0wn

NDH 2k10 public wargame, level2

Apr 24th, 2011
208
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***********************************
  2. |            level2.c              |
  3. |  http://wargame.nuitduhack.com/  |
  4. |  http://www.nuitduhack.com/      |
  5. ***********************************/
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9.  
  10. int main(int argc, char *argv[])
  11. {
  12.     char *buffer = malloc(sizeof(char)*(strlen("man ")+strlen(argv[1])+1));
  13.  
  14.     if(argc<2 || strlen(argv[1])>50) {
  15.         printf("Manpage <argument>\n");
  16.         exit(0);
  17.     }
  18.  
  19.     strcpy(buffer, "man ");
  20.     strcat(buffer, argv[1]);
  21.  
  22.     system(buffer);
  23.     return 0;
  24. }
Advertisement
RAW Paste Data Copied
Advertisement