Skip to content

Commit

Permalink
added more hccapx import stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Dec 13, 2023
1 parent 055c341 commit 5131f90
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions hcxhashtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,9 +1933,12 @@ static void readhccapxfile(int fd_hccapxin, long int hccapxrecords)
{
static long int c;
static hccapx_t *hccapxptr;
static hashlist_t *zeiger, *hashlistnew;

static uint8_t hccapxblock[HCCAPX_SIZE];

hccapxptr = (hccapx_t*)hccapxblock;
zeiger = hashlist;
for(c = 0; c < hccapxrecords; c++)
{
readcount++;
Expand All @@ -1954,12 +1957,33 @@ for(c = 0; c < hccapxrecords; c++)
readerrorcount++;
continue;
}
if((hccapxptr->essid_len == 0) || (hccapxptr->essid_len > ESSID_LEN_MAX))
{
readerrorcount++;
continue;
}
memcpy(zeiger->essid, hccapxptr->essid, hccapxptr->essid_len);
zeiger->essidlen = hccapxptr->essid_len;



eapolcount++;
pmkideapolcount++;
}

printf("%ld\n", eapolcount);

pmkideapolcount = pmkidcount +eapolcount;
if(pmkideapolcount >= hashlistcount)
{
hashlistcount += HASHLIST_MAX;
hashlistnew = (hashlist_t*)realloc(hashlist, hashlistcount *HASHLIST_SIZE);
if(hashlistnew == NULL)
{
fprintf(stderr, "failed to allocate memory for internal list\n");
exit(EXIT_FAILURE);
}
hashlist = hashlistnew;
}
zeiger = hashlist +pmkideapolcount;
}
return;
}
/*===========================================================================*/
Expand Down

0 comments on commit 5131f90

Please sign in to comment.