Guest User

Untitled

a guest
Aug 10th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. C Buffer overflow Display message (Using Ubuntu and DDD)
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. void badf(int n, char c, char* buffer)
  5. {
  6. int i;
  7. for (i=0; i<n; i++)
  8. {
  9. buffer[i]=c;
  10. }
  11.  
  12. }
  13.  
  14. void f(int n, char c)
  15. {
  16. char buffer[16];
  17. badf(n,c,buffer);
  18. }
  19.  
  20. void message ()
  21. {
  22. printf("Hellon");
  23.  
  24. }
  25.  
  26. int main()
  27. {
  28. f(32,0x08048411);
  29. return 0;
  30. }
  31.  
  32. void badf(int n, unsigned int u, char* buffer)
  33. ...
  34.  
  35. void f(int n, unsigned int u)
  36. ...
Add Comment
Please, Sign In to add comment