mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-20 15:26:13 +08:00
fix CID #405232
This commit is contained in:
parent
060f452530
commit
8f20eed914
|
@ -1265,7 +1265,8 @@ int CmdEM4x05Info(const char *Cmd) {
|
||||||
|
|
||||||
// read word 1 (serial #) doesn't need pwd
|
// read word 1 (serial #) doesn't need pwd
|
||||||
// continue if failed, .. non blocking fail.
|
// continue if failed, .. non blocking fail.
|
||||||
em4x05_read_word_ext(EM_SERIAL_BLOCK, 0, false, &serial);
|
int res = em4x05_read_word_ext(EM_SERIAL_BLOCK, 0, false, &serial);
|
||||||
|
(void)res;
|
||||||
|
|
||||||
printEM4x05info(block0, serial);
|
printEM4x05info(block0, serial);
|
||||||
|
|
||||||
|
|
|
@ -163,12 +163,12 @@ int demodGuard(bool verbose) {
|
||||||
bool unknown = false;
|
bool unknown = false;
|
||||||
switch (fmtLen) {
|
switch (fmtLen) {
|
||||||
case 36:
|
case 36:
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: FC 1: %x", (plain[3] & 0x7F) << 7);
|
PrintAndLogEx(DEBUG, "DEBUG: FC 1: %x", (plain[3] & 0x7F) << 7);
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: FC 2: %x", plain[4] >> 1);
|
PrintAndLogEx(DEBUG, "DEBUG: FC 2: %x", plain[4] >> 1);
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Card 1: %x", (plain[4] & 1) << 19);
|
PrintAndLogEx(DEBUG, "DEBUG: Card 1: %x", (plain[4] & 1) << 19);
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Card 2: %x", plain[5] << 11);
|
PrintAndLogEx(DEBUG, "DEBUG: Card 2: %x", plain[5] << 11);
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Card 3: %x", plain[6] << 3);
|
PrintAndLogEx(DEBUG, "DEBUG: Card 3: %x", plain[6] << 3);
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Card 4: %x", (plain[7] & 0xE0) >> 5);
|
PrintAndLogEx(DEBUG, "DEBUG: Card 4: %x", (plain[7] & 0xE0) >> 5);
|
||||||
FC = ((plain[3] & 0x7F) << 7) | (plain[4] >> 1);
|
FC = ((plain[3] & 0x7F) << 7) | (plain[4] >> 1);
|
||||||
Card = ((plain[4] & 1) << 19) | (plain[5] << 11) | (plain[6] << 3) | ((plain[7] & 0xE0) >> 5);
|
Card = ((plain[4] & 1) << 19) | (plain[5] << 11) | (plain[6] << 3) | ((plain[7] & 0xE0) >> 5);
|
||||||
break;
|
break;
|
||||||
|
@ -271,7 +271,7 @@ static int CmdGuardClone(const char *Cmd) {
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
uint32_t xorval = arg_get_u32_def(ctx, 1, 0);
|
uint32_t xorval = arg_get_u32_def(ctx, 1, 0);
|
||||||
uint32_t fmtlen = arg_get_u32_def(ctx, 2, 0);
|
uint32_t fmtlen = arg_get_u32_def(ctx, 2, 0);
|
||||||
uint32_t fc = arg_get_u32_def(ctx, 3, 0);
|
uint32_t fc = arg_get_u32_def(ctx, 3, 0);
|
||||||
uint32_t cn = arg_get_u32_def(ctx, 4, 0);
|
uint32_t cn = arg_get_u32_def(ctx, 4, 0);
|
||||||
|
@ -357,7 +357,7 @@ static int CmdGuardSim(const char *Cmd) {
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
uint32_t xorval = arg_get_u32_def(ctx, 1, 0);
|
uint32_t xorval = arg_get_u32_def(ctx, 1, 0);
|
||||||
uint32_t fmtlen = arg_get_u32_def(ctx, 2, 0);
|
uint32_t fmtlen = arg_get_u32_def(ctx, 2, 0);
|
||||||
uint32_t fc = arg_get_u32_def(ctx, 3, 0);
|
uint32_t fc = arg_get_u32_def(ctx, 3, 0);
|
||||||
uint32_t cn = arg_get_u32_def(ctx, 4, 0);
|
uint32_t cn = arg_get_u32_def(ctx, 4, 0);
|
||||||
|
@ -376,7 +376,7 @@ static int CmdGuardSim(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "Simulating Guardall Prox - xorKey: " _YELLOW_("%u") " Facility Code: " _YELLOW_("%u") " CardNumber: " _YELLOW_("%u")
|
PrintAndLogEx(SUCCESS, "Simulating Guardall Prox - xorKey: " _YELLOW_("%u") " Facility Code: " _YELLOW_("%u") " CardNumber: " _YELLOW_("%u")
|
||||||
, xorval
|
, xorval
|
||||||
, facilitycode
|
, facilitycode
|
||||||
, cardnumber
|
, cardnumber
|
||||||
);
|
);
|
||||||
|
|
|
@ -488,7 +488,7 @@ static int CmdHIDBrute(const char *Cmd) {
|
||||||
arg_param_begin,
|
arg_param_begin,
|
||||||
arg_lit0("v", "verbose", "verbose output"),
|
arg_lit0("v", "verbose", "verbose output"),
|
||||||
arg_str1("w", "wiegand", "<format>", "see " _YELLOW_("`wiegand list`") " for available formats"),
|
arg_str1("w", "wiegand", "<format>", "see " _YELLOW_("`wiegand list`") " for available formats"),
|
||||||
arg_str1(NULL, "field", "<fc|cn>", "field to bruteforce"),
|
arg_str1(NULL, "field", "<fc|cn>", "field to bruteforce"),
|
||||||
arg_u64_0(NULL, "fc", "<dec>", "facility code"),
|
arg_u64_0(NULL, "fc", "<dec>", "facility code"),
|
||||||
arg_u64_0(NULL, "cn", "<dec>", "card number"),
|
arg_u64_0(NULL, "cn", "<dec>", "card number"),
|
||||||
arg_u64_0("i", "issue", "<dec>", "issue level"),
|
arg_u64_0("i", "issue", "<dec>", "issue level"),
|
||||||
|
@ -515,7 +515,7 @@ static int CmdHIDBrute(const char *Cmd) {
|
||||||
|
|
||||||
wiegand_card_t card_hi, card_low;
|
wiegand_card_t card_hi, card_low;
|
||||||
memset(&card_hi, 0, sizeof(wiegand_card_t));
|
memset(&card_hi, 0, sizeof(wiegand_card_t));
|
||||||
|
|
||||||
char field[3] = {0};
|
char field[3] = {0};
|
||||||
int field_len = 0;
|
int field_len = 0;
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 3), (uint8_t *)field, sizeof(field), &field_len);
|
CLIParamStrToBuf(arg_get_str(ctx, 3), (uint8_t *)field, sizeof(field), &field_len);
|
||||||
|
@ -587,7 +587,7 @@ static int CmdHIDBrute(const char *Cmd) {
|
||||||
return sendPing();
|
return sendPing();
|
||||||
}
|
}
|
||||||
|
|
||||||
// do one up
|
// do one up
|
||||||
if (direction != 2 && fin_hi != true) {
|
if (direction != 2 && fin_hi != true) {
|
||||||
if (sendTry(format_idx, &card_hi, delay, verbose) != PM3_SUCCESS) {
|
if (sendTry(format_idx, &card_hi, delay, verbose) != PM3_SUCCESS) {
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -366,8 +366,8 @@ void Flashmem_print_status(void) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Dbprintf(" Device ID............... " _YELLOW_("%02X / %02X (unknown)"),
|
Dbprintf(" Device ID............... " _YELLOW_("%02X / %02X (unknown)"),
|
||||||
device_type.manufacturer_id,
|
device_type.manufacturer_id,
|
||||||
device_type.device_id
|
device_type.device_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ static void print_time(uint64_t at) {
|
||||||
strftime(res, sizeof(res), "('%Y-%m-%d %H:%M:%S')", <);
|
strftime(res, sizeof(res), "('%Y-%m-%d %H:%M:%S')", <);
|
||||||
#else
|
#else
|
||||||
strftime(res, sizeof(res), "%s ('%Y-%m-%d %H:%M:%S')", <);
|
strftime(res, sizeof(res), "%s ('%Y-%m-%d %H:%M:%S')", <);
|
||||||
#endif
|
#endif
|
||||||
printf("%s\n", res);
|
printf("%s\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ static void print_time(uint64_t at) {
|
||||||
strftime(res, sizeof(res), "('%Y-%m-%d %H:%M:%S')", <);
|
strftime(res, sizeof(res), "('%Y-%m-%d %H:%M:%S')", <);
|
||||||
#else
|
#else
|
||||||
strftime(res, sizeof(res), "%s ('%Y-%m-%d %H:%M:%S')", <);
|
strftime(res, sizeof(res), "%s ('%Y-%m-%d %H:%M:%S')", <);
|
||||||
#endif
|
#endif
|
||||||
printf("%s\n", res);
|
printf("%s\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue