Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (recording == 1){
- write(p[1], input, strlen(input));
- close(p[1]);
- }
- if (strcmp(input, "key_logger on")==0){
- if (pipe(p) == -1) {
- exit(1);
- }
- else {
- pid = fork();
- if (pid == 0) {
- dup2(p[0],0);
- close(p[1]);
- read(p[0], input, strlen(input));
- execlp("key_logger", "key_logger", "temp", NULL);
- }
- else {
- close(p[0]);
- pskip = 1;
- recording = 1;
- }
- }
- }
- if (strcmp(input, "key_logger off")==0){
- pskip = 1;
- loggeroff();
- }
- if (pskip != 1) {
- parse(input);
- }
- else {
- pskip = 0;
- }
- printf("\nadsh$ ");
- }
- atexit(loggeroff);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement