Last active
December 17, 2015 02:39
-
-
Save jbcrail/5537467 to your computer and use it in GitHub Desktop.
A short program designed to demonstrate how to remove program arguments from process listing.
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
// Compile: gcc -o incognito incognito.c | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
// Removes all program arguments from process listing | |
if (argc > 1) { | |
char *arg_end; | |
arg_end = argv[argc-1] + strlen(argv[argc-1]); | |
*arg_end = ' '; | |
} | |
sleep(30000); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment