From ccb6eeb92cf4f0545f57e2f7ac9659d6c1425e26 Mon Sep 17 00:00:00 2001 From: Florian Zevedei Date: Sat, 16 Sep 2023 17:37:22 +0200 Subject: [PATCH 1/2] Adding percentage indicator for loading big xpoint files --- keyhunt.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/keyhunt.cpp b/keyhunt.cpp index a9a66e1..6a0a0fa 100644 --- a/keyhunt.cpp +++ b/keyhunt.cpp @@ -6464,6 +6464,9 @@ bool forceReadFileXPoint(char *fileName) { fprintf(stderr,"[E] Error opening the file %s, line %i\n",fileName,__LINE__ - 2); return false; } + + fprintf(stderr, "[+] Count lines in file"); + /*Count lines in the file*/ numberItems = 0; while(!feof(fileDescriptor)) { @@ -6489,11 +6492,21 @@ bool forceReadFileXPoint(char *fileName) { if(!initBloomFilter(&bloom,N)) return false; + uint64_t onepercent = numberItems / 100; + i= 0; while(i < N) { memset(aux,0,1000); hextemp = fgets(aux,1000,fileDescriptor); memset((void *)&addressTable[i],0,sizeof(struct address_value)); + + //Show loading percentage in 1% steps + if (i % onepercent == 0) { + + fprintf(stderr, "\r[+] %lu %%\r", (i / onepercent)); + + } + if(hextemp == aux) { trim(aux," \t\n\r"); stringtokenizer(aux,&tokenizer_xpoint); From a160919490df8f23d3b5f38754650be20d3dfbc4 Mon Sep 17 00:00:00 2001 From: Florian Zevedei Date: Mon, 18 Sep 2023 17:50:53 +0200 Subject: [PATCH 2/2] Adding missing line break --- keyhunt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyhunt.cpp b/keyhunt.cpp index 6a0a0fa..4515c96 100644 --- a/keyhunt.cpp +++ b/keyhunt.cpp @@ -6465,7 +6465,7 @@ bool forceReadFileXPoint(char *fileName) { return false; } - fprintf(stderr, "[+] Count lines in file"); + fprintf(stderr, "[+] Count lines in file\n"); /*Count lines in the file*/ numberItems = 0;