Last active
August 29, 2015 13:56
-
-
Save xk/8902866 to your computer and use it in GitHub Desktop.
Manipulate the stack frame return address
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
//2014-02-09 jorge@jorgechamorro.com | |
//Manipulate the stack frame return address | |
#include <stdio.h> | |
#include <string.h> | |
void uno () { | |
char** r= (char**) &r+2; | |
while (**r != '\x90') (*r)++; | |
} | |
int main () { | |
char a[18]; | |
strcpy(a, "GeorgeOfTheJungle"); | |
uno(); | |
strcpy(a, "EhhQuePassaTronco"); | |
asm("nop"); | |
printf("%s\n", a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment