Created
October 4, 2014 20:57
-
-
Save iagox86/ca1b3c0b9e427f1cd104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void spawn_shell() | |
{ | |
system("/bin/sh"); | |
exit(0); | |
} | |
int main(int argc, char *argv[]) | |
{ | |
int i = 0; | |
char str[16]; | |
int j = 0; | |
printf("spawn_shell is at 0x%p\n", spawn_shell); | |
printf("i = %d\x", i); | |
printf("j = %d\x", j); | |
printf("Please enter a string: "); | |
gets(str); | |
printf("\n"); | |
printf("i = %d\x", i); | |
printf("j = %d\x", j); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment