make style
This commit is contained in:
1 parent
143d0140db
commit
d46d23d079
18 files changed
+3972
-4091
No files matched your search
@@ -164,7 +164,7 @@ uint8_t iclass_CRC_check(bool isResponse, uint8_t *d, uint8_t n) {
|
||||
|
||||
int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
||||
|
||||
if ((gs_ntag_i2c_state == 1) && (cmdsize == 6) && (memcmp(cmd+1, "\x00\x00\x00", 3) == 0)) {
|
||||
if ((gs_ntag_i2c_state == 1) && (cmdsize == 6) && (memcmp(cmd + 1, "\x00\x00\x00", 3) == 0)) {
|
||||
snprintf(exp, size, "SECTOR(%d)", cmd[0]);
|
||||
gs_ntag_i2c_state = 0;
|
||||
return 1;
|
||||
@@ -244,14 +244,13 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
||||
|
||||
if (cmdsize == 4)
|
||||
// cmd0 == 0xC2 and cmd1 == 0xFF
|
||||
// high probability its SELECT SECTOR COMMAND:
|
||||
// high probability its SELECT SECTOR COMMAND:
|
||||
if (cmd[1] == 0xFF) {
|
||||
snprintf(exp, size, "SELECT SECTOR");
|
||||
gs_ntag_i2c_state = 1;
|
||||
} else {
|
||||
snprintf(exp, size, "RESTORE(%d)", cmd[1]);
|
||||
}
|
||||
else
|
||||
} else
|
||||
return 0;
|
||||
break;
|
||||
case MIFARE_CMD_TRANSFER:
|
||||
@@ -344,12 +343,12 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
||||
snprintf(exp, size, "?");
|
||||
break;
|
||||
}
|
||||
case NTAG_I2C_FASTWRITE:
|
||||
case NTAG_I2C_FASTWRITE:
|
||||
if (cmdsize == 69)
|
||||
snprintf(exp, size, "FAST WRITE (%d - %d)", cmd[1], cmd[2]);
|
||||
else
|
||||
snprintf(exp, size, "?");
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -683,7 +683,7 @@ static int CmdHF14ADesInfo(const char *Cmd) {
|
||||
PrintAndLogEx(SUCCESS, " Card doesn't support 'free mem' cmd");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (cardtype == DESFIRE_LIGHT) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(INFO, "--- " _CYAN_("Desfire Light info"));
|
||||
|
||||
@@ -189,7 +189,7 @@ static int testBitStream(void) {
|
||||
uint8_t output [] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
BitstreamIn_t in = { input, sizeof(input) * 8, 0};
|
||||
BitstreamOut_t out = { output, 0, 0}
|
||||
;
|
||||
;
|
||||
while (bitsLeft(&in) > 0) {
|
||||
pushBit(&out, headBit(&in));
|
||||
//printf("Bits left: %d\n", bitsLeft(&in));
|
||||
|
||||
@@ -1590,7 +1590,7 @@ bool DesfireCheckAuthCmd(DesfireISOSelectWay way, uint32_t appID, uint8_t keyNum
|
||||
uint8_t datalen = (authcmd == MFDES_AUTHENTICATE_EV2F) ? 3 : 1;
|
||||
res = DesfireExchangeEx(false, &dctx, authcmd, data, datalen, &respcode, recv_data, &recv_len, false, 0);
|
||||
DropField();
|
||||
|
||||
|
||||
if (checklrp)
|
||||
return (res == PM3_SUCCESS && respcode == 0xaf && recv_len == 17 && recv_data[0] == 0x01);
|
||||
else
|
||||
|
||||
@@ -638,7 +638,7 @@ static int ndefDecodePayload(NDEFHeader_t *ndef) {
|
||||
break;
|
||||
}
|
||||
|
||||
char *begin = calloc(ndef->TypeLen + 1,sizeof(char));
|
||||
char *begin = calloc(ndef->TypeLen + 1, sizeof(char));
|
||||
memcpy(begin, ndef->Type, ndef->TypeLen);
|
||||
str_lower(begin);
|
||||
|
||||
|
||||
+1747
-1823
File diff suppressed because it is too large.
Load diff
+2157
-2201
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -378,9 +378,9 @@ char *sprint_bytebits_bin(const uint8_t *data, const size_t len) {
|
||||
}
|
||||
|
||||
char *sprint_bin(const uint8_t *data, const size_t len) {
|
||||
size_t binlen = (len*8 > MAX_BIN_BREAK_LENGTH) ? MAX_BIN_BREAK_LENGTH : len*8;
|
||||
size_t binlen = (len * 8 > MAX_BIN_BREAK_LENGTH) ? MAX_BIN_BREAK_LENGTH : len * 8;
|
||||
static uint8_t buf[MAX_BIN_BREAK_LENGTH];
|
||||
bytes_to_bytebits(data, binlen/8, buf);
|
||||
bytes_to_bytebits(data, binlen / 8, buf);
|
||||
return sprint_bytebits_bin_break(buf, binlen, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user