Added loclass-functionality into the pm3,the functionality provided by loclass can now be invoked directly from the pm3. Also fixed some issues with how prnlog called PrintAndLog, and added some testdata for the loclass self-tests
This commit is contained in:
1 parent
39d3ce5dd6
commit
6f101995b6
5 files changed
+72
-53
No files matched your search
@@ -526,7 +526,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)
|
||||
@@ -577,9 +577,18 @@ int _testBruteforce()
|
||||
**** The 64-bit HS Custom Key Value = 5B7C62C491C11B39 ****
|
||||
**/
|
||||
uint16_t keytable[128] = {0};
|
||||
//save some time...
|
||||
startvalue = 0x7B0000;
|
||||
errors |= bruteforceFile("iclass_dump.bin",keytable);
|
||||
|
||||
//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;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ int saveFile(const char *preferredName, const char *suffix, const void* data, si
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -21,4 +21,5 @@ int saveFile(const char *preferredName, const char *suffix, const void* data, si
|
||||
* @param fmt
|
||||
*/
|
||||
void prnlog(char *fmt, ...);
|
||||
int fileExists(const char *filename);
|
||||
#endif // FILEUTILS_H
|
||||
Binary file not shown.
Reference in new issue
Block a user