Advertisement
raisep0wn

NDH 2k10 public wargame, level5

Apr 24th, 2011
280
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***********************************
  2. |            level5.c              |
  3. |  http://wargame.nuitduhack.com/  |
  4. |  http://www.nuitduhack.com/      |
  5. ***********************************/
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <unistd.h>
  9.  
  10. // gcc -o level5 level5.c -fno-stack-protector -z execstack -mpreferred-stack-boundary=2
  11.  
  12. void setArray(int frame, int value) {
  13.     int array[32];
  14.  
  15.     array[frame] = value;
  16.     printf("fill case %d with %d.\n", frame, value);
  17.     return;
  18. }
  19.  
  20. int main(int argc, char **argv) {
  21.     if (argc != 3)
  22.         printf("syntax: %s [slot] [val]\n", argv[0]);
  23.     else
  24.         setArray(atoi(argv[1]), atoi(argv[2]));
  25.     exit(0);
  26. }
Advertisement
RAW Paste Data Copied
Advertisement