make style

This commit is contained in:
Philippe Teuwen 2020-05-14 01:04:26 +02:00
commit ffdd338dea
8 changed files with 132 additions and 131 deletions

View file

@ -1398,7 +1398,7 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
// Tag specific configuration settings (sof, timings, etc.) // Tag specific configuration settings (sof, timings, etc.)
// TODO HTS // TODO HTS
/* if (htf <= HTS_LAST_CMD) { /* if (htf <= HTS_LAST_CMD) {
// hitagS settings // hitagS settings
t_wait_1 = 204; t_wait_1 = 204;
t_wait_2 = 128; t_wait_2 = 128;
@ -1724,7 +1724,7 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
// Tag specific configuration settings (sof, timings, etc.) // Tag specific configuration settings (sof, timings, etc.)
// TODO HTS // TODO HTS
/* if (htf <= HTS_LAST_CMD) { /* if (htf <= HTS_LAST_CMD) {
// hitagS settings // hitagS settings
t_wait_1 = 204; t_wait_1 = 204;
t_wait_2 = 128; t_wait_2 = 128;
@ -1734,7 +1734,7 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
DbpString("Configured for hitagS writer"); DbpString("Configured for hitagS writer");
} else */ } else */
// TODO HT1 // TODO HT1
/* if (htf <= HT1_LAST_CMD) { /* if (htf <= HT1_LAST_CMD) {
// hitag1 settings // hitag1 settings
t_wait_1 = 204; t_wait_1 = 204;
t_wait_2 = 128; t_wait_2 = 128;

View file

@ -1715,7 +1715,7 @@ void MifareChkKeys(uint8_t *datain) {
bool clearTrace = datain[2]; bool clearTrace = datain[2];
uint16_t key_count = (datain[3] << 8) | datain[4]; uint16_t key_count = (datain[3] << 8) | datain[4];
uint16_t key_mem_available = MIN( (PM3_CMD_DATA_SIZE - 5) , key_count * 6); uint16_t key_mem_available = MIN((PM3_CMD_DATA_SIZE - 5), key_count * 6);
key_count = key_mem_available / 6; key_count = key_mem_available / 6;
datain += 5; datain += 5;

View file

@ -76,9 +76,9 @@ static int usage_lf_nexwatch_sim(void) {
// scramble parity (1234) -> (4231) // scramble parity (1234) -> (4231)
static uint8_t nexwatch_parity_swap(uint8_t parity) { static uint8_t nexwatch_parity_swap(uint8_t parity) {
uint8_t a = (((parity >> 3 ) & 1) ); uint8_t a = (((parity >> 3) & 1));
a |= (((parity >> 1 ) & 1) << 1); a |= (((parity >> 1) & 1) << 1);
a |= (((parity >> 2 ) & 1) << 2); a |= (((parity >> 2) & 1) << 2);
a |= ((parity & 1) << 3); a |= ((parity & 1) << 3);
return a; return a;
} }
@ -119,7 +119,7 @@ static int nexwatch_scamble(NexWatchScramble_t action, uint32_t *id, uint32_t *s
28, 24, 20, 16, 12, 8, 4, 0 28, 24, 20, 16, 12, 8, 4, 0
}; };
switch(action) { switch (action) {
case DESCRAMBLE: { case DESCRAMBLE: {
*id = 0; *id = 0;
for (uint8_t idx = 0; idx < 32; idx++) { for (uint8_t idx = 0; idx < 32; idx++) {
@ -144,7 +144,8 @@ static int nexwatch_scamble(NexWatchScramble_t action, uint32_t *id, uint32_t *s
} }
break; break;
} }
default: break; default:
break;
} }
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -227,7 +228,7 @@ int demodNexWatch(void) {
nexwatch_magic_t items[] = { {0xBE, "Quadrakey", 0}, {0x88, "Nexkey", 0} }; nexwatch_magic_t items[] = { {0xBE, "Quadrakey", 0}, {0x88, "Nexkey", 0} };
uint8_t m_idx; uint8_t m_idx;
for ( m_idx = 0; m_idx < ARRAYLEN(items); m_idx++) { for (m_idx = 0; m_idx < ARRAYLEN(items); m_idx++) {
items[m_idx].chk = nexwatch_checksum(items[m_idx].magic, cn, calc_parity); items[m_idx].chk = nexwatch_checksum(items[m_idx].magic, cn, calc_parity);
if (items[m_idx].chk == chk) { if (items[m_idx].chk == chk) {
@ -236,14 +237,14 @@ int demodNexWatch(void) {
} }
// output // output
PrintAndLogEx(SUCCESS, " NexWatch raw id : " _YELLOW_("0x%"PRIx32) , rawid); PrintAndLogEx(SUCCESS, " NexWatch raw id : " _YELLOW_("0x%"PRIx32), rawid);
if (m_idx < ARRAYLEN(items)) { if (m_idx < ARRAYLEN(items)) {
PrintAndLogEx(SUCCESS, " fingerprint : " _GREEN_("%s"), items[m_idx].desc); PrintAndLogEx(SUCCESS, " fingerprint : " _GREEN_("%s"), items[m_idx].desc);
} }
PrintAndLogEx(SUCCESS, " 88bit id : " _YELLOW_("%"PRIu32) " (" _YELLOW_("0x%"PRIx32)")", cn, cn); PrintAndLogEx(SUCCESS, " 88bit id : " _YELLOW_("%"PRIu32) " (" _YELLOW_("0x%"PRIx32)")", cn, cn);
PrintAndLogEx(SUCCESS, " mode : %x", mode); PrintAndLogEx(SUCCESS, " mode : %x", mode);
if ( parity == calc_parity) { if (parity == calc_parity) {
PrintAndLogEx(SUCCESS, " parity : %s (0x%X)", _GREEN_("ok"), parity); PrintAndLogEx(SUCCESS, " parity : %s (0x%X)", _GREEN_("ok"), parity);
} else { } else {
PrintAndLogEx(WARNING, " parity : %s (0x%X != 0x%X)", _RED_("fail"), parity, calc_parity); PrintAndLogEx(WARNING, " parity : %s (0x%X != 0x%X)", _RED_("fail"), parity, calc_parity);

View file

@ -551,7 +551,7 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode,
do { do {
sp = uart_open(portname, speed); sp = uart_open(portname, speed);
msleep(500); msleep(500);
PrintAndLogEx(INPLACE, "% 3i", timeout - openCount -1); PrintAndLogEx(INPLACE, "% 3i", timeout - openCount - 1);
} while (++openCount < timeout && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT)); } while (++openCount < timeout && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT));
} }