simplify
This commit is contained in:
1 parent
1888e2f7ac
commit
42c8699abc
6 files changed
+136
-19
No files matched your search
@@ -22,4 +22,7 @@ BDF5E846
|
||||
# TSPL
|
||||
5453504C
|
||||
05040202
|
||||
25293C2F
|
||||
25293C2F
|
||||
#
|
||||
# Tecom
|
||||
7A7A7A7B
|
||||
@@ -6,11 +6,27 @@
|
||||
AEA684A6DAB23278 # AA1
|
||||
7665544332211000 # key1/Kc from PicoPass 2k documentation
|
||||
0123456789ABCDEF # SAGEM
|
||||
#
|
||||
# KeyNo 14 X-reader
|
||||
5b7c62c491c11b39 # from loclass demo file.
|
||||
# KeyNo 13 X-reader
|
||||
FEB475FABF65BE43
|
||||
# KeyNo 12 X-reader
|
||||
B58EA6E835FFC090
|
||||
# KeyNo 460F1F15 X-reader
|
||||
976CE582C3263457
|
||||
#
|
||||
F0E1D2C3B4A59687 # Kd from PicoPass 2k documentation
|
||||
5CBCF1DA45D5FB4F # PicoPass Default Exchange Key
|
||||
31ad7ebd2f282168 # From HID multiclassSE reader
|
||||
#
|
||||
0102030405060708 # default HID 3DES
|
||||
5CBCF1DA45D5FB5F # picopass?
|
||||
E0D1629F4DAEF400 # unkn
|
||||
69434C694D414944 # iCLiMAID
|
||||
#
|
||||
E9924C13F4BFA82C # custom key
|
||||
#
|
||||
# From pastebin: https://pastebin.com/uHqpjiuU
|
||||
6EFD46EFCBB3C875
|
||||
E033CA419AEE43F9
|
||||
|
||||
@@ -737,6 +737,7 @@ static int add_nonce(uint32_t nonce_enc, uint8_t par_enc) {
|
||||
|
||||
if (p2 == NULL) {
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
|
||||
} else if ((p1->nonce_enc & 0x00ff0000) != (nonce_enc & 0x00ff0000)) { // found distinct 2nd byte. Need to insert.
|
||||
@@ -748,6 +749,7 @@ static int add_nonce(uint32_t nonce_enc, uint8_t par_enc) {
|
||||
|
||||
if (p2 == NULL) {
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
|
||||
} else { // we have seen this 2nd byte before. Nothing to add or insert.
|
||||
@@ -1267,8 +1269,17 @@ static int read_nonce_file(char *filename) {
|
||||
uint32_t nt_enc1 = bytes_to_num(read_buf, 4);
|
||||
uint32_t nt_enc2 = bytes_to_num(read_buf + 4, 4);
|
||||
uint8_t par_enc = bytes_to_num(read_buf + 8, 1);
|
||||
add_nonce(nt_enc1, par_enc >> 4);
|
||||
add_nonce(nt_enc2, par_enc & 0x0f);
|
||||
|
||||
int add_res = add_nonce(nt_enc1, par_enc >> 4);
|
||||
if (add_res == PM3_EMALLOC) {
|
||||
return add_res;
|
||||
}
|
||||
|
||||
add_res = add_nonce(nt_enc2, par_enc & 0x0f);
|
||||
if (add_res == PM3_EMALLOC) {
|
||||
return add_res;
|
||||
}
|
||||
|
||||
num_acquired_nonces += 2;
|
||||
bytes_read = fread(read_buf, 1, 9, fnonces);
|
||||
}
|
||||
@@ -1528,7 +1539,12 @@ static int simulate_acquire_nonces(void) {
|
||||
|
||||
for (uint16_t i = 0; i < 113; i++) {
|
||||
simulate_MFplus_RNG(cuid, known_target_key, &nt_enc, &par_enc);
|
||||
num_acquired_nonces += add_nonce(nt_enc, par_enc);
|
||||
|
||||
int add_res = add_nonce(nt_enc, par_enc);
|
||||
if ( add_res == PM3_EMALLOC) {
|
||||
return add_res;
|
||||
}
|
||||
num_acquired_nonces += add_res;
|
||||
total_num_nonces++;
|
||||
}
|
||||
|
||||
@@ -1663,10 +1679,23 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
|
||||
uint32_t nt_enc2 = bytes_to_num(bufp + 4, 4);
|
||||
uint8_t par_enc = bytes_to_num(bufp + 8, 1);
|
||||
|
||||
//PrintAndLogEx(INFO, "Encrypted nonce: %08x, encrypted_parity: %02x\n", nt_enc1, par_enc >> 4);
|
||||
num_acquired_nonces += add_nonce(nt_enc1, par_enc >> 4);
|
||||
//PrintAndLogEx(INFO, "Encrypted nonce: %08x, encrypted_parity: %02x\n", nt_enc2, par_enc & 0x0f);
|
||||
num_acquired_nonces += add_nonce(nt_enc2, par_enc & 0x0f);
|
||||
|
||||
// PrintAndLogEx(INFO, "Encrypted nonce: %08x, encrypted_parity: %02x\n", nt_enc1, par_enc >> 4);
|
||||
int add_res = add_nonce(nt_enc1, par_enc >> 4);
|
||||
if (add_res == PM3_EMALLOC) {
|
||||
DropField();
|
||||
return add_res;
|
||||
}
|
||||
|
||||
num_acquired_nonces += add_res;
|
||||
|
||||
// PrintAndLogEx(INFO, "Encrypted nonce: %08x, encrypted_parity: %02x\n", nt_enc2, par_enc & 0x0f);
|
||||
add_res = add_nonce(nt_enc2, par_enc & 0x0f);
|
||||
if (add_res == PM3_EMALLOC) {
|
||||
DropField();
|
||||
return add_res;
|
||||
}
|
||||
num_acquired_nonces += add_res;
|
||||
|
||||
if (nonce_file_write) {
|
||||
fwrite(bufp, 1, 9, fnonces);
|
||||
|
||||
Reference in new issue
Block a user