Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- + +-------------------------+
- | | +---------------------+ |
- | | | Stack Frame Previo | |
- | | +---------------------+ |
- | | +---------------------+ |
- | | | Argumentos | |
- | | +---------------------+ |
- | | +---------------------+ |
- | | | Direccion de Retorno| |
- | | | EIP o RET | |
- | | +---------------------+ |
- | | +---------------------+ |
- | | |Puntero Base Guardado| |
- | | | EBP | |
- STACK | | +---------------------+ | EBP
- | | +---------------------+ | <-------+
- | | | | |
- | | | | |
- | | | | |
- | | | char buf[32] | |
- | | | | |
- | | | | |
- | | | | | ESP
- | | +---------------------+ | <-------+
- | | +---------------------+ |
- | | | Espacio no | |
- | | | no reservado del | |
- | | | STACK | |
- | | | ... | |
- | | +---------------------+ |
- v +-------------------------+
- ```
- ```c
- #include <string.h>
- #include <stdio.h>
- void func(char *arg){
- char nombre[32];
- strcpy(nombre, arg);
- printf("Welcome to the jungle %s \n",nombre);
- }
- int main(int argc, char *argv[]){
- if(argc != 2){
- printf("Uso: %s NOMBRE\n", argv[0]);
- return 1;
- }
- func(argv[1]);
- printf("Fin del programa\n");
- return 0;
- }
- ```
Add Comment
Please, Sign In to add comment