mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
style
This commit is contained in:
parent
7e114da30f
commit
317ddf42bc
7 changed files with 21 additions and 21 deletions
|
@ -878,7 +878,7 @@ void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags,
|
||||||
|
|
||||||
LED_C_ON();
|
LED_C_ON();
|
||||||
|
|
||||||
uint8_t prev_enc_nt[] = {0,0,0,0};
|
uint8_t prev_enc_nt[] = {0, 0, 0, 0};
|
||||||
uint8_t prev_counter = 0;
|
uint8_t prev_counter = 0;
|
||||||
|
|
||||||
for (uint16_t i = 0; i <= PM3_CMD_DATA_SIZE - 9;) {
|
for (uint16_t i = 0; i <= PM3_CMD_DATA_SIZE - 9;) {
|
||||||
|
|
|
@ -1570,7 +1570,7 @@ void annotateMifare(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize,
|
||||||
|
|
||||||
// get UID
|
// get UID
|
||||||
if (MifareAuthState == masNone) {
|
if (MifareAuthState == masNone) {
|
||||||
if (isResponse && cmdsize == 5 ) {
|
if (isResponse && cmdsize == 5) {
|
||||||
ClearAuthData();
|
ClearAuthData();
|
||||||
AuthData.uid = bytes_to_num(&cmd[0], 4);
|
AuthData.uid = bytes_to_num(&cmd[0], 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1842,7 +1842,7 @@ static int CmdHF14AMfNestedHard(const char *Cmd) {
|
||||||
CLIParserInit(&ctx, "hf mf hardnested",
|
CLIParserInit(&ctx, "hf mf hardnested",
|
||||||
"Nested attack for hardened MIFARE Classic cards.\n"
|
"Nested attack for hardened MIFARE Classic cards.\n"
|
||||||
"if card is EV1, command can detect and use known key see example below\n"
|
"if card is EV1, command can detect and use known key see example below\n"
|
||||||
"\n"
|
" \n"
|
||||||
"`--i<X>` set type of SIMD instructions. Without this flag programs autodetect it.\n"
|
"`--i<X>` set type of SIMD instructions. Without this flag programs autodetect it.\n"
|
||||||
" or \n"
|
" or \n"
|
||||||
" hf mf hardnested -r --tk [known target key]\n"
|
" hf mf hardnested -r --tk [known target key]\n"
|
||||||
|
@ -7033,8 +7033,8 @@ static int CmdHF14AGen4Load(const char *cmd) {
|
||||||
if (blockno == start) flags |= MAGIC_INIT ;
|
if (blockno == start) flags |= MAGIC_INIT ;
|
||||||
if (blockno == end) flags |= MAGIC_OFF ;
|
if (blockno == end) flags |= MAGIC_OFF ;
|
||||||
|
|
||||||
int res=mfG4SetBlock(pwd, blockno, data + (blockno * MFBLOCK_SIZE), flags);
|
int res = mfG4SetBlock(pwd, blockno, data + (blockno * MFBLOCK_SIZE), flags);
|
||||||
if ( res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
PrintAndLogEx(WARNING, "Can't set magic card block: %d. error=%d", blockno, res);
|
PrintAndLogEx(WARNING, "Can't set magic card block: %d. error=%d", blockno, res);
|
||||||
PrintAndLogEx(HINT, "Verify your card size, and try again or try another tag position");
|
PrintAndLogEx(HINT, "Verify your card size, and try again or try another tag position");
|
||||||
free(data);
|
free(data);
|
||||||
|
@ -7195,10 +7195,10 @@ static int CmdHF14AGen4View(const char *Cmd) {
|
||||||
|
|
||||||
uint8_t flags = 0 ;
|
uint8_t flags = 0 ;
|
||||||
if (i == 0) flags |= MAGIC_INIT ;
|
if (i == 0) flags |= MAGIC_INIT ;
|
||||||
if (i+1 == block_cnt) flags |= MAGIC_OFF ;
|
if (i + 1 == block_cnt) flags |= MAGIC_OFF ;
|
||||||
|
|
||||||
int res = mfG4GetBlock(pwd, i, dump + (i * MFBLOCK_SIZE), flags);
|
int res = mfG4GetBlock(pwd, i, dump + (i * MFBLOCK_SIZE), flags);
|
||||||
if ( res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
PrintAndLogEx(WARNING, "Can't get magic card block: %u. error=%d", i, res);
|
PrintAndLogEx(WARNING, "Can't get magic card block: %u. error=%d", i, res);
|
||||||
PrintAndLogEx(HINT, "Verify your card size, and try again or try another tag position");
|
PrintAndLogEx(HINT, "Verify your card size, and try again or try another tag position");
|
||||||
free(dump);
|
free(dump);
|
||||||
|
|
|
@ -2251,7 +2251,7 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
|
||||||
update_reduction_rate(0.0, true);
|
update_reduction_rate(0.0, true);
|
||||||
|
|
||||||
int res = simulate_acquire_nonces();
|
int res = simulate_acquire_nonces();
|
||||||
if ( res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ static const uint8_t g_mifare_default_key[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0x
|
||||||
static const uint8_t g_mifare_mad_key[] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5};
|
static const uint8_t g_mifare_mad_key[] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5};
|
||||||
static const uint8_t g_mifare_mad_key_b[] = {0x89, 0xEC, 0xA9, 0x7F, 0x8C, 0x2A};
|
static const uint8_t g_mifare_mad_key_b[] = {0x89, 0xEC, 0xA9, 0x7F, 0x8C, 0x2A};
|
||||||
|
|
||||||
// 16 key B D01AFEEB890A
|
// 16 key B D01AFEEB890A
|
||||||
static const uint8_t g_mifare_signature_key_a[] = {0x5C, 0x8F, 0xF9, 0x99, 0x0D, 0xA2};
|
static const uint8_t g_mifare_signature_key_a[] = {0x5C, 0x8F, 0xF9, 0x99, 0x0D, 0xA2};
|
||||||
static const uint8_t g_mifare_signature_key_b[] = {0x4b, 0x79, 0x1b, 0xea, 0x7b, 0xcc};
|
static const uint8_t g_mifare_signature_key_b[] = {0x4b, 0x79, 0x1b, 0xea, 0x7b, 0xcc};
|
||||||
|
|
||||||
|
|
|
@ -1425,7 +1425,7 @@ int detect_mf_magic(bool is_mfc) {
|
||||||
|
|
||||||
bool detect_mfc_ev1_signature(void) {
|
bool detect_mfc_ev1_signature(void) {
|
||||||
uint64_t key = 0;
|
uint64_t key = 0;
|
||||||
int res = mfCheckKeys(69, MF_KEY_B, false, 1, (uint8_t*)g_mifare_signature_key_b, &key);
|
int res = mfCheckKeys(69, MF_KEY_B, false, 1, (uint8_t *)g_mifare_signature_key_b, &key);
|
||||||
return (res == PM3_SUCCESS);
|
return (res == PM3_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue