Advertisement
Guest User

Untitled

a guest
May 20th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. //vuln.c
  2. #include <stdio.h>
  3. #include <string.h>
  4. int main(int argc, char **argv) {
  5. // Make some stack information
  6. char a[100], b[100], c[100], d[100];
  7. // Call the exploitable function
  8. exploitable(argv[1]);
  9. // Return everything is OK
  10. return(0); }
  11.  
  12. int exploitable(char *arg) {
  13. // Make some stack space
  14. char buffer[10];
  15. // Now copy the buffer
  16. strcpy(buffer, arg);
  17. printf("The buffer says .. [%s/%p].\n", buffer, &buffer);
  18. // Return everything fun
  19. return(0); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement