1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00

Move filename_from_filepath() to filenames.c

This commit is contained in:
jsteube 2016-09-08 16:17:28 +02:00
parent 18534fcdeb
commit 367473c657
3 changed files with 22 additions and 18 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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)
{