added test for philips in the selftest

This commit is contained in:
iceman1001 2023-06-11 21:53:42 +02:00
parent 4180f6bfe2
commit 219d38e0fa

View file

@ -583,7 +583,7 @@ int mfc_algo_touch_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t *
int generator_selftest(void) { int generator_selftest(void) {
#ifndef ON_DEVICE #ifndef ON_DEVICE
#define NUM_OF_TEST 8 #define NUM_OF_TEST 9
PrintAndLogEx(INFO, "PWD / KEY generator selftest"); PrintAndLogEx(INFO, "PWD / KEY generator selftest");
PrintAndLogEx(INFO, "----------------------------"); PrintAndLogEx(INFO, "----------------------------");
@ -633,18 +633,27 @@ int generator_selftest(void) {
testresult++; testresult++;
PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %08X - %s", sprint_hex(uid6, 7), pwd6, success ? "OK" : "->A9C4C3C0<--"); PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %08X - %s", sprint_hex(uid6, 7), pwd6, success ? "OK" : "->A9C4C3C0<--");
uint8_t uid7[] = {0x04, 0x0D, 0x4B, 0x5A, 0xC5, 0x71, 0x81};
uint8_t mfg[] = {0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x20, 0x35, 0x32, 0x4D};
uint32_t pwd7 = ul_ev1_pwdgenG(uid7, mfg);
success = (pwd7 == 0xFBCFACC1);
if (success)
testresult++;
PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %08X - %s", sprint_hex(uid7, 7), pwd7, success ? "OK" : "->FBCFACC1<--");
// uint8_t uid5[] = {0x11, 0x22, 0x33, 0x44}; // uint8_t uid5[] = {0x11, 0x22, 0x33, 0x44};
// uint64_t key1 = mfc_algo_a(uid5); // uint64_t key1 = mfc_algo_a(uid5);
// success = (key1 == 0xD1E2AA68E39A); // success = (key1 == 0xD1E2AA68E39A);
// PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %"PRIx64" - %s", sprint_hex(uid5, 4), key1, success ? "OK" : "->D1E2AA68E39A<--"); // PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %"PRIx64" - %s", sprint_hex(uid5, 4), key1, success ? "OK" : "->D1E2AA68E39A<--");
uint8_t uid7[] = {0x74, 0x57, 0xCA, 0xA9}; uint8_t uid8[] = {0x74, 0x57, 0xCA, 0xA9};
uint64_t key7 = 0; uint64_t key8 = 0;
mfc_algo_sky_one(uid7, 15, 0, &key7); mfc_algo_sky_one(uid8, 15, 0, &key8);
success = (key7 == 0x82c7e64bc565); success = (key8 == 0x82c7e64bc565);
if (success) if (success)
testresult++; testresult++;
PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %"PRIx64" - %s", sprint_hex(uid7, 4), key7, success ? "OK" : "->82C7E64BC565<--"); PrintAndLogEx(success ? SUCCESS : WARNING, "UID | %s | %"PRIx64" - %s", sprint_hex(uid8, 4), key8, success ? "OK" : "->82C7E64BC565<--");
uint32_t lf_id = lf_t55xx_white_pwdgen(0x00000080); uint32_t lf_id = lf_t55xx_white_pwdgen(0x00000080);