Skip to content

Instantly share code, notes, and snippets.

@xk
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xk/8902866 to your computer and use it in GitHub Desktop.
Save xk/8902866 to your computer and use it in GitHub Desktop.
Manipulate the stack frame return address
//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