Advertisement
raisep0wn

NDH 2k10 public wargame, level6

May 8th, 2011
179
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***********************************
  2. |            level6.c              |
  3. |  http://wargame.nuitduhack.com/  |
  4. |  http://www.nuitduhack.com/      |
  5. ***********************************/
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <string.h>
  9.  
  10. // gcc -o level6 level6.c -fno-stack-protector -z execstack -mpreferred-stack-boundary=2
  11.  
  12. int layer(char *arg){
  13.     if(strlen(arg)>128) {
  14.         printf("Aww noes you'r crazy !\n");
  15.         exit(0);
  16.     }
  17.     char buf[128];
  18.     strcpy(buf, arg);
  19.     return 0;
  20. }
  21.  
  22. int main(int argc, char *argv[])
  23. {
  24.     if(!argv[1]) return;
  25.  
  26.     layer(argv[1]);
  27.     return 0;
  28. }
Advertisement
RAW Paste Data Copied
Advertisement