Last active
January 28, 2021 01:15
-
-
Save Sasszem/58478d3aaa20e99a476dec09692ec39a to your computer and use it in GitHub Desktop.
Pwn me - do not modify the source, but make it print the "you won" text! Use Linux/WSL!
This file contains hidden or 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() { | |
| long admin = 0; | |
| long s; | |
| char name[100]; | |
| fprintf(stdout, "\e[41mDEBUG:\e[49m %p\n", &s); | |
| fprintf(stdout, "\e[41mDEBUG:\e[49m %ld %ld\n", sizeof s, sizeof &s); | |
| printf("Whats ur name? "); | |
| scanf("%100s", name); | |
| printf("Hov old r u? "); | |
| scanf("%ld", &s); | |
| printf("Hello, "); | |
| printf(name); | |
| if (admin) | |
| printf("you won!"); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment