diff --git a/hijack/hijack.c b/hijack/hijack.c index 0ad6789..9edba1a 100644 --- a/hijack/hijack.c +++ b/hijack/hijack.c @@ -142,7 +142,6 @@ hijack_log(" Executing log dumper script:"); hijack_log(" exec(\"%s %s\") executing...", LOG_DUMP_BINARY, LOG_PATH); result = exec_and_wait(log_dump_args); hijack_log(" returned: %d", result); - #endif // check to see if hijack was already run, and if so, just continue on. @@ -319,8 +318,11 @@ hijack_log(" returned: %d", result); } } + char hijacked_executable_fullpath[PATH_MAX]; + readlink("/proc/self/exe", hijacked_executable_fullpath, sizeof(hijacked_executable_fullpath)); + char real_executable[PATH_MAX]; - sprintf(real_executable, "%s.bin", hijacked_executable); + sprintf(real_executable, "%s/%s.bin", dirname(hijacked_executable_fullpath), basename(hijacked_executable)); char ** argp = (char **)malloc(sizeof(char *) * (argc + 1)); for (i = 0; i < argc; i++) { argp[i]=argv[i]; diff --git a/hijack/hijack.h b/hijack/hijack.h index 9f67906..a3731f5 100644 --- a/hijack/hijack.h +++ b/hijack/hijack.h @@ -78,7 +78,7 @@ int exec_and_wait(char ** argp); int remount_root(const char * hijack_exec, int rw); int hijack_mount(const char * hijack_exec, const char * dev, const char * mount_point); int hijack_umount(const char * hijack_exec, const char * mount_point); -void hijacK_log(char * format, ...); +void hijack_log(char * format, ...); int mark_file(char * filename); #endif