Removing warnings and fixing final performance printf

This commit is contained in:
lab 2018-05-16 13:59:42 -07:00
parent 5430f17aa5
commit ed6cf26c59
3 changed files with 10 additions and 8 deletions

View File

@ -215,7 +215,7 @@ char *cuda_attack(
numReadPassword,
(char *)hostPassword,
(char *)(hostPassword+((numReadPassword-1)*PSW_CHAR_SIZE)),
cudaThreads, gridBlocks, (elapsedTime/1000.0), numReadPassword/(elapsedTime/1000.0));
(elapsedTime/1000.0), numReadPassword/(elapsedTime/1000.0));
match=check_match();
if(match) done=1;
@ -226,9 +226,9 @@ char *cuda_attack(
fclose(fp);
if(match==1)
printf("\n\n================================================\nCUDA attack completed\nPasswords evaluated: %d\nPassword found: %s\n================================================\n\n", totReadPsw, outPsw);
printf("\n\n================================================\nCUDA attack completed\nPasswords evaluated: %lld\nPassword found: %s\n================================================\n\n", totReadPsw, outPsw);
else
printf("\n\n================================================\nCUDA attack completed\nPasswords evaluated: %d\nPassword not found!\n================================================\n\n", totReadPsw);
printf("\n\n================================================\nCUDA attack completed\nPasswords evaluated: %lld\nPassword not found!\n================================================\n\n", totReadPsw);
BITCRACKER_CUDA_CHECK( cudaUnbindTexture(&w_password) );
BITCRACKER_CUDA_CHECK( cudaFreeHost(hostPassword) );

View File

@ -29,6 +29,7 @@
#include <limits.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>

View File

@ -62,7 +62,8 @@ char *opencl_attack(char *dname, unsigned int * w_blocks,
size_t szGlobalWorkSize;
size_t szLocalWorkSize;
int numReadPassword, tot_psw, ret, totReadPsw=0; //passwordBufferSize
int numReadPassword, tot_psw, ret;
long long int totReadPsw=0; //passwordBufferSize
FILE *fp_kernel, *fp_file_passwords;
//Really ugly...
char fileNameAttack[] = "./src_OpenCL/kernel_attack.cl";
@ -398,12 +399,12 @@ char *opencl_attack(char *dname, unsigned int * w_blocks,
}
if(match==1)
printf("\n\n================================================\nOpenCL attack completed\nPasswords evaluated: %d\nPassword found: [%s]\n================================================\n\n", totReadPsw, outPsw);
printf("\n\n================================================\nOpenCL attack completed\nPasswords evaluated: %lld\nPassword found: [%s]\n================================================\n\n", totReadPsw, outPsw);
else
printf("\n\n================================================\nOpenCL attack completed\nPasswords evaluated: %d\nPassword not found!\n================================================\n\n", totReadPsw);
printf("\n\n================================================\nOpenCL attack completed\nPasswords evaluated: %lld\nPassword not found!\n================================================\n\n", totReadPsw);
out1:
printf("\nTot passwords evaluated: %d\n", totReadPsw);
printf("\nTot passwords evaluated: %lld\n", totReadPsw);
/* Display result */
if (fp_file_passwords != stdin)
@ -424,4 +425,4 @@ out:
printf("Password not found\n");
return NULL;
}
}