Make Style

This commit is contained in:
Angel 2023-05-24 21:54:42 -04:00
commit 4dc8d5316a
16 changed files with 154 additions and 126 deletions

View file

@ -1189,9 +1189,9 @@ bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, tag_r
// Configure the ATQA and SAK accordingly
rATQA[0] &= 0xBF;
if(tagType == 11){
if (tagType == 11) {
rSAKc1[0] = sak & 0xFC & 0X70;
}else{
} else {
rSAKc1[0] = sak & 0xFB;
}

View file

@ -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 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
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;
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) {
free(keyA);
}
@ -606,7 +606,7 @@ static int mfc_read_tag(iso14a_card_select_t *card, uint8_t *carddata, uint8_t n
if (mfIsSectorTrailer(blockNo)) {
// 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);
}
@ -6656,7 +6656,7 @@ static int CmdHf14AMfSuperCard(const char *Cmd) {
return PM3_EINVARG;
}
#define SUPER_MAX_TRACES 7
#define SUPER_MAX_TRACES 7
uint8_t trace = 0;
uint8_t traces[SUPER_MAX_TRACES][16];

View file

@ -338,7 +338,7 @@ static void printHitag2PaxtonDowngrade(const uint8_t *data) {
bytes = (bytes * 0x100) + data[i];
}
for (int j = 0; j< 8; j++) {
for (int j = 0; j < 8; j++) {
num = bytes & mask;
skip -= 5;
mask = mask >> 5;

View file

@ -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.
// It returns the calculated CRC from the fc and cn.
// 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
uint32_t t1;
@ -180,9 +180,9 @@ int demodParadox(bool verbose) {
uint32_t rawHi2 = bytebits_to_byte(bits + idx, 32);
uint32_t blocks[4] = {0};
uint8_t crc = GetParadoxBits(fc,cardnum,blocks);
if(chksum != crc)
PrintAndLogEx(ERR,"CRC Error! Calculated CRC is " _GREEN_("%d") " but card CRC is " _RED_("%d") ".",crc,chksum);
uint8_t crc = GetParadoxBits(fc, cardnum, blocks);
if (chksum != crc)
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",
@ -291,7 +291,7 @@ static int CmdParadoxClone(const char *Cmd) {
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");
return PM3_EINVARG;
}
@ -379,7 +379,7 @@ static int CmdParadoxSim(const char *Cmd) {
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");
return PM3_EINVARG;
}
@ -390,7 +390,7 @@ static int CmdParadoxSim(const char *Cmd) {
}
} else {
uint32_t blocks[4] = {0};
GetParadoxBits(fc,cn,blocks);
GetParadoxBits(fc, cn, blocks);
for (uint8_t i = 1; i < ARRAYLEN(blocks); i++) {
num_to_bytes(blocks[i], sizeof(uint32_t), raw + ((i - 1) * 4));
}

View file

@ -424,7 +424,7 @@ 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) {
if (in == NULL || out == NULL || ilen == 0 ) {
if (in == NULL || out == NULL || ilen == 0) {
return PM3_EINVARG;
}
@ -464,7 +464,7 @@ int convert_mad_to_arr(uint8_t *in, uint16_t ilen, uint8_t *out, uint16_t *olen)
// copy to out (skip ST)
memcpy(out, tmp, sizeof(tmp) - MFBLOCK_SIZE);
out += sizeof(tmp) - MFBLOCK_SIZE;
*olen += sizeof(tmp) -MFBLOCK_SIZE;
*olen += sizeof(tmp) - MFBLOCK_SIZE;
}
}
return PM3_SUCCESS;

View file

@ -360,7 +360,8 @@ const static vocabulory_t vocabulory[] = {
{ 0, "hf mf gsave" },
{ 0, "hf mf gsetblk" },
{ 0, "hf mf gview" },
{ 0, "hf mf gdmconfig" },
{ 0, "hf mf gdmcfg" },
{ 0, "hf mf gdmsetcfg" },
{ 0, "hf mf gdmsetblk" },
{ 0, "hf mf ndefformat" },
{ 0, "hf mf ndefread" },

View file

@ -1354,9 +1354,10 @@
"offline": false,
"options": [
"-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": {
"command": "hf 14b help",
@ -4218,9 +4219,10 @@
"--mini MIFARE Classic Mini / S20",
"--1k MIFARE Classic 1k / S50 (def)",
"--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": {
"command": "hf mf ecfill",
@ -4400,18 +4402,18 @@
],
"usage": "hf mf fchk [-h] [-k <hex>]... [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [--mem] [-f <fn>]"
},
"hf mf gdmconfig": {
"command": "hf mf gdmconfig",
"hf mf gdmcfg": {
"command": "hf mf gdmcfg",
"description": "Get configuration data from magic gen4 GDM card.",
"notes": [
"hf mf gdmconfig"
"hf mf gdmcfg"
],
"offline": false,
"options": [
"-h, --help This help",
"-k, --key <hex> key 6 bytes"
],
"usage": "hf mf gdmconfig [-h] [-k <hex>]"
"usage": "hf mf gdmcfg [-h] [-k <hex>]"
},
"hf mf gdmsetblk": {
"command": "hf mf gdmsetblk",
@ -4431,6 +4433,19 @@
],
"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": {
"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",
@ -4902,6 +4917,7 @@
"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 --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"
],
"offline": true,
@ -4910,14 +4926,19 @@
"-k, --key <hex> key, 6 hex bytes",
"-a input key type is key A (def)",
"-b input key type is key B",
"--inc <dec> Incremenet value by X (0 - 2147483647)",
"--dec <dec> Dcrement value by X (0 - 2147483647)",
"--inc <dec> Increment value by X (0 - 2147483647)",
"--dec <dec> Decrement value by X (0 - 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",
"--res Restore (copy value to card buffer, should be used with --transfer)",
"--blk <dec> block number",
"-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": {
"command": "hf mf view",
@ -6146,7 +6167,7 @@
},
"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": [
"hf mfp commitp"
],
@ -6246,9 +6267,9 @@
"-b, --keyb Use key B (def: keyA)",
"-p, --plain Plain communication mode between reader and card",
"--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": {
"command": "hf mfp rdsc",
@ -6335,9 +6356,10 @@
"-k, --key <hex> Key for authentication (UL-C 16 bytes, EV1/NTAG 4 bytes)",
"-l Swap entered key's endianness",
"-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": {
"command": "hf mfu eload",
@ -6565,7 +6587,7 @@
},
"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": [
"hf mfu tamper -e -> enable tamper feature",
"hf mfu tamper -d -> disable tamper feature",
@ -9610,7 +9632,7 @@
"command": "lf paradox clone",
"description": "clone a paradox tag to a T55x7, Q5/T5555 or EM4305/4469 tag.",
"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 --q5 -> encode for Q5/T5555 tag",
"lf paradox clone --raw 0f55555695596a6a9999a59a --em -> encode for EM4305/4469"
@ -9663,14 +9685,17 @@
"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.",
"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,
"options": [
"-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": {
"command": "lf pcf7931 config",
@ -10199,12 +10224,13 @@
"-f, --file <fn> filename (default is generated on blk 0)",
"-o, --override override, force pwd read despite danger to card",
"-p, --pwd <hex> password (4 hex bytes)",
"--ns no save",
"--r0 downlink - fixed bit length",
"--r1 downlink - long leading reference",
"--r2 downlink - leading zero",
"--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": {
"command": "lf t55xx help",
@ -11987,8 +12013,8 @@
}
},
"metadata": {
"commands_extracted": 754,
"commands_extracted": 755,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2023-03-26T15:04:49"
"extracted_on": "2023-05-25T01:54:13"
}
}

View file

@ -523,7 +523,8 @@ Check column "offline" for their availability.
|`hf mf gsave `|N |`Save dump from card into file or emulator`
|`hf mf gsetblk `|N |`Write block to 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 ndefformat `|N |`Format MIFARE Classic Tag as NFC Tag`
|`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 view `|Y |`Display content from tag dump file`
|`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 esave `|N |`Save Ultralight dump file from emulator memory`
|`hf mfu eview `|N |`View emulator memory`