X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/463ca973e7cf1e866bb60d7cc33d38e473aa4d3d..7c5f70dd9f8805967628f429f96fe1159a8bb827:/client/loclass/elite_crack.c?ds=sidebyside diff --git a/client/loclass/elite_crack.c b/client/loclass/elite_crack.c index a2bd6647..3801d662 100644 --- a/client/loclass/elite_crack.c +++ b/client/loclass/elite_crack.c @@ -151,9 +151,9 @@ void hash1(uint8_t csn[] , uint8_t k[]) k[0] = csn[0]^csn[1]^csn[2]^csn[3]^csn[4]^csn[5]^csn[6]^csn[7]; k[1] = csn[0]+csn[1]+csn[2]+csn[3]+csn[4]+csn[5]+csn[6]+csn[7]; k[2] = rr(swap( csn[2]+k[1] )); - k[3] = rr(swap( csn[3]+k[0] )); - k[4] = ~rr(swap( csn[4]+k[2] ))+1; - k[5] = ~rr(swap( csn[5]+k[3] ))+1; + k[3] = rl(swap( csn[3]+k[0] )); + k[4] = ~rr( csn[4]+k[2] )+1; + k[5] = ~rl( csn[5]+k[3] )+1; k[6] = rr( csn[6]+(k[4]^0x3c) ); k[7] = rl( csn[7]+(k[5]^0xc3) ); int i; @@ -563,9 +563,13 @@ int bruteforceFile(const char *filename, uint16_t keytable[]) fseek(f, 0, SEEK_SET); uint8_t *dump = malloc(fsize); - fread(dump, fsize, 1, f); - fclose(f); + size_t bytes_read = fread(dump, fsize, 1, f); + fclose(f); + if (bytes_read < fsize) + { + prnlog("Error, could only read %d bytes (should be %d)",bytes_read, fsize ); + } return bruteforceDump(dump,fsize,keytable); } /**