Guest User

Untitled

a guest
Feb 17th, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. ```
  2. + +-------------------------+
  3. | | +---------------------+ |
  4. | | | Stack Frame Previo | |
  5. | | +---------------------+ |
  6. | | +---------------------+ |
  7. | | | Argumentos | |
  8. | | +---------------------+ |
  9. | | +---------------------+ |
  10. | | | Direccion de Retorno| |
  11. | | | EIP o RET | |
  12. | | +---------------------+ |
  13. | | +---------------------+ |
  14. | | |Puntero Base Guardado| |
  15. | | | EBP | |
  16. STACK | | +---------------------+ | EBP
  17. | | +---------------------+ | <-------+
  18. | | | | |
  19. | | | | |
  20. | | | | |
  21. | | | char buf[32] | |
  22. | | | | |
  23. | | | | |
  24. | | | | | ESP
  25. | | +---------------------+ | <-------+
  26. | | +---------------------+ |
  27. | | | Espacio no | |
  28. | | | no reservado del | |
  29. | | | STACK | |
  30. | | | ... | |
  31. | | +---------------------+ |
  32. v +-------------------------+
  33.  
  34. ```
  35.  
  36.  
  37. ```c
  38. #include <string.h>
  39. #include <stdio.h>
  40.  
  41. void func(char *arg){
  42. char nombre[32];
  43. strcpy(nombre, arg);
  44. printf("Welcome to the jungle %s \n",nombre);
  45. }
  46.  
  47. int main(int argc, char *argv[]){
  48. if(argc != 2){
  49. printf("Uso: %s NOMBRE\n", argv[0]);
  50. return 1;
  51. }
  52. func(argv[1]);
  53. printf("Fin del programa\n");
  54. return 0;
  55. }
  56. ```
Add Comment
Please, Sign In to add comment