mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Make Style
This commit is contained in:
parent
ef74541b28
commit
4dc8d5316a
16 changed files with 154 additions and 126 deletions
|
@ -376,7 +376,7 @@ void RunMod(void) {
|
||||||
|
|
||||||
// dynamic_response_info will be in charge of responses
|
// dynamic_response_info will be in charge of responses
|
||||||
dynamic_response_info.response_n = 0;
|
dynamic_response_info.response_n = 0;
|
||||||
|
|
||||||
//Dbprintf("receivedCmd: %02x\n", receivedCmd);
|
//Dbprintf("receivedCmd: %02x\n", receivedCmd);
|
||||||
// received a REQUEST
|
// received a REQUEST
|
||||||
if (receivedCmd[0] == ISO14443A_CMD_REQA && len == 1) {
|
if (receivedCmd[0] == ISO14443A_CMD_REQA && len == 1) {
|
||||||
|
@ -399,12 +399,12 @@ void RunMod(void) {
|
||||||
// received request for UID (cascade 1)
|
// received request for UID (cascade 1)
|
||||||
} else if (receivedCmd[1] == 0x20 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && len == 2) {
|
} else if (receivedCmd[1] == 0x20 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && len == 2) {
|
||||||
//DbpString(_YELLOW_("+") "Request for UID C1");
|
//DbpString(_YELLOW_("+") "Request for UID C1");
|
||||||
p_response = &responses[RESP_INDEX_UIDC1];
|
p_response = &responses[RESP_INDEX_UIDC1];
|
||||||
|
|
||||||
// received a SELECT (cascade 1)
|
// received a SELECT (cascade 1)
|
||||||
} else if (receivedCmd[1] == 0x70 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && len == 9) {
|
} else if (receivedCmd[1] == 0x70 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && len == 9) {
|
||||||
//DbpString(_YELLOW_("+") "Request for SELECT S1");
|
//DbpString(_YELLOW_("+") "Request for SELECT S1");
|
||||||
p_response = &responses[RESP_INDEX_SAKC1];
|
p_response = &responses[RESP_INDEX_SAKC1];
|
||||||
|
|
||||||
// received a RATS request
|
// received a RATS request
|
||||||
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) {
|
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) {
|
||||||
|
@ -412,7 +412,7 @@ void RunMod(void) {
|
||||||
prevCmd = 0;
|
prevCmd = 0;
|
||||||
//p_response = &responses[RESP_INDEX_RATS];
|
//p_response = &responses[RESP_INDEX_RATS];
|
||||||
|
|
||||||
static uint8_t rRATS[] = { 0x13, 0x78, 0x80, 0x72, 0x02, 0x80, 0x31, 0x80, 0x66, 0xb1, 0x84, 0x0c, 0x01, 0x6e, 0x01, 0x83, 0x00, 0x90, 0x00 };
|
static uint8_t rRATS[] = { 0x13, 0x78, 0x80, 0x72, 0x02, 0x80, 0x31, 0x80, 0x66, 0xb1, 0x84, 0x0c, 0x01, 0x6e, 0x01, 0x83, 0x00, 0x90, 0x00 };
|
||||||
|
|
||||||
memcpy(&dynamic_response_info.response[0], rRATS, sizeof(rRATS));
|
memcpy(&dynamic_response_info.response[0], rRATS, sizeof(rRATS));
|
||||||
dynamic_response_info.response_n = sizeof(rRATS);
|
dynamic_response_info.response_n = sizeof(rRATS);
|
||||||
|
|
|
@ -1189,12 +1189,12 @@ bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, tag_r
|
||||||
// Configure the ATQA and SAK accordingly
|
// Configure the ATQA and SAK accordingly
|
||||||
rATQA[0] &= 0xBF;
|
rATQA[0] &= 0xBF;
|
||||||
|
|
||||||
if(tagType == 11){
|
if (tagType == 11) {
|
||||||
rSAKc1[0] = sak & 0xFC & 0X70;
|
rSAKc1[0] = sak & 0xFC & 0X70;
|
||||||
}else{
|
} else {
|
||||||
rSAKc1[0] = sak & 0xFB;
|
rSAKc1[0] = sak & 0xFB;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddCrc14A(rSAKc1, sizeof(rSAKc1) - 2);
|
AddCrc14A(rSAKc1, sizeof(rSAKc1) - 2);
|
||||||
|
|
||||||
*cuid = bytes_to_num(data, 4);
|
*cuid = bytes_to_num(data, 4);
|
||||||
|
|
|
@ -1300,7 +1300,7 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32_t nttmp = prng_successor(nt1, 100); //NXP Mifare is typical around 840,but for some unlicensed/compatible mifare card this can be 160
|
uint32_t nttmp = prng_successor(nt1, 100); //NXP Mifare is typical around 840,but for some unlicensed/compatible mifare card this can be 160
|
||||||
for (i = 101; i < 1200; i++) {
|
for (i = 101; i < 1200; i++) {
|
||||||
nttmp = prng_successor(nttmp, 1);
|
nttmp = prng_successor(nttmp, 1);
|
||||||
|
@ -1354,7 +1354,7 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
||||||
LED_C_ON();
|
LED_C_ON();
|
||||||
|
|
||||||
// get crypted nonces for target sector
|
// get crypted nonces for target sector
|
||||||
for (i = 0; ((i < 2) && (isOK == PM3_SUCCESS)); i++) {
|
for (i = 0; ((i < 2) && (isOK == PM3_SUCCESS)); i++) {
|
||||||
|
|
||||||
// look for exactly two different nonces
|
// look for exactly two different nonces
|
||||||
|
|
||||||
|
|
|
@ -50,20 +50,20 @@ arguments = [[
|
||||||
-c read magic configuration
|
-c read magic configuration
|
||||||
-u UID (8-20 hexsymbols), set UID on tag
|
-u UID (8-20 hexsymbols), set UID on tag
|
||||||
-t tag type to impersonate
|
-t tag type to impersonate
|
||||||
1 = Mifare Mini S20 4-byte
|
1 = Mifare Mini S20 4-byte
|
||||||
2 = Mifare Mini S20 7-byte 15 = NTAG 210
|
2 = Mifare Mini S20 7-byte 15 = NTAG 210
|
||||||
3 = Mifare Mini S20 10-byte 16 = NTAG 212
|
3 = Mifare Mini S20 10-byte 16 = NTAG 212
|
||||||
4 = Mifare 1k S50 4-byte 17 = NTAG 213
|
4 = Mifare 1k S50 4-byte 17 = NTAG 213
|
||||||
5 = Mifare 1k S50 7-byte 18 = NTAG 215
|
5 = Mifare 1k S50 7-byte 18 = NTAG 215
|
||||||
6 = Mifare 1k S50 10-byte 19 = NTAG 216
|
6 = Mifare 1k S50 10-byte 19 = NTAG 216
|
||||||
7 = Mifare 4k S70 4-byte 20 = NTAG I2C 1K
|
7 = Mifare 4k S70 4-byte 20 = NTAG I2C 1K
|
||||||
8 = Mifare 4k S70 7-byte 21 = NTAG I2C 2K
|
8 = Mifare 4k S70 7-byte 21 = NTAG I2C 2K
|
||||||
9 = Mifare 4k S70 10-byte 22 = NTAG I2C 1K PLUS
|
9 = Mifare 4k S70 10-byte 22 = NTAG I2C 1K PLUS
|
||||||
*** 10 = UL - NOT WORKING FULLY 23 = NTAG I2C 2K PLUS
|
*** 10 = UL - NOT WORKING FULLY 23 = NTAG I2C 2K PLUS
|
||||||
*** 11 = UL-C - NOT WORKING FULLY 24 = NTAG 213F
|
*** 11 = UL-C - NOT WORKING FULLY 24 = NTAG 213F
|
||||||
12 = UL EV1 48b 25 = NTAG 216F
|
12 = UL EV1 48b 25 = NTAG 216F
|
||||||
13 = UL EV1 128b
|
13 = UL EV1 128b
|
||||||
*** 14 = UL Plus - NOT WORKING YET
|
*** 14 = UL Plus - NOT WORKING YET
|
||||||
|
|
||||||
-p NTAG password (8 hexsymbols), set NTAG password on tag.
|
-p NTAG password (8 hexsymbols), set NTAG password on tag.
|
||||||
-a NTAG pack ( 4 hexsymbols), set NTAG pack on tag.
|
-a NTAG pack ( 4 hexsymbols), set NTAG pack on tag.
|
||||||
|
@ -297,7 +297,7 @@ return true, 'Ok'
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- calculate block0
|
-- calculate block0
|
||||||
local function calculate_block0(useruid)
|
local function calculate_block0(useruid)
|
||||||
local uidbytes = utils.ConvertHexToBytes(useruid)
|
local uidbytes = utils.ConvertHexToBytes(useruid)
|
||||||
local i = 1
|
local i = 1
|
||||||
local bcc = bxor(uidbytes[i], uidbytes[i+1]);
|
local bcc = bxor(uidbytes[i], uidbytes[i+1]);
|
||||||
|
|
|
@ -439,7 +439,7 @@ static int mf_analyse_st_block(uint8_t blockno, uint8_t *block, bool force) {
|
||||||
* @param numSectors: size of the card
|
* @param numSectors: size of the card
|
||||||
* @param keyFileName: filename containing keys or NULL.
|
* @param keyFileName: filename containing keys or NULL.
|
||||||
*/
|
*/
|
||||||
static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t numSectors, char *keyfn){
|
static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t numSectors, char *keyfn) {
|
||||||
|
|
||||||
// Select card to get UID/UIDLEN/ATQA/SAK information
|
// Select card to get UID/UIDLEN/ATQA/SAK information
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
|
@ -472,7 +472,7 @@ static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t n
|
||||||
|
|
||||||
size_t alen = 0, blen = 0;
|
size_t alen = 0, blen = 0;
|
||||||
uint8_t *keyA, *keyB;
|
uint8_t *keyA, *keyB;
|
||||||
if (loadFileBinaryKey(keyfn, "", (void**)&keyA, (void**)&keyB, &alen, &blen) != PM3_SUCCESS) {
|
if (loadFileBinaryKey(keyfn, "", (void **)&keyA, (void **)&keyB, &alen, &blen) != PM3_SUCCESS) {
|
||||||
if (keyA) {
|
if (keyA) {
|
||||||
free(keyA);
|
free(keyA);
|
||||||
}
|
}
|
||||||
|
@ -562,7 +562,7 @@ static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t n
|
||||||
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
||||||
} else {
|
} else {
|
||||||
// data block. Check if it can be read with key A or key B
|
// data block. Check if it can be read with key A or key B
|
||||||
if ((rights[sectorNo][data_area] == 0x03) || (rights[sectorNo][data_area] == 0x05)) {
|
if ((rights[sectorNo][data_area] == 0x03) || (rights[sectorNo][data_area] == 0x05)) {
|
||||||
// only key B would work
|
// only key B would work
|
||||||
payload.blockno = mfFirstBlockOfSector(sectorNo) + blockNo;
|
payload.blockno = mfFirstBlockOfSector(sectorNo) + blockNo;
|
||||||
payload.keytype = MF_KEY_B;
|
payload.keytype = MF_KEY_B;
|
||||||
|
@ -572,7 +572,7 @@ static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t n
|
||||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||||
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
||||||
} else {
|
} else {
|
||||||
// key A would work
|
// key A would work
|
||||||
payload.blockno = mfFirstBlockOfSector(sectorNo) + blockNo;
|
payload.blockno = mfFirstBlockOfSector(sectorNo) + blockNo;
|
||||||
payload.keytype = current_key;
|
payload.keytype = current_key;
|
||||||
memcpy(payload.key, (current_key == MF_KEY_A) ? keyA + (sectorNo * MIFARE_KEY_SIZE) : keyB + (sectorNo * MIFARE_KEY_SIZE), MIFARE_KEY_SIZE);
|
memcpy(payload.key, (current_key == MF_KEY_A) ? keyA + (sectorNo * MIFARE_KEY_SIZE) : keyB + (sectorNo * MIFARE_KEY_SIZE), MIFARE_KEY_SIZE);
|
||||||
|
@ -604,9 +604,9 @@ static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t n
|
||||||
|
|
||||||
uint8_t *data = resp.data.asBytes;
|
uint8_t *data = resp.data.asBytes;
|
||||||
|
|
||||||
if (mfIsSectorTrailer(blockNo)) {
|
if (mfIsSectorTrailer(blockNo)) {
|
||||||
// sector trailer. Fill in the keys.
|
// sector trailer. Fill in the keys.
|
||||||
memcpy(data , keyA + (sectorNo * MIFARE_KEY_SIZE), MIFARE_KEY_SIZE);
|
memcpy(data, keyA + (sectorNo * MIFARE_KEY_SIZE), MIFARE_KEY_SIZE);
|
||||||
memcpy(data + 10, keyB + (sectorNo * MIFARE_KEY_SIZE), MIFARE_KEY_SIZE);
|
memcpy(data + 10, keyB + (sectorNo * MIFARE_KEY_SIZE), MIFARE_KEY_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1051,7 +1051,7 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
||||||
} else if (m2) {
|
} else if (m2) {
|
||||||
numSectors = MIFARE_2K_MAXSECTOR;
|
numSectors = MIFARE_2K_MAXSECTOR;
|
||||||
bytes = MIFARE_2K_MAX_BYTES;
|
bytes = MIFARE_2K_MAX_BYTES;
|
||||||
} else if (m4) {
|
} else if (m4) {
|
||||||
numSectors = MIFARE_4K_MAXSECTOR;
|
numSectors = MIFARE_4K_MAXSECTOR;
|
||||||
bytes = MIFARE_4K_MAX_BYTES;
|
bytes = MIFARE_4K_MAX_BYTES;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3809,7 +3809,7 @@ static int CmdHF14AMfSim(const char *Cmd) {
|
||||||
|
|
||||||
if ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK)
|
if ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ((resp.oldarg[0] & 0xffff) != CMD_HF_MIFARE_SIMULATE)
|
if ((resp.oldarg[0] & 0xffff) != CMD_HF_MIFARE_SIMULATE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3919,11 +3919,11 @@ void printKeyTableEx(size_t sectorscnt, sector_t *e_sector, uint8_t start_sector
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, " " _YELLOW_("%03d") " | %03d | %s | %s | %s | %s"
|
PrintAndLogEx(SUCCESS, " " _YELLOW_("%03d") " | %03d | %s | %s | %s | %s"
|
||||||
, s
|
, s
|
||||||
, mfSectorTrailerOfSector(s)
|
, mfSectorTrailerOfSector(s)
|
||||||
, strA, resA
|
, strA, resA
|
||||||
, strB, resB
|
, strB, resB
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
||||||
|
@ -6656,7 +6656,7 @@ static int CmdHf14AMfSuperCard(const char *Cmd) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SUPER_MAX_TRACES 7
|
#define SUPER_MAX_TRACES 7
|
||||||
|
|
||||||
uint8_t trace = 0;
|
uint8_t trace = 0;
|
||||||
uint8_t traces[SUPER_MAX_TRACES][16];
|
uint8_t traces[SUPER_MAX_TRACES][16];
|
||||||
|
@ -7928,24 +7928,24 @@ static int CmdHF14AMfValue(const char *Cmd) {
|
||||||
"hf mf value --blk 16 -k FFFFFFFFFFFF -b --get\n"
|
"hf mf value --blk 16 -k FFFFFFFFFFFF -b --get\n"
|
||||||
"hf mf value --blk 16 -k FFFFFFFFFFFF --res --transfer 30 --tk FFFFFFFFFFFF --> transfer block 16 value to block 30 (even if block can't be incremented by ACL)\n"
|
"hf mf value --blk 16 -k FFFFFFFFFFFF --res --transfer 30 --tk FFFFFFFFFFFF --> transfer block 16 value to block 30 (even if block can't be incremented by ACL)\n"
|
||||||
"hf mf value --get -d 87D612007829EDFF87D6120011EE11EE\n"
|
"hf mf value --get -d 87D612007829EDFF87D6120011EE11EE\n"
|
||||||
);
|
);
|
||||||
void *argtable[] = {
|
void *argtable[] = {
|
||||||
arg_param_begin,
|
arg_param_begin,
|
||||||
arg_str0("k", "key", "<hex>", "key, 6 hex bytes"),
|
arg_str0("k", "key", "<hex>", "key, 6 hex bytes"),
|
||||||
arg_lit0("a", NULL, "input key type is key A (def)"),
|
arg_lit0("a", NULL, "input key type is key A (def)"),
|
||||||
arg_lit0("b", NULL, "input key type is key B"),
|
arg_lit0("b", NULL, "input key type is key B"),
|
||||||
arg_u64_0(NULL, "inc", "<dec>", "Increment value by X (0 - 2147483647)"),
|
arg_u64_0(NULL, "inc", "<dec>", "Increment value by X (0 - 2147483647)"),
|
||||||
arg_u64_0(NULL, "dec", "<dec>", "Decrement value by X (0 - 2147483647)"),
|
arg_u64_0(NULL, "dec", "<dec>", "Decrement value by X (0 - 2147483647)"),
|
||||||
arg_u64_0(NULL, "set", "<dec>", "Set value to X (-2147483647 - 2147483647)"),
|
arg_u64_0(NULL, "set", "<dec>", "Set value to X (-2147483647 - 2147483647)"),
|
||||||
arg_u64_0(NULL, "transfer", "<dec>", "Transfer value to other block (after inc/dec/restore)"),
|
arg_u64_0(NULL, "transfer", "<dec>", "Transfer value to other block (after inc/dec/restore)"),
|
||||||
arg_str0(NULL, "tkey", "<hex>", "transfer key, 6 hex bytes (if transfer is preformed to other sector)"),
|
arg_str0(NULL, "tkey", "<hex>", "transfer key, 6 hex bytes (if transfer is preformed to other sector)"),
|
||||||
arg_lit0(NULL, "ta", "transfer key type is key A (def)"),
|
arg_lit0(NULL, "ta", "transfer key type is key A (def)"),
|
||||||
arg_lit0(NULL, "tb", "transfer key type is key B"),
|
arg_lit0(NULL, "tb", "transfer key type is key B"),
|
||||||
arg_lit0(NULL, "get", "Get value from block"),
|
arg_lit0(NULL, "get", "Get value from block"),
|
||||||
arg_lit0(NULL, "res", "Restore (copy value to card buffer, should be used with --transfer)"),
|
arg_lit0(NULL, "res", "Restore (copy value to card buffer, should be used with --transfer)"),
|
||||||
arg_int0(NULL, "blk", "<dec>", "block number"),
|
arg_int0(NULL, "blk", "<dec>", "block number"),
|
||||||
arg_str0("d", "data", "<hex>", "block data to extract values from (16 hex bytes)"),
|
arg_str0("d", "data", "<hex>", "block data to extract values from (16 hex bytes)"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
|
@ -8002,7 +8002,7 @@ static int CmdHF14AMfValue(const char *Cmd) {
|
||||||
|
|
||||||
// Action: 0 Increment, 1 - Decrement, 2 - Restore, 3 - Set, 4 - Get, 5 - Decode from data
|
// Action: 0 Increment, 1 - Decrement, 2 - Restore, 3 - Set, 4 - Get, 5 - Decode from data
|
||||||
// iceman: TODO - should be enum
|
// iceman: TODO - should be enum
|
||||||
uint8_t action = 4;
|
uint8_t action = 4;
|
||||||
uint32_t value = 0;
|
uint32_t value = 0;
|
||||||
|
|
||||||
// Need to check we only have 1 of inc/dec/set and get the value from the selected option
|
// Need to check we only have 1 of inc/dec/set and get the value from the selected option
|
||||||
|
@ -8073,10 +8073,10 @@ static int CmdHF14AMfValue(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't want to write value data and break something
|
// don't want to write value data and break something
|
||||||
if ((blockno == 0) ||
|
if ((blockno == 0) ||
|
||||||
(mfIsSectorTrailer(blockno)) ||
|
(mfIsSectorTrailer(blockno)) ||
|
||||||
(trnval == 0) ||
|
(trnval == 0) ||
|
||||||
(trnval != -1 && mfIsSectorTrailer(trnval))) {
|
(trnval != -1 && mfIsSectorTrailer(trnval))) {
|
||||||
PrintAndLogEx(WARNING, "invalid block number, should be a data block");
|
PrintAndLogEx(WARNING, "invalid block number, should be a data block");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
@ -8094,7 +8094,7 @@ static int CmdHF14AMfValue(const char *Cmd) {
|
||||||
memcpy(block, (uint8_t *)&value, 4);
|
memcpy(block, (uint8_t *)&value, 4);
|
||||||
|
|
||||||
uint8_t cmddata[34];
|
uint8_t cmddata[34];
|
||||||
memcpy(cmddata, key, sizeof(key));
|
memcpy(cmddata, key, sizeof(key));
|
||||||
// Key == 6 data went to 10, so lets offset 9 for inc/dec
|
// Key == 6 data went to 10, so lets offset 9 for inc/dec
|
||||||
|
|
||||||
if (action == 0) {
|
if (action == 0) {
|
||||||
|
@ -8105,13 +8105,13 @@ static int CmdHF14AMfValue(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 00 if increment, 01 if decrement, 02 if restore
|
// 00 if increment, 01 if decrement, 02 if restore
|
||||||
cmddata[9] = action;
|
cmddata[9] = action;
|
||||||
|
|
||||||
if (trnval != -1) {
|
if (trnval != -1) {
|
||||||
|
|
||||||
// transfer to block
|
// transfer to block
|
||||||
cmddata[10] = trnval;
|
cmddata[10] = trnval;
|
||||||
|
|
||||||
memcpy(cmddata + 27, transferkey, sizeof(transferkey));
|
memcpy(cmddata + 27, transferkey, sizeof(transferkey));
|
||||||
if (mfSectorNum(trnval) != mfSectorNum(blockno)) {
|
if (mfSectorNum(trnval) != mfSectorNum(blockno)) {
|
||||||
cmddata[33] = 1; // should send nested auth
|
cmddata[33] = 1; // should send nested auth
|
||||||
|
@ -8164,7 +8164,7 @@ static int CmdHF14AMfValue(const char *Cmd) {
|
||||||
|
|
||||||
if (isok) {
|
if (isok) {
|
||||||
PrintAndLogEx(SUCCESS, "Update ... : " _GREEN_("success"));
|
PrintAndLogEx(SUCCESS, "Update ... : " _GREEN_("success"));
|
||||||
getval = true;
|
getval = true;
|
||||||
// all ok so set flag to read current value
|
// all ok so set flag to read current value
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(FAILED, "Update ... : " _RED_("failed"));
|
PrintAndLogEx(FAILED, "Update ... : " _RED_("failed"));
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ static int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyA
|
||||||
for (uint8_t keyAB = startKeyAB; keyAB <= endKeyAB; keyAB++) {
|
for (uint8_t keyAB = startKeyAB; keyAB <= endKeyAB; keyAB++) {
|
||||||
// main cycle with key check
|
// main cycle with key check
|
||||||
for (int i = 0; i < keyListLen; i++) {
|
for (int i = 0; i < keyListLen; i++) {
|
||||||
|
|
||||||
// allow client abort every iteration
|
// allow client abort every iteration
|
||||||
if (kbd_enter_pressed()) {
|
if (kbd_enter_pressed()) {
|
||||||
PrintAndLogEx(WARNING, "\naborted via keyboard!\n");
|
PrintAndLogEx(WARNING, "\naborted via keyboard!\n");
|
||||||
|
@ -1052,14 +1052,14 @@ static int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyA
|
||||||
selectCard = true;
|
selectCard = true;
|
||||||
msleep(50);
|
msleep(50);
|
||||||
|
|
||||||
// break out from keylist check loop,
|
// break out from keylist check loop,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
PrintAndLogEx(WARNING, "\nsector %02d key %d [%s] res: %d", sector, keyAB, sprint_hex_inrow(keyList[i], 16), res);
|
PrintAndLogEx(WARNING, "\nsector %02d key %d [%s] res: %d", sector, keyAB, sprint_hex_inrow(keyList[i], 16), res);
|
||||||
|
|
||||||
// RES can be:
|
// RES can be:
|
||||||
// PM3_ERFTRANS -7
|
// PM3_ERFTRANS -7
|
||||||
// PM3_EWRONGANSWER -16
|
// PM3_EWRONGANSWER -16
|
||||||
if (res == PM3_ERFTRANS) {
|
if (res == PM3_ERFTRANS) {
|
||||||
|
|
|
@ -338,7 +338,7 @@ static void printHitag2PaxtonDowngrade(const uint8_t *data) {
|
||||||
bytes = (bytes * 0x100) + data[i];
|
bytes = (bytes * 0x100) + data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j< 8; j++) {
|
for (int j = 0; j < 8; j++) {
|
||||||
num = bytes & mask;
|
num = bytes & mask;
|
||||||
skip -= 5;
|
skip -= 5;
|
||||||
mask = mask >> 5;
|
mask = mask >> 5;
|
||||||
|
|
|
@ -48,7 +48,7 @@ static int CmdHelp(const char *Cmd);
|
||||||
// This function will calculate the bitstream for a paradox card and place the result in bs.
|
// This function will calculate the bitstream for a paradox card and place the result in bs.
|
||||||
// It returns the calculated CRC from the fc and cn.
|
// It returns the calculated CRC from the fc and cn.
|
||||||
// CRC calculation by mwalker33
|
// CRC calculation by mwalker33
|
||||||
static uint8_t GetParadoxBits(const uint32_t fc, const uint32_t cn, unsigned int *bs){
|
static uint8_t GetParadoxBits(const uint32_t fc, const uint32_t cn, unsigned int *bs) {
|
||||||
|
|
||||||
uint8_t manchester[13] = { 0x00 }; // check size needed
|
uint8_t manchester[13] = { 0x00 }; // check size needed
|
||||||
uint32_t t1;
|
uint32_t t1;
|
||||||
|
@ -180,9 +180,9 @@ int demodParadox(bool verbose) {
|
||||||
uint32_t rawHi2 = bytebits_to_byte(bits + idx, 32);
|
uint32_t rawHi2 = bytebits_to_byte(bits + idx, 32);
|
||||||
|
|
||||||
uint32_t blocks[4] = {0};
|
uint32_t blocks[4] = {0};
|
||||||
uint8_t crc = GetParadoxBits(fc,cardnum,blocks);
|
uint8_t crc = GetParadoxBits(fc, cardnum, blocks);
|
||||||
if(chksum != crc)
|
if (chksum != crc)
|
||||||
PrintAndLogEx(ERR,"CRC Error! Calculated CRC is " _GREEN_("%d") " but card CRC is " _RED_("%d") ".",crc,chksum);
|
PrintAndLogEx(ERR, "CRC Error! Calculated CRC is " _GREEN_("%d") " but card CRC is " _RED_("%d") ".", crc, chksum);
|
||||||
|
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Paradox - ID: " _GREEN_("%x%08x") " FC: " _GREEN_("%d") " Card: " _GREEN_("%d") ", Checksum: %02x, Raw: %08x%08x%08x",
|
PrintAndLogEx(INFO, "Paradox - ID: " _GREEN_("%x%08x") " FC: " _GREEN_("%d") " Card: " _GREEN_("%d") ", Checksum: %02x, Raw: %08x%08x%08x",
|
||||||
|
@ -291,7 +291,7 @@ static int CmdParadoxClone(const char *Cmd) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fc > 999 || cn > 99999){
|
if (fc > 999 || cn > 99999) {
|
||||||
PrintAndLogEx(FAILED, "FC has a max value of 999 and CN has a max value of 99999");
|
PrintAndLogEx(FAILED, "FC has a max value of 999 and CN has a max value of 99999");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
@ -379,7 +379,7 @@ static int CmdParadoxSim(const char *Cmd) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fc > 999 || cn > 99999){
|
if (fc > 999 || cn > 99999) {
|
||||||
PrintAndLogEx(FAILED, "FC has a max value of 999 and CN has a max value of 99999");
|
PrintAndLogEx(FAILED, "FC has a max value of 999 and CN has a max value of 99999");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ static int CmdParadoxSim(const char *Cmd) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uint32_t blocks[4] = {0};
|
uint32_t blocks[4] = {0};
|
||||||
GetParadoxBits(fc,cn,blocks);
|
GetParadoxBits(fc, cn, blocks);
|
||||||
for (uint8_t i = 1; i < ARRAYLEN(blocks); i++) {
|
for (uint8_t i = 1; i < ARRAYLEN(blocks); i++) {
|
||||||
num_to_bytes(blocks[i], sizeof(uint32_t), raw + ((i - 1) * 4));
|
num_to_bytes(blocks[i], sizeof(uint32_t), raw + ((i - 1) * 4));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4028,7 +4028,7 @@ static int CmdT55xxSniff(const char *Cmd) {
|
||||||
if (use_graphbuf == false) {
|
if (use_graphbuf == false) {
|
||||||
|
|
||||||
// make loop to call sniff with skip samples..
|
// make loop to call sniff with skip samples..
|
||||||
// then build it up by adding
|
// then build it up by adding
|
||||||
CmdLFSniff("");
|
CmdLFSniff("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,9 +316,9 @@ int saveFileJSON(const char *preferredName, JSONFileType ftype, uint8_t *data, s
|
||||||
int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data, size_t datalen, bool verbose, void (*callback)(json_t *), savePaths_t e_save_path) {
|
int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data, size_t datalen, bool verbose, void (*callback)(json_t *), savePaths_t e_save_path) {
|
||||||
|
|
||||||
if (ftype != jsfCustom) {
|
if (ftype != jsfCustom) {
|
||||||
if (data == NULL || datalen == 0) {
|
if (data == NULL || datalen == 0) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char *fileName = newfilenamemcopyEx(preferredName, ".json", e_save_path);
|
char *fileName = newfilenamemcopyEx(preferredName, ".json", e_save_path);
|
||||||
|
@ -2032,8 +2032,8 @@ int searchFile(char **foundpath, const char *pm3dir, const char *searchname, con
|
||||||
PrintAndLogEx(FAILED, "Error - can't find `" _YELLOW_("%s") "`", filename);
|
PrintAndLogEx(FAILED, "Error - can't find `" _YELLOW_("%s") "`", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(filename);
|
free(filename);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pm3_load_dump(const char *fn, void **pdump, size_t *dumplen, size_t maxdumplen) {
|
int pm3_load_dump(const char *fn, void **pdump, size_t *dumplen, size_t maxdumplen) {
|
||||||
|
@ -2067,7 +2067,7 @@ int pm3_load_dump(const char *fn, void **pdump, size_t *dumplen, size_t maxdumpl
|
||||||
}
|
}
|
||||||
case MCT: {
|
case MCT: {
|
||||||
res = loadFileMCT_safe(fn, pdump, dumplen);
|
res = loadFileMCT_safe(fn, pdump, dumplen);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -424,8 +424,8 @@ int DetectHID(uint8_t *d, uint16_t manufacture) {
|
||||||
|
|
||||||
int convert_mad_to_arr(uint8_t *in, uint16_t ilen, uint8_t *out, uint16_t *olen) {
|
int convert_mad_to_arr(uint8_t *in, uint16_t ilen, uint8_t *out, uint16_t *olen) {
|
||||||
|
|
||||||
if (in == NULL || out == NULL || ilen == 0 ) {
|
if (in == NULL || out == NULL || ilen == 0) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MAD detection
|
// MAD detection
|
||||||
|
@ -464,8 +464,8 @@ int convert_mad_to_arr(uint8_t *in, uint16_t ilen, uint8_t *out, uint16_t *olen)
|
||||||
// copy to out (skip ST)
|
// copy to out (skip ST)
|
||||||
memcpy(out, tmp, sizeof(tmp) - MFBLOCK_SIZE);
|
memcpy(out, tmp, sizeof(tmp) - MFBLOCK_SIZE);
|
||||||
out += sizeof(tmp) - MFBLOCK_SIZE;
|
out += sizeof(tmp) - MFBLOCK_SIZE;
|
||||||
*olen += sizeof(tmp) -MFBLOCK_SIZE;
|
*olen += sizeof(tmp) - MFBLOCK_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,7 +313,7 @@ static int ndefDecodeSig1(uint8_t *sig, size_t siglen) {
|
||||||
if (sigType == stECDSA_P256) {
|
if (sigType == stECDSA_P256) {
|
||||||
slen = 32;
|
slen = 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "\tSignature [%u]...", intsiglen);
|
PrintAndLogEx(SUCCESS, "\tSignature [%u]...", intsiglen);
|
||||||
print_hex_noascii_break(&sig[indx], intsiglen, 32);
|
print_hex_noascii_break(&sig[indx], intsiglen, 32);
|
||||||
|
|
||||||
|
@ -508,7 +508,7 @@ static int ndefDecodePayloadHandoverRequest(uint8_t *payload, size_t len) {
|
||||||
PrintAndLogEx(INFO, _CYAN_("Handover Request"));
|
PrintAndLogEx(INFO, _CYAN_("Handover Request"));
|
||||||
uint8_t *p = payload;
|
uint8_t *p = payload;
|
||||||
uint8_t major = (*(p) >> 4) & 0x0F;
|
uint8_t major = (*(p) >> 4) & 0x0F;
|
||||||
uint8_t minor = *(p) & 0x0F;
|
uint8_t minor = *(p) & 0x0F;
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Version....... " _YELLOW_("%u.%u"), major, minor);
|
PrintAndLogEx(INFO, "Version....... " _YELLOW_("%u.%u"), major, minor);
|
||||||
|
@ -866,7 +866,7 @@ static int ndefDecodeMime_bt(NDEFHeader_t *ndef) {
|
||||||
uint8_t rev[6] = {0};
|
uint8_t rev[6] = {0};
|
||||||
reverse_array_copy(ndef->Payload + 2, 6, rev);
|
reverse_array_copy(ndef->Payload + 2, 6, rev);
|
||||||
PrintAndLogEx(INFO, "BT MAC.......... " _YELLOW_("%s"), sprint_hex(rev, sizeof(rev)));
|
PrintAndLogEx(INFO, "BT MAC.......... " _YELLOW_("%s"), sprint_hex(rev, sizeof(rev)));
|
||||||
|
|
||||||
// Let's check payload[8]. Tells us a bit about the UUID's. If 0x07 then it tells us a service UUID is 128bit
|
// Let's check payload[8]. Tells us a bit about the UUID's. If 0x07 then it tells us a service UUID is 128bit
|
||||||
switch (ndef->Payload[8]) {
|
switch (ndef->Payload[8]) {
|
||||||
case 0x02:
|
case 0x02:
|
||||||
|
@ -903,29 +903,29 @@ static int ndefDecodeMime_bt(NDEFHeader_t *ndef) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://raw.githubusercontent.com/haldean/ndef/master/docs/NFCForum-TS-RTD_1.0.pdf
|
// https://raw.githubusercontent.com/haldean/ndef/master/docs/NFCForum-TS-RTD_1.0.pdf
|
||||||
static int ndefDecodeExternal_record(NDEFHeader_t *ndef) {
|
static int ndefDecodeExternal_record(NDEFHeader_t *ndef) {
|
||||||
|
|
||||||
if (ndef->TypeLen == 0) {
|
if (ndef->TypeLen == 0) {
|
||||||
PrintAndLogEx(INFO, "no type");
|
PrintAndLogEx(INFO, "no type");
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ndef->PayloadLen == 0) {
|
if (ndef->PayloadLen == 0) {
|
||||||
PrintAndLogEx(INFO, "no payload");
|
PrintAndLogEx(INFO, "no payload");
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO
|
PrintAndLogEx(INFO
|
||||||
, " URN... " _GREEN_("urn:nfc:ext:%.*s")
|
, " URN... " _GREEN_("urn:nfc:ext:%.*s")
|
||||||
, (int)ndef->TypeLen
|
, (int)ndef->TypeLen
|
||||||
, ndef->Type
|
, ndef->Type
|
||||||
);
|
);
|
||||||
|
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(INFO, "Payload [%zu]...", ndef->PayloadLen);
|
PrintAndLogEx(INFO, "Payload [%zu]...", ndef->PayloadLen);
|
||||||
print_hex_noascii_break(ndef->Payload, ndef->PayloadLen, 32);
|
print_hex_noascii_break(ndef->Payload, ndef->PayloadLen, 32);
|
||||||
|
|
||||||
// do a character check?
|
// do a character check?
|
||||||
if (!strncmp((char *)ndef->Type, "pilet.ee:ekaart:2", ndef->TypeLen)) {
|
if (!strncmp((char *)ndef->Type, "pilet.ee:ekaart:2", ndef->TypeLen)) {
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
|
|
@ -360,7 +360,8 @@ const static vocabulory_t vocabulory[] = {
|
||||||
{ 0, "hf mf gsave" },
|
{ 0, "hf mf gsave" },
|
||||||
{ 0, "hf mf gsetblk" },
|
{ 0, "hf mf gsetblk" },
|
||||||
{ 0, "hf mf gview" },
|
{ 0, "hf mf gview" },
|
||||||
{ 0, "hf mf gdmconfig" },
|
{ 0, "hf mf gdmcfg" },
|
||||||
|
{ 0, "hf mf gdmsetcfg" },
|
||||||
{ 0, "hf mf gdmsetblk" },
|
{ 0, "hf mf gdmsetblk" },
|
||||||
{ 0, "hf mf ndefformat" },
|
{ 0, "hf mf ndefformat" },
|
||||||
{ 0, "hf mf ndefread" },
|
{ 0, "hf mf ndefread" },
|
||||||
|
|
|
@ -8,15 +8,15 @@ Author: Cory Solovewicz
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
This is a python script to automate what the updating of the amiibo_tools.lua
|
This is a python script to automate what the updating of the amiibo_tools.lua
|
||||||
file which holds a lua table of all known amiibos. Previously updating the
|
file which holds a lua table of all known amiibos. Previously updating the
|
||||||
amiibo_tools.lua was a very manual process.
|
amiibo_tools.lua was a very manual process.
|
||||||
|
|
||||||
This script automates the following original command:
|
This script automates the following original command:
|
||||||
curl https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/database/amiibo.json | jq 'del(.amiibos[].release)' | jq 'del(.characters)' | pbcopy --> transform to table
|
curl https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/database/amiibo.json | jq 'del(.amiibos[].release)' | jq 'del(.characters)' | pbcopy --> transform to table
|
||||||
And outputs the formatted file as amiibo_tools.lua
|
And outputs the formatted file as amiibo_tools.lua
|
||||||
If everything goes well, this should be an updated copy of amiibo_tools.lua
|
If everything goes well, this should be an updated copy of amiibo_tools.lua
|
||||||
which can then be placed in the /lualibs/ directory.
|
which can then be placed in the /lualibs/ directory.
|
||||||
The temporary amiibo.json file is then deleted
|
The temporary amiibo.json file is then deleted
|
||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
python3 -m pip install jq
|
python3 -m pip install jq
|
||||||
|
@ -25,7 +25,7 @@ How to run:
|
||||||
python update_amiibo_tools_lua.py
|
python update_amiibo_tools_lua.py
|
||||||
The script will create the file amiibo_tools.lua
|
The script will create the file amiibo_tools.lua
|
||||||
|
|
||||||
After running, manually backup the original /lualibs/amiibo_tools.lua and move the
|
After running, manually backup the original /lualibs/amiibo_tools.lua and move the
|
||||||
updated amiibo_tools.lua to the /lualibs/ directory.
|
updated amiibo_tools.lua to the /lualibs/ directory.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1354,9 +1354,10 @@
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help This help",
|
"-h, --help This help",
|
||||||
"-f, --file <fn> (optional) filename, if no <name> UID will be used as filename"
|
"-f, --file <fn> (optional) filename, if no <name> UID will be used as filename",
|
||||||
|
"--ns no save to file"
|
||||||
],
|
],
|
||||||
"usage": "hf 14b dump [-h] [-f <fn>]"
|
"usage": "hf 14b dump [-h] [-f <fn>] [--ns]"
|
||||||
},
|
},
|
||||||
"hf 14b help": {
|
"hf 14b help": {
|
||||||
"command": "hf 14b help",
|
"command": "hf 14b help",
|
||||||
|
@ -4218,9 +4219,10 @@
|
||||||
"--mini MIFARE Classic Mini / S20",
|
"--mini MIFARE Classic Mini / S20",
|
||||||
"--1k MIFARE Classic 1k / S50 (def)",
|
"--1k MIFARE Classic 1k / S50 (def)",
|
||||||
"--2k MIFARE Classic/Plus 2k",
|
"--2k MIFARE Classic/Plus 2k",
|
||||||
"--4k MIFARE Classic 4k / S70"
|
"--4k MIFARE Classic 4k / S70",
|
||||||
|
"--ns no save to file"
|
||||||
],
|
],
|
||||||
"usage": "hf mf dump [-h] [-f <fn>] [-k <fn>] [--mini] [--1k] [--2k] [--4k]"
|
"usage": "hf mf dump [-h] [-f <fn>] [-k <fn>] [--mini] [--1k] [--2k] [--4k] [--ns]"
|
||||||
},
|
},
|
||||||
"hf mf ecfill": {
|
"hf mf ecfill": {
|
||||||
"command": "hf mf ecfill",
|
"command": "hf mf ecfill",
|
||||||
|
@ -4400,18 +4402,18 @@
|
||||||
],
|
],
|
||||||
"usage": "hf mf fchk [-h] [-k <hex>]... [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [--mem] [-f <fn>]"
|
"usage": "hf mf fchk [-h] [-k <hex>]... [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [--mem] [-f <fn>]"
|
||||||
},
|
},
|
||||||
"hf mf gdmconfig": {
|
"hf mf gdmcfg": {
|
||||||
"command": "hf mf gdmconfig",
|
"command": "hf mf gdmcfg",
|
||||||
"description": "Get configuration data from magic gen4 GDM card.",
|
"description": "Get configuration data from magic gen4 GDM card.",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mf gdmconfig"
|
"hf mf gdmcfg"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help This help",
|
"-h, --help This help",
|
||||||
"-k, --key <hex> key 6 bytes"
|
"-k, --key <hex> key 6 bytes"
|
||||||
],
|
],
|
||||||
"usage": "hf mf gdmconfig [-h] [-k <hex>]"
|
"usage": "hf mf gdmcfg [-h] [-k <hex>]"
|
||||||
},
|
},
|
||||||
"hf mf gdmsetblk": {
|
"hf mf gdmsetblk": {
|
||||||
"command": "hf mf gdmsetblk",
|
"command": "hf mf gdmsetblk",
|
||||||
|
@ -4431,6 +4433,19 @@
|
||||||
],
|
],
|
||||||
"usage": "hf mf gdmsetblk [-hab] --blk <dec> [-d <hex>] [-k <hex>] [--force]"
|
"usage": "hf mf gdmsetblk [-hab] --blk <dec> [-d <hex>] [-k <hex>] [--force]"
|
||||||
},
|
},
|
||||||
|
"hf mf gdmsetcfg": {
|
||||||
|
"command": "hf mf gdmsetcfg",
|
||||||
|
"description": "Set configuration data on a magic gen4 GDM card",
|
||||||
|
"notes": [
|
||||||
|
"hf mf gdmsetcfg -d 850000000000000000005A5A00000008"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help This help",
|
||||||
|
"-d, --data <hex> bytes to write, 16 hex bytes"
|
||||||
|
],
|
||||||
|
"usage": "hf mf gdmsetcfg [-h] -d <hex>"
|
||||||
|
},
|
||||||
"hf mf gen3blk": {
|
"hf mf gen3blk": {
|
||||||
"command": "hf mf gen3blk",
|
"command": "hf mf gen3blk",
|
||||||
"description": "Overwrite full manufacturer block for magic Gen3 card - You can specify part of manufacturer block as 4/7-bytes for UID change only",
|
"description": "Overwrite full manufacturer block for magic Gen3 card - You can specify part of manufacturer block as 4/7-bytes for UID change only",
|
||||||
|
@ -4902,6 +4917,7 @@
|
||||||
"hf mf value --blk 16 -k FFFFFFFFFFFF --inc 10",
|
"hf mf value --blk 16 -k FFFFFFFFFFFF --inc 10",
|
||||||
"hf mf value --blk 16 -k FFFFFFFFFFFF -b --dec 10",
|
"hf mf value --blk 16 -k FFFFFFFFFFFF -b --dec 10",
|
||||||
"hf mf value --blk 16 -k FFFFFFFFFFFF -b --get",
|
"hf mf value --blk 16 -k FFFFFFFFFFFF -b --get",
|
||||||
|
"hf mf value --blk 16 -k FFFFFFFFFFFF --res --transfer 30 --tk FFFFFFFFFFFF -> transfer block 16 value to block 30 (even if block can't be incremented by ACL)",
|
||||||
"hf mf value --get -d 87D612007829EDFF87D6120011EE11EE"
|
"hf mf value --get -d 87D612007829EDFF87D6120011EE11EE"
|
||||||
],
|
],
|
||||||
"offline": true,
|
"offline": true,
|
||||||
|
@ -4910,14 +4926,19 @@
|
||||||
"-k, --key <hex> key, 6 hex bytes",
|
"-k, --key <hex> key, 6 hex bytes",
|
||||||
"-a input key type is key A (def)",
|
"-a input key type is key A (def)",
|
||||||
"-b input key type is key B",
|
"-b input key type is key B",
|
||||||
"--inc <dec> Incremenet value by X (0 - 2147483647)",
|
"--inc <dec> Increment value by X (0 - 2147483647)",
|
||||||
"--dec <dec> Dcrement value by X (0 - 2147483647)",
|
"--dec <dec> Decrement value by X (0 - 2147483647)",
|
||||||
"--set <dec> Set value to X (-2147483647 - 2147483647)",
|
"--set <dec> Set value to X (-2147483647 - 2147483647)",
|
||||||
|
"--transfer <dec> Transfer value to other block (after inc/dec/restore)",
|
||||||
|
"--tkey <hex> transfer key, 6 hex bytes (if transfer is preformed to other sector)",
|
||||||
|
"--ta transfer key type is key A (def)",
|
||||||
|
"--tb transfer key type is key B",
|
||||||
"--get Get value from block",
|
"--get Get value from block",
|
||||||
|
"--res Restore (copy value to card buffer, should be used with --transfer)",
|
||||||
"--blk <dec> block number",
|
"--blk <dec> block number",
|
||||||
"-d, --data <hex> block data to extract values from (16 hex bytes)"
|
"-d, --data <hex> block data to extract values from (16 hex bytes)"
|
||||||
],
|
],
|
||||||
"usage": "hf mf value [-hab] [-k <hex>] [--inc <dec>] [--dec <dec>] [--set <dec>] [--get] [--blk <dec>] [-d <hex>]"
|
"usage": "hf mf value [-hab] [-k <hex>] [--inc <dec>] [--dec <dec>] [--set <dec>] [--transfer <dec>] [--tkey <hex>] [--ta] [--tb] [--get] [--res] [--blk <dec>] [-d <hex>]"
|
||||||
},
|
},
|
||||||
"hf mf view": {
|
"hf mf view": {
|
||||||
"command": "hf mf view",
|
"command": "hf mf view",
|
||||||
|
@ -6146,7 +6167,7 @@
|
||||||
},
|
},
|
||||||
"hf mfp commitp": {
|
"hf mfp commitp": {
|
||||||
"command": "hf mfp commitp",
|
"command": "hf mfp commitp",
|
||||||
"description": "Executes Commit Perso command. Can be used in SL0 mode only.",
|
"description": "Executes Commit Perso command. Can be used in SL0 mode only. OBS! This command will not be executed if CardConfigKey, CardMasterKey and L3SwitchKey AES keys are not written.",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mfp commitp"
|
"hf mfp commitp"
|
||||||
],
|
],
|
||||||
|
@ -6246,9 +6267,9 @@
|
||||||
"-b, --keyb Use key B (def: keyA)",
|
"-b, --keyb Use key B (def: keyA)",
|
||||||
"-p, --plain Plain communication mode between reader and card",
|
"-p, --plain Plain communication mode between reader and card",
|
||||||
"--blk <0..255> Block number",
|
"--blk <0..255> Block number",
|
||||||
"--key <hex> Key, 16 hex bytes"
|
"-k, --key <hex> Key, 16 hex bytes"
|
||||||
],
|
],
|
||||||
"usage": "hf mfp rdbl [-hvbp] [-n <dec>] --blk <0..255> [--key <hex>]"
|
"usage": "hf mfp rdbl [-hvbp] [-n <dec>] --blk <0..255> [-k <hex>]"
|
||||||
},
|
},
|
||||||
"hf mfp rdsc": {
|
"hf mfp rdsc": {
|
||||||
"command": "hf mfp rdsc",
|
"command": "hf mfp rdsc",
|
||||||
|
@ -6335,9 +6356,10 @@
|
||||||
"-k, --key <hex> Key for authentication (UL-C 16 bytes, EV1/NTAG 4 bytes)",
|
"-k, --key <hex> Key for authentication (UL-C 16 bytes, EV1/NTAG 4 bytes)",
|
||||||
"-l Swap entered key's endianness",
|
"-l Swap entered key's endianness",
|
||||||
"-p, --page <dec> Manually set start page number to start from",
|
"-p, --page <dec> Manually set start page number to start from",
|
||||||
"-q, --qty <dec> Manually set number of pages to dump"
|
"-q, --qty <dec> Manually set number of pages to dump",
|
||||||
|
"--ns no save to file"
|
||||||
],
|
],
|
||||||
"usage": "hf mfu dump [-hl] [-f <fn>] [-k <hex>] [-p <dec>] [-q <dec>]"
|
"usage": "hf mfu dump [-hl] [-f <fn>] [-k <hex>] [-p <dec>] [-q <dec>] [--ns]"
|
||||||
},
|
},
|
||||||
"hf mfu eload": {
|
"hf mfu eload": {
|
||||||
"command": "hf mfu eload",
|
"command": "hf mfu eload",
|
||||||
|
@ -6565,7 +6587,7 @@
|
||||||
},
|
},
|
||||||
"hf mfu tamper": {
|
"hf mfu tamper": {
|
||||||
"command": "hf mfu tamper",
|
"command": "hf mfu tamper",
|
||||||
"description": "Set the congiguration of the NTAG 213TT tamper feature Supports: NTAG 213TT",
|
"description": "Set the configuration of the NTAG 213TT tamper feature Supports: NTAG 213TT",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mfu tamper -e -> enable tamper feature",
|
"hf mfu tamper -e -> enable tamper feature",
|
||||||
"hf mfu tamper -d -> disable tamper feature",
|
"hf mfu tamper -d -> disable tamper feature",
|
||||||
|
@ -9610,7 +9632,7 @@
|
||||||
"command": "lf paradox clone",
|
"command": "lf paradox clone",
|
||||||
"description": "clone a paradox tag to a T55x7, Q5/T5555 or EM4305/4469 tag.",
|
"description": "clone a paradox tag to a T55x7, Q5/T5555 or EM4305/4469 tag.",
|
||||||
"notes": [
|
"notes": [
|
||||||
"lf paradox clone --fc 96 --cn 40426 -> encode for T55x7 tag with fc and cn",
|
"lf paradox clone --fc 96 --cn 40426 [--q5|--em] -> encode for T55x7 tag with fc and cn",
|
||||||
"lf paradox clone --raw 0f55555695596a6a9999a59a -> encode for T55x7 tag",
|
"lf paradox clone --raw 0f55555695596a6a9999a59a -> encode for T55x7 tag",
|
||||||
"lf paradox clone --raw 0f55555695596a6a9999a59a --q5 -> encode for Q5/T5555 tag",
|
"lf paradox clone --raw 0f55555695596a6a9999a59a --q5 -> encode for Q5/T5555 tag",
|
||||||
"lf paradox clone --raw 0f55555695596a6a9999a59a --em -> encode for EM4305/4469"
|
"lf paradox clone --raw 0f55555695596a6a9999a59a --em -> encode for EM4305/4469"
|
||||||
|
@ -9663,14 +9685,17 @@
|
||||||
"command": "lf paradox sim",
|
"command": "lf paradox sim",
|
||||||
"description": "Enables simulation of paradox card with specified card number. Simulation runs until the button is pressed or another USB command is issued.",
|
"description": "Enables simulation of paradox card with specified card number. Simulation runs until the button is pressed or another USB command is issued.",
|
||||||
"notes": [
|
"notes": [
|
||||||
"lf paradox sim --raw 0f55555695596a6a9999a59a"
|
"lf paradox sim --raw 0f55555695596a6a9999a59a -> simulate tag",
|
||||||
|
"lf paradox clone --fc 96 --cn 40426 -> simulate tag with fc and cn"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help This help",
|
"-h, --help This help",
|
||||||
"-r, --raw <hex> raw hex data. 12 bytes"
|
"-r, --raw <hex> raw hex data. 12 bytes",
|
||||||
|
"--fc <dec> facility code",
|
||||||
|
"--cn <dec> card number"
|
||||||
],
|
],
|
||||||
"usage": "lf paradox sim [-h] [-r <hex>]"
|
"usage": "lf paradox sim [-h] [-r <hex>] [--fc <dec>] [--cn <dec>]"
|
||||||
},
|
},
|
||||||
"lf pcf7931 config": {
|
"lf pcf7931 config": {
|
||||||
"command": "lf pcf7931 config",
|
"command": "lf pcf7931 config",
|
||||||
|
@ -10199,12 +10224,13 @@
|
||||||
"-f, --file <fn> filename (default is generated on blk 0)",
|
"-f, --file <fn> filename (default is generated on blk 0)",
|
||||||
"-o, --override override, force pwd read despite danger to card",
|
"-o, --override override, force pwd read despite danger to card",
|
||||||
"-p, --pwd <hex> password (4 hex bytes)",
|
"-p, --pwd <hex> password (4 hex bytes)",
|
||||||
|
"--ns no save",
|
||||||
"--r0 downlink - fixed bit length",
|
"--r0 downlink - fixed bit length",
|
||||||
"--r1 downlink - long leading reference",
|
"--r1 downlink - long leading reference",
|
||||||
"--r2 downlink - leading zero",
|
"--r2 downlink - leading zero",
|
||||||
"--r3 downlink - 1 of 4 coding reference"
|
"--r3 downlink - 1 of 4 coding reference"
|
||||||
],
|
],
|
||||||
"usage": "lf t55xx dump [-ho] [-f <fn>] [-p <hex>] [--r0] [--r1] [--r2] [--r3]"
|
"usage": "lf t55xx dump [-ho] [-f <fn>] [-p <hex>] [--ns] [--r0] [--r1] [--r2] [--r3]"
|
||||||
},
|
},
|
||||||
"lf t55xx help": {
|
"lf t55xx help": {
|
||||||
"command": "lf t55xx help",
|
"command": "lf t55xx help",
|
||||||
|
@ -11987,8 +12013,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 754,
|
"commands_extracted": 755,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2023-03-26T15:04:49"
|
"extracted_on": "2023-05-25T01:54:13"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -523,7 +523,8 @@ Check column "offline" for their availability.
|
||||||
|`hf mf gsave `|N |`Save dump from card into file or emulator`
|
|`hf mf gsave `|N |`Save dump from card into file or emulator`
|
||||||
|`hf mf gsetblk `|N |`Write block to card`
|
|`hf mf gsetblk `|N |`Write block to card`
|
||||||
|`hf mf gview `|N |`View card`
|
|`hf mf gview `|N |`View card`
|
||||||
|`hf mf gdmconfig `|N |`Read config block from card`
|
|`hf mf gdmcfg `|N |`Read config block from card`
|
||||||
|
|`hf mf gdmsetcfg `|N |`Write config block to card`
|
||||||
|`hf mf gdmsetblk `|N |`Write block to card`
|
|`hf mf gdmsetblk `|N |`Write block to card`
|
||||||
|`hf mf ndefformat `|N |`Format MIFARE Classic Tag as NFC Tag`
|
|`hf mf ndefformat `|N |`Format MIFARE Classic Tag as NFC Tag`
|
||||||
|`hf mf ndefread `|N |`Read and print NDEF records from card`
|
|`hf mf ndefread `|N |`Read and print NDEF records from card`
|
||||||
|
@ -568,7 +569,7 @@ Check column "offline" for their availability.
|
||||||
|`hf mfu restore `|N |`Restore a dump onto a MFU MAGIC tag`
|
|`hf mfu restore `|N |`Restore a dump onto a MFU MAGIC tag`
|
||||||
|`hf mfu view `|Y |`Display content from tag dump file`
|
|`hf mfu view `|Y |`Display content from tag dump file`
|
||||||
|`hf mfu wrbl `|N |`Write block`
|
|`hf mfu wrbl `|N |`Write block`
|
||||||
|`hf mfu tamper `|N |`Cofigure the tamper feature on an NTAG 213TT`
|
|`hf mfu tamper `|N |`Configure the tamper feature on an NTAG 213TT`
|
||||||
|`hf mfu eload `|N |`Load Ultralight dump file into emulator memory`
|
|`hf mfu eload `|N |`Load Ultralight dump file into emulator memory`
|
||||||
|`hf mfu esave `|N |`Save Ultralight dump file from emulator memory`
|
|`hf mfu esave `|N |`Save Ultralight dump file from emulator memory`
|
||||||
|`hf mfu eview `|N |`View emulator memory`
|
|`hf mfu eview `|N |`View emulator memory`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue