Created
September 24, 2017 18:04
-
-
Save 0xdeadbeefJERKY/27f90124364842eb3b5ff8fc98549ec0 to your computer and use it in GitHub Desktop.
Simple C file explaining the execution of the 'ret' x86/x64 instruction
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> | |
int main() | |
{ | |
// call function and save the address | |
// pointing to the 'int varint = 0' line | |
// on the stack | |
printf("Hello world\n"); | |
// once 'printf' is finished, pop | |
// the saved address off the stack | |
// to continue execution here | |
int varint = 0; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment