Created
November 4, 2013 04:03
-
-
Save rtoal/7297912 to your computer and use it in GitHub Desktop.
A fun executable to try on a 32-BIT x86 machine. I wrote this years and years and years ago.
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
/* | |
* bypass.c | |
* | |
* Try this on an x86 machine. It does **not** print "1". | |
*/ | |
#include <stdio.h> | |
void weird() { | |
int a; | |
*(&a + 2) += 7; | |
} | |
int main() { | |
int x = 0; | |
weird(); | |
x = 1; | |
printf("%d\n",x); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment