Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- #include<stdlib.h>
- int main(int argc, char** argv) {
- for(int i=0; i<argc; i++) {
- printf("%s\n", argv[i]);
- for(int c=0; c<strlen(argv[i]); c++){
- argv[i][c]='x';
- }
- }
- system("sleep 60");
- }
- peter@peter:~/tmp/changecl.c$ gcc -std=c99 changecl.c
- peter@peter:~/tmp/changecl.c$ ./a.out --help &
- peter@peter:~/tmp/changecl.c$ echo $!
- 1359
- peter@peter:~/tmp/changecl.c$ ps -ef | grep 1359
- peter 1359 19837 0 13:30 pts/19 00:00:00 xxxxxxx xxxxxx
- peter 1360 1359 0 13:30 pts/19 00:00:00 sleep 60
- peter 1400 1361 0 13:31 pts/20 00:00:00 grep --color=auto 1359
- peter@peter:~/tmp/changecl.c$ cat /proc/1359/cmdline
- xxxxxxxxxxxxx
- peter@peter:~/tmp/changecl.c$ hexdump -C /proc/1359/cmdline
- 00000000 78 78 78 78 78 78 78 00 78 78 78 78 78 78 00 |xxxxxxx.xxxxxx.|
- 0000000f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement