make style
This commit is contained in:
@@ -214,7 +214,7 @@ void MeasureAntennaTuning(void) {
|
||||
}
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
reply_ng(CMD_MEASURE_ANTENNA_TUNING, PM3_SUCCESS, (uint8_t*)&payload, sizeof(payload));
|
||||
reply_ng(CMD_MEASURE_ANTENNA_TUNING, PM3_SUCCESS, (uint8_t *)&payload, sizeof(payload));
|
||||
LEDsoff();
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ uint16_t MeasureAntennaTuningHfData(void) {
|
||||
|
||||
// Measure LF in milliVolt
|
||||
uint32_t MeasureAntennaTuningLfData(void) {
|
||||
return (MAX_ADC_LF_VOLTAGE * AvgAdc(ADC_CHAN_LF)) >> 10;
|
||||
return (MAX_ADC_LF_VOLTAGE * AvgAdc(ADC_CHAN_LF)) >> 10;
|
||||
}
|
||||
|
||||
void ReadMem(int addr) {
|
||||
|
||||
@@ -3034,7 +3034,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
|
||||
memcpy(payload.nr, mf_nr_ar, sizeof(payload.nr));
|
||||
memcpy(payload.ar, mf_nr_ar + 4, sizeof(payload.ar));
|
||||
|
||||
reply_ng(CMD_HF_MIFARE_READER, return_status, (uint8_t*)&payload, sizeof(payload));
|
||||
reply_ng(CMD_HF_MIFARE_READER, return_status, (uint8_t *)&payload, sizeof(payload));
|
||||
|
||||
hf_field_off();
|
||||
set_tracing(false);
|
||||
|
||||
@@ -404,7 +404,7 @@ void ModThenAcquireRawAdcSamples125k(uint32_t delay_off, uint32_t period_0, uint
|
||||
DbpString("[!] Warning periods cannot be less than 7us in bit bang mode");
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LED_D_OFF();
|
||||
reply_ng(CMD_LF_MOD_THEN_ACQ_RAW_ADC, PM3_EINVARG, NULL, 0);
|
||||
reply_ng(CMD_LF_MOD_THEN_ACQ_RAW_ADC, PM3_EINVARG, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1708,12 +1708,12 @@ void T55xxDangerousRawTest(uint8_t *data) {
|
||||
t55xx_test_block_t *c = (t55xx_test_block_t *)data;
|
||||
|
||||
uint8_t start_wait = 4;
|
||||
uint8_t bs[128/8];
|
||||
uint8_t bs[128 / 8];
|
||||
memset(bs, 0x00, sizeof(bs));
|
||||
uint8_t len = 0;
|
||||
if (c->bitlen == 0 || c->bitlen > 128 || c->time == 0)
|
||||
reply_ng(CMD_LF_T55XX_DANGERRAW, PM3_EINVARG, NULL, 0);
|
||||
for (uint8_t i=0; i<c->bitlen; i++)
|
||||
for (uint8_t i = 0; i < c->bitlen; i++)
|
||||
len = T55xx_SetBits(bs, len, c->data[i], 1, sizeof(bs));
|
||||
|
||||
if (DBGLEVEL > 1) {
|
||||
|
||||
@@ -31,7 +31,7 @@ sample_config config = { 1, 8, 1, LF_DIVISOR_125, 0, 0, 1} ;
|
||||
void printConfig() {
|
||||
uint32_t d = config.divisor;
|
||||
DbpString(_BLUE_("LF Sampling config"));
|
||||
Dbprintf(" [q] divisor.............%d ( "_GREEN_("%d.%02d kHz")")", d, 12000 / (d+1), ((1200000 + (d+1)/2) / (d+1)) - ((12000 / (d+1)) * 100));
|
||||
Dbprintf(" [q] divisor.............%d ( "_GREEN_("%d.%02d kHz")")", d, 12000 / (d + 1), ((1200000 + (d + 1) / 2) / (d + 1)) - ((12000 / (d + 1)) * 100));
|
||||
Dbprintf(" [b] bps.................%d", config.bits_per_sample);
|
||||
Dbprintf(" [d] decimation..........%d", config.decimation);
|
||||
Dbprintf(" [a] averaging...........%s", (config.averaging) ? "Yes" : "No");
|
||||
@@ -54,7 +54,7 @@ void setSamplingConfig(sample_config *sc) {
|
||||
if (sc->divisor != 0) config.divisor = sc->divisor;
|
||||
if (sc->bits_per_sample != 0) config.bits_per_sample = sc->bits_per_sample;
|
||||
if (sc->trigger_threshold != -1) config.trigger_threshold = sc->trigger_threshold;
|
||||
// if (sc->samples_to_skip == 0xffffffff) // if needed to not update if not supplied
|
||||
// if (sc->samples_to_skip == 0xffffffff) // if needed to not update if not supplied
|
||||
|
||||
config.samples_to_skip = sc->samples_to_skip;
|
||||
config.decimation = (sc->decimation != 0) ? sc->decimation : 1;
|
||||
|
||||
@@ -952,8 +952,8 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
||||
|
||||
// cards with fixed nonce
|
||||
if (nt1 == nt2) {
|
||||
Dbprintf("Nested: %08x vs %08x", nt1, nt2);
|
||||
break;
|
||||
Dbprintf("Nested: %08x vs %08x", nt1, nt2);
|
||||
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
|
||||
@@ -1064,14 +1064,14 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
||||
crypto1_destroy(pcs);
|
||||
|
||||
struct p {
|
||||
int16_t isOK;
|
||||
uint8_t block;
|
||||
uint8_t keytype;
|
||||
uint8_t cuid[4];
|
||||
uint8_t nt_a[4];
|
||||
uint8_t ks_a[4];
|
||||
uint8_t nt_b[4];
|
||||
uint8_t ks_b[4];
|
||||
int16_t isOK;
|
||||
uint8_t block;
|
||||
uint8_t keytype;
|
||||
uint8_t cuid[4];
|
||||
uint8_t nt_a[4];
|
||||
uint8_t ks_a[4];
|
||||
uint8_t nt_b[4];
|
||||
uint8_t ks_b[4];
|
||||
} PACKED payload;
|
||||
payload.isOK = isOK;
|
||||
payload.block = targetBlockNo;
|
||||
@@ -1084,7 +1084,7 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
||||
memcpy(payload.ks_b, &target_ks[1], 4);
|
||||
|
||||
LED_B_ON();
|
||||
reply_ng(CMD_HF_MIFARE_NESTED, PM3_SUCCESS, (uint8_t*)&payload, sizeof(payload));
|
||||
reply_ng(CMD_HF_MIFARE_NESTED, PM3_SUCCESS, (uint8_t *)&payload, sizeof(payload));
|
||||
LED_B_OFF();
|
||||
|
||||
if (DBGLEVEL >= 3) DbpString("NESTED FINISHED");
|
||||
|
||||
@@ -723,7 +723,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
|
||||
|
||||
// iceman, u8 can never be larger than 256
|
||||
// if authenticating to a block that shouldn't exist - as long as we are not doing the reader attack
|
||||
if ( ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK) ) {
|
||||
if (((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK)) {
|
||||
EmSend4bit(mf_crypto1_encrypt4bit(pcs, CARD_NACK_NA));
|
||||
if (DBGLEVEL >= DBG_EXTENDED) Dbprintf("Reader tried to operate (0x%02x) on out of range block: %d (0x%02x), nacking", receivedCmd_dec[0], receivedCmd_dec[1], receivedCmd_dec[1]);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user