mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 07:05:40 -07:00
Merge branch 'master' into 213TT
This commit is contained in:
commit
23e0268a1a
8 changed files with 21 additions and 12 deletions
|
@ -755,7 +755,7 @@ void mifare_cypher_single_block(desfirekey_t key, uint8_t *data, uint8_t *ivect,
|
|||
memcpy(ovect, data, block_size);
|
||||
}
|
||||
|
||||
uint8_t edata[DESFIRE_MAX_CRYPTO_BLOCK_SIZE];
|
||||
uint8_t edata[DESFIRE_MAX_CRYPTO_BLOCK_SIZE] = {0};
|
||||
|
||||
switch (key->type) {
|
||||
case T_DES:
|
||||
|
|
|
@ -139,6 +139,7 @@ void MifareDesfireGetInformation(void) {
|
|||
uint8_t details[14];
|
||||
} PACKED payload;
|
||||
|
||||
memset(&payload, 0x00, sizeof(payload));
|
||||
/*
|
||||
1 = PCB 1
|
||||
2 = cid 2
|
||||
|
|
|
@ -643,6 +643,7 @@ static int CmdFlashMemInfo(const char *Cmd) {
|
|||
|
||||
if (got_private == false) {
|
||||
mbedtls_rsa_free(rsa);
|
||||
free(rsa);
|
||||
}
|
||||
|
||||
mbedtls_pk_free(&pkctx);
|
||||
|
|
|
@ -898,7 +898,7 @@ void annotateMfDesfire(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
|||
snprintf(exp, size, "R-block NACK(%d)", (cmd[0] & 0x01));
|
||||
}
|
||||
// I-block 000xCN1x
|
||||
else if ((cmd[0] & 0xC0) == 0x00) {
|
||||
else if (((cmd[0] & 0xC0) == 0x00) && (cmdsize > 2)) {
|
||||
|
||||
// PCB [CID] [NAD] [INF] CRC CRC
|
||||
int pos = 1;
|
||||
|
|
|
@ -80,12 +80,14 @@ static int sendTry(uint8_t format_idx, wiegand_card_t *card, uint32_t delay, boo
|
|||
);
|
||||
}
|
||||
|
||||
lf_hidsim_t payload;
|
||||
payload.Q5 = false;
|
||||
payload.hi2 = packed.Top;
|
||||
payload.hi = packed.Mid;
|
||||
payload.lo = packed.Bot;
|
||||
payload.longFMT = (packed.Mid > 0xFFF);
|
||||
lf_hidsim_t payload = {
|
||||
.EM = false,
|
||||
.Q5 = false,
|
||||
.hi2 = packed.Top,
|
||||
.hi = packed.Mid,
|
||||
.lo = packed.Bot,
|
||||
.longFMT = (packed.Mid > 0xFFF)
|
||||
};
|
||||
|
||||
clearCommandBuffer();
|
||||
|
||||
|
|
|
@ -111,7 +111,8 @@ int main(int argc, char *argv[]) {
|
|||
uint8_t tag_challenge[16] = {0x00};
|
||||
uint8_t lock_challenge[32] = {0x00};
|
||||
|
||||
uint64_t timestamp = atoi(argv[1]);
|
||||
uint64_t timestamp = 0;
|
||||
sscanf(argv[1], "%"PRIu64, ×tamp);
|
||||
|
||||
if (argc != 4) {
|
||||
printf("\nusage: %s <unix timestamp> <16 byte tag challenge> <32 byte lock challenge>\n\n", argv[0]);
|
||||
|
@ -124,8 +125,10 @@ int main(int argc, char *argv[]) {
|
|||
if (hexstr_to_byte_array(argv[3], lock_challenge, sizeof(lock_challenge)))
|
||||
return 3;
|
||||
|
||||
// current time
|
||||
uint64_t start_time = time(NULL);
|
||||
|
||||
// from a time before up until current time.
|
||||
for (; timestamp < start_time; timestamp++) {
|
||||
|
||||
make_key(timestamp, key);
|
||||
|
|
|
@ -233,7 +233,8 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
if (argc != 4) return usage(argv[0]);
|
||||
|
||||
uint64_t start_time = atoi(argv[1]);
|
||||
uint64_t start_time = 0;
|
||||
sscanf(argv[1], "%"PRIu64, &start_time);
|
||||
|
||||
uint8_t tag_challenge[16] = {0x00};
|
||||
if (hexstr_to_byte_array(argv[2], tag_challenge, sizeof(tag_challenge)))
|
||||
|
|
|
@ -172,7 +172,7 @@ static void print_time(uint64_t at) {
|
|||
char res[32];
|
||||
strftime(res, sizeof(res), "%Y-%m-%d %H:%M:%S", <);
|
||||
|
||||
printf("%u ( '%s' )\n", (unsigned)t, res);
|
||||
printf("%"PRIu64" ( '%s' )\n", t, res);
|
||||
}
|
||||
|
||||
static void *brute_thread(void *arguments) {
|
||||
|
@ -378,7 +378,8 @@ int main(int argc, char *argv[]) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
uint64_t start_time = atoi(argv[3]);
|
||||
uint64_t start_time = 0;
|
||||
sscanf(argv[3], "%"PRIu64, &start_time);
|
||||
|
||||
printf("Crypto algo............ " _GREEN_("%s") "\n", algostr);
|
||||
printf("LCR Random generator... " _GREEN_("%s") "\n", generators[g_idx].Name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue