Created
March 30, 2014 14:08
-
-
Save mdeous/9873265 to your computer and use it in GitHub Desktop.
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> | |
| #include <stdlib.h> | |
| char username[512] = {1}; | |
| void (*_atexit)(int) = exit; | |
| void cp_username(char *name, const char *arg) | |
| { | |
| while((*(name++) = *(arg++))); | |
| *name = 0; | |
| } | |
| int main(int argc, char **argv) | |
| { | |
| if(argc != 2) | |
| { | |
| printf("[-] Usage : %s <username>\n", argv[0]); | |
| exit(0); | |
| } | |
| cp_username(username, argv[1]); | |
| printf("[+] Running program with username : %s\n", username); | |
| _atexit(0); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment