diff --git a/include/filenames.h b/include/filenames.h index 167103da0..434e1f555 100644 --- a/include/filenames.h +++ b/include/filenames.h @@ -15,4 +15,6 @@ void generate_cached_kernel_mp_filename (const uint opti_type, const uint opts_t void generate_source_kernel_amp_filename (const uint attack_kern, char *shared_dir, char *source_file); void generate_cached_kernel_amp_filename (const uint attack_kern, char *profile_dir, const char *device_name_chksum, char *cached_file); +char *filename_from_filepath (char *filepath); + #endif // _FILENAMES_H diff --git a/src/filenames.c b/src/filenames.c index 0f69f6a1e..72f49546e 100644 --- a/src/filenames.c +++ b/src/filenames.c @@ -73,3 +73,23 @@ void generate_cached_kernel_amp_filename (const uint attack_kern, char *profile_ { snprintf (cached_file, 255, "%s/kernels/amp_a%d.%s.kernel", profile_dir, attack_kern, device_name_chksum); } + +char *filename_from_filepath (char *filepath) +{ + char *ptr = NULL; + + if ((ptr = strrchr (filepath, '/')) != NULL) + { + ptr++; + } + else if ((ptr = strrchr (filepath, '\\')) != NULL) + { + ptr++; + } + else + { + ptr = filepath; + } + + return ptr; +} diff --git a/src/hashcat.c b/src/hashcat.c index 8f95c797e..1b66f4fa3 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1360,25 +1360,7 @@ static void hc_signal (void (callback) (int)) */ -static char *filename_from_filepath (char *filepath) -{ - char *ptr = NULL; - if ((ptr = strrchr (filepath, '/')) != NULL) - { - ptr++; - } - else if ((ptr = strrchr (filepath, '\\')) != NULL) - { - ptr++; - } - else - { - ptr = filepath; - } - - return ptr; -} static uint convert_from_hex (char *line_buf, const uint line_len) {