ADD: added a lot of ic ids to cmdhf15.c Thanks to Asper for the list.

ADD: added a manufacturer list for hf 14a reader,  only viable when UID is double or triple size.  Thanks to Asper for the list.
ADD: Some changes from Holimans commits.
CHG: some more code clean up.
This commit is contained in:
iceman1001
2015-01-06 11:17:02 +01:00
parent 0452ec6c90
commit 10403a6a30
16 changed files with 318 additions and 181 deletions

View File

@@ -563,7 +563,7 @@ int bruteforceFile(const char *filename, uint16_t keytable[])
fseek(f, 0, SEEK_SET);
uint8_t *dump = malloc(fsize);
size_t bytes_read = fread(dump, fsize, 1, f);
size_t bytes_read = fread(dump, 1, fsize, f);
fclose(f);
if (bytes_read < fsize)
@@ -614,9 +614,18 @@ int _testBruteforce()
**** The 64-bit HS Custom Key Value = 5B7C62C491C11B39 ****
**/
uint16_t keytable[128] = {0};
//save some time...
startvalue = 0x7B0000;
//Test a few variants
if(fileExists("iclass_dump.bin"))
{
errors |= bruteforceFile("iclass_dump.bin",keytable);
}else if(fileExists("loclass/iclass_dump.bin")){
errors |= bruteforceFile("loclass/iclass_dump.bin",keytable);
}else if(fileExists("client/loclass/iclass_dump.bin")){
errors |= bruteforceFile("client/loclass/iclass_dump.bin",keytable);
}else{
prnlog("Error: The file iclass_dump.bin was not found!");
}
}
return errors;
}

View File

@@ -51,11 +51,11 @@
int fileExists(const char *filename) {
#ifdef _WIN32
struct _stat fileStat;
int result = _stat(filename, &fileStat);
struct _stat st;
int result = _stat(filename, &st);
#else
struct stat fileStat;
int result = stat(filename, &fileStat);
struct stat st;
int result = stat(filename, &st);
#endif
return result == 0;
}
@@ -113,11 +113,11 @@ int loadFile(const char *fileName, void* data, size_t datalen)
*/
void prnlog(char *fmt, ...)
{
char buffer[2048] = {0};
va_list args;
va_start(args,fmt);
PrintAndLog(fmt, args);
//vprintf(fmt,args);
vsprintf (buffer,fmt, args);
va_end(args);
//printf("\n");
PrintAndLog(buffer);
}

View File

@@ -68,4 +68,5 @@ int loadFile(const char *fileName, void* data, size_t datalen);
* @param fmt
*/
void prnlog(char *fmt, ...);
int fileExists(const char *filename);
#endif // FILEUTILS_H