mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
style
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// main code for hf_craftbyte
|
||||
// main code for hf_craftbyte
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
@@ -77,7 +77,7 @@ void RunMod(void) {
|
||||
flags |= FLAG_4B_UID_IN_DATA;
|
||||
} else if (card.uidlen == 7) {
|
||||
flags |= FLAG_7B_UID_IN_DATA;
|
||||
} else if (card.uidlen == 10){
|
||||
} else if (card.uidlen == 10) {
|
||||
flags |= FLAG_10B_UID_IN_DATA;
|
||||
} else {
|
||||
Dbprintf("Unusual UID length, something is wrong. Try again please.");
|
||||
|
||||
@@ -327,7 +327,7 @@ void RunMod(void) {
|
||||
|
||||
if (i == 4) {
|
||||
// Get NDEF Data
|
||||
if (apdubuffer[1] == 0x1b && apdubuffer[2] == 0xd1) {
|
||||
if (apdubuffer[1] == 0x1b && apdubuffer[2] == 0xd1) {
|
||||
gotndef = true;
|
||||
memcpy(&ndef, &apdubuffer, apdulen - 2);
|
||||
break;
|
||||
|
||||
+2
-2
@@ -1112,7 +1112,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CMD_LF_HITAG_ELOAD: {
|
||||
case CMD_LF_HITAG_ELOAD: {
|
||||
/*
|
||||
struct p {
|
||||
uint16_t len;
|
||||
@@ -1746,7 +1746,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||
break;
|
||||
}
|
||||
case CMD_SMART_RAW: {
|
||||
SmartCardRaw((smart_card_raw_t*)packet->data.asBytes);
|
||||
SmartCardRaw((smart_card_raw_t *)packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_SMART_UPLOAD: {
|
||||
|
||||
+3
-3
@@ -592,7 +592,7 @@ void felica_sniff(uint32_t samplesToSkip, uint32_t triggersToSkip) {
|
||||
WDT_HIT();
|
||||
|
||||
// since simulation is a tight time critical loop,
|
||||
// we only check for user request to end at iteration 3000, 9000.
|
||||
// we only check for user request to end at iteration 3000, 9000.
|
||||
if (flip == 3) {
|
||||
if (data_available()) {
|
||||
retval = PM3_EOPABORTED;
|
||||
@@ -689,7 +689,7 @@ void felica_sim_lite(uint8_t *uid) {
|
||||
uint8_t *curresp = NULL;
|
||||
bool listenmode = true;
|
||||
// uint32_t frtm = GetCountSspClk();
|
||||
|
||||
|
||||
uint8_t flip = 0;
|
||||
uint16_t checker = 0;
|
||||
for (;;) {
|
||||
@@ -697,7 +697,7 @@ void felica_sim_lite(uint8_t *uid) {
|
||||
WDT_HIT();
|
||||
|
||||
// since simulation is a tight time critical loop,
|
||||
// we only check for user request to end at iteration 3000, 9000.
|
||||
// we only check for user request to end at iteration 3000, 9000.
|
||||
if (flip == 3) {
|
||||
if (data_available()) {
|
||||
retval = PM3_EOPABORTED;
|
||||
|
||||
+255
-255
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -735,7 +735,7 @@ void SmartCardRaw(smart_card_raw_t *p) {
|
||||
|
||||
if ((flags & SC_LOG) == SC_LOG)
|
||||
set_tracing(true);
|
||||
else
|
||||
else
|
||||
set_tracing(false);
|
||||
|
||||
if ((flags & SC_CONNECT) == SC_CONNECT) {
|
||||
@@ -758,11 +758,11 @@ void SmartCardRaw(smart_card_raw_t *p) {
|
||||
LogTrace(p->data, p->len, 0, 0, NULL, true);
|
||||
|
||||
bool res = I2C_BufferWrite(
|
||||
p->data,
|
||||
p->len,
|
||||
((flags & SC_RAW_T0) ? I2C_DEVICE_CMD_SEND_T0 : I2C_DEVICE_CMD_SEND),
|
||||
I2C_DEVICE_ADDRESS_MAIN
|
||||
);
|
||||
p->data,
|
||||
p->len,
|
||||
((flags & SC_RAW_T0) ? I2C_DEVICE_CMD_SEND_T0 : I2C_DEVICE_CMD_SEND),
|
||||
I2C_DEVICE_ADDRESS_MAIN
|
||||
);
|
||||
if (res == false && DBGLEVEL > 3) {
|
||||
DbpString(I2C_ERROR);
|
||||
reply_ng(CMD_SMART_RAW, PM3_ESOFT, NULL, 0);
|
||||
|
||||
+4
-4
@@ -79,7 +79,7 @@ static size_t lf_count_edge_periods_ex(size_t max, bool wait, bool detect_gap) {
|
||||
|
||||
#define LIMIT_DEV 20
|
||||
|
||||
// timeout limit to 100 000 w/o
|
||||
// timeout limit to 100 000 w/o
|
||||
uint32_t timeout = 100000;
|
||||
size_t periods = 0;
|
||||
uint8_t avg_peak = adc_avg + LIMIT_DEV;
|
||||
@@ -135,7 +135,7 @@ static size_t lf_count_edge_periods_ex(size_t max, bool wait, bool detect_gap) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
previous_adc_val = adc_val;
|
||||
@@ -220,8 +220,8 @@ void lf_init(bool reader, bool simulate) {
|
||||
// When in reader mode, give the field a bit of time to settle.
|
||||
// 313T0 = 313 * 8us = 2504us = 2.5ms Hitag2 tags needs to be fully powered.
|
||||
// if (reader) {
|
||||
// 10 ms
|
||||
SpinDelay(10);
|
||||
// 10 ms
|
||||
SpinDelay(10);
|
||||
// }
|
||||
|
||||
// Steal this pin from the SSP (SPI communication channel with fpga) and use it to control the modulation
|
||||
|
||||
+4
-4
@@ -663,10 +663,10 @@ void MifareUSetPwd(uint8_t arg0, uint8_t *datain) {
|
||||
// Return 1 if the nonce is invalid else return 0
|
||||
static int valid_nonce(uint32_t Nt, uint32_t NtEnc, uint32_t Ks1, uint8_t *parity) {
|
||||
return (
|
||||
(oddparity8((Nt >> 24) & 0xFF) == ((parity[0]) ^ oddparity8((NtEnc >> 24) & 0xFF) ^ BIT(Ks1, 16))) && \
|
||||
(oddparity8((Nt >> 16) & 0xFF) == ((parity[1]) ^ oddparity8((NtEnc >> 16) & 0xFF) ^ BIT(Ks1, 8))) && \
|
||||
(oddparity8((Nt >> 8) & 0xFF) == ((parity[2]) ^ oddparity8((NtEnc >> 8) & 0xFF) ^ BIT(Ks1, 0)))
|
||||
) ? 1 : 0;
|
||||
(oddparity8((Nt >> 24) & 0xFF) == ((parity[0]) ^ oddparity8((NtEnc >> 24) & 0xFF) ^ BIT(Ks1, 16))) && \
|
||||
(oddparity8((Nt >> 16) & 0xFF) == ((parity[1]) ^ oddparity8((NtEnc >> 16) & 0xFF) ^ BIT(Ks1, 8))) && \
|
||||
(oddparity8((Nt >> 8) & 0xFF) == ((parity[2]) ^ oddparity8((NtEnc >> 8) & 0xFF) ^ BIT(Ks1, 0)))
|
||||
) ? 1 : 0;
|
||||
}
|
||||
|
||||
void MifareAcquireNonces(uint32_t arg0, uint32_t flags) {
|
||||
|
||||
+16
-16
@@ -545,24 +545,24 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
|
||||
counter++;
|
||||
}
|
||||
|
||||
/*
|
||||
// find reader field
|
||||
if (cardSTATE == MFEMUL_NOFIELD) {
|
||||
/*
|
||||
// find reader field
|
||||
if (cardSTATE == MFEMUL_NOFIELD) {
|
||||
|
||||
#if defined RDV4
|
||||
vHf = (MAX_ADC_HF_VOLTAGE_RDV40 * SumAdc(ADC_CHAN_HF_RDV40, 32)) >> 15;
|
||||
#else
|
||||
vHf = (MAX_ADC_HF_VOLTAGE * SumAdc(ADC_CHAN_HF, 32)) >> 15;
|
||||
#endif
|
||||
#if defined RDV4
|
||||
vHf = (MAX_ADC_HF_VOLTAGE_RDV40 * SumAdc(ADC_CHAN_HF_RDV40, 32)) >> 15;
|
||||
#else
|
||||
vHf = (MAX_ADC_HF_VOLTAGE * SumAdc(ADC_CHAN_HF, 32)) >> 15;
|
||||
#endif
|
||||
|
||||
if (vHf > MF_MINFIELDV) {
|
||||
cardSTATE_TO_IDLE();
|
||||
LED_A_ON();
|
||||
}
|
||||
button_pushed = BUTTON_PRESS();
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
if (vHf > MF_MINFIELDV) {
|
||||
cardSTATE_TO_IDLE();
|
||||
LED_A_ON();
|
||||
}
|
||||
button_pushed = BUTTON_PRESS();
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
|
||||
FpgaEnableTracing();
|
||||
//Now, get data
|
||||
|
||||
+1
-1
@@ -213,7 +213,7 @@ uint32_t size_in_spiffs(const char *filename) {
|
||||
if (SPIFFS_stat(&fs, filename, &s) < 0) {
|
||||
Dbprintf("errno %i\n", SPIFFS_errno(&fs));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return s.size;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ bool nfc3d_amiibo_load_keys(nfc3d_amiibo_keys *amiiboKeys) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((amiiboKeys->data.magicBytesSize > 16) || (amiiboKeys->tag.magicBytesSize > 16)) {
|
||||
if ((amiiboKeys->data.magicBytesSize > 16) || (amiiboKeys->tag.magicBytesSize > 16)) {
|
||||
free(dump);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ static void precalculate_bit0_bitflip_bitarrays(uint8_t const bitflip, uint16_t
|
||||
count[odd_even],
|
||||
odd_even == EVEN_STATE ? "even" : "odd",
|
||||
bitflip,
|
||||
(1 << 24) - count[odd_even],
|
||||
(1 << 24) - count[odd_even],
|
||||
(float)((1 << 24) - count[odd_even]) / (1 << 24) * 100.0);
|
||||
#ifndef TEST_RUN
|
||||
write_bitflips_file(odd_even, bitflip, sum_a0, test_bitarray[odd_even], count[odd_even]);
|
||||
@@ -404,7 +404,7 @@ static void precalculate_bit0_bitflip_bitarrays(uint8_t const bitflip, uint16_t
|
||||
count[odd_even],
|
||||
odd_even == EVEN_STATE ? "even" : "odd",
|
||||
bitflip | BITFLIP_2ND_BYTE,
|
||||
(1 << 24) - count[odd_even],
|
||||
(1 << 24) - count[odd_even],
|
||||
(float)((1 << 24) - count[odd_even]) / (1 << 24) * 100.0);
|
||||
#ifndef TEST_RUN
|
||||
write_bitflips_file(odd_even, bitflip | BITFLIP_2ND_BYTE, sum_a0, test_bitarray_2nd, count[odd_even]);
|
||||
@@ -490,7 +490,7 @@ static void precalculate_bit0_bitflip_bitarrays(uint8_t const bitflip, uint16_t
|
||||
count[odd_even],
|
||||
odd_even == EVEN_STATE ? "even" : "odd",
|
||||
bitflip | 0x100,
|
||||
(1 << 24) - count[odd_even],
|
||||
(1 << 24) - count[odd_even],
|
||||
(float)((1 << 24) - count[odd_even]) / (1 << 24) * 100.0);
|
||||
#ifndef TEST_RUN
|
||||
write_bitflips_file(odd_even, bitflip | 0x100, sum_a0, test_not_bitarray[odd_even], count[odd_even]);
|
||||
@@ -517,7 +517,7 @@ static void precalculate_bit0_bitflip_bitarrays(uint8_t const bitflip, uint16_t
|
||||
printf("Writing %u possible %s states for bitflip property %03x (%u (%1.2f%%) states eliminated)\n",
|
||||
count[odd_even],
|
||||
odd_even == EVEN_STATE ? "even" : "odd",
|
||||
bitflip | 0x100 | BITFLIP_2ND_BYTE,
|
||||
bitflip | 0x100 | BITFLIP_2ND_BYTE,
|
||||
(1 << 24) - count[odd_even],
|
||||
(float)((1 << 24) - count[odd_even]) / (1 << 24) * 100.0);
|
||||
#ifndef TEST_RUN
|
||||
|
||||
@@ -14,12 +14,12 @@ Any other input char will exit the script.
|
||||
|
||||
You can supply a password, which will set the config block / block 7 on the T5577.
|
||||
|
||||
The verify option will issue a 'lf em 410x reader' command, so you can manually verify
|
||||
The verify option will issue a 'lf em 410x reader' command, so you can manually verify
|
||||
that the write worked.
|
||||
|
||||
]]
|
||||
example = [[
|
||||
-- resets and start enrolling EM410x id 11CC334455
|
||||
-- resets and start enrolling EM410x id 11CC334455
|
||||
script run lf_em4100_bulk.lua -s 11CC334455
|
||||
|
||||
-- continue enrolling from where last iteration
|
||||
@@ -28,7 +28,7 @@ example = [[
|
||||
-- reset and start enrolling from 11223344,
|
||||
-- protecting the tag with password 010203
|
||||
-- and verify the em id write.
|
||||
script run lf_em4100_bulk.lua -s 1122334455 -p 01020304 -v
|
||||
script run lf_em4100_bulk.lua -s 1122334455 -p 01020304 -v
|
||||
]]
|
||||
usage = [[
|
||||
script run lf_en4100_bulk.lua [-h] [-c] [-p password] [-s <start cn>] [-v]
|
||||
@@ -143,7 +143,7 @@ local function main(args)
|
||||
end
|
||||
|
||||
-- if reset/start over, check -s
|
||||
if not shall_continue then
|
||||
if not shall_continue then
|
||||
if startid == nil then return oops('empty card number string') end
|
||||
if #startid == 0 then return oops('empty card number string') end
|
||||
if #startid ~= 10 then return oops('card number wrong length. Must be 5 hex bytes') end
|
||||
@@ -159,7 +159,7 @@ local function main(args)
|
||||
print(ac.red..'disable hints for less output'..ac.reset)
|
||||
core.console('pref set hint --off')
|
||||
print('')
|
||||
|
||||
|
||||
local hi = tonumber(startid:sub(1, 2), 16)
|
||||
local low = tonumber(startid:sub(3, 10), 16)
|
||||
local pwd = tonumber(ipwd, 16)
|
||||
@@ -178,7 +178,7 @@ local function main(args)
|
||||
else
|
||||
print('reset & starting enrolling from refresh')
|
||||
end
|
||||
|
||||
|
||||
local template = 'EM4100 ID '..ac.green..'%02X%08X'..ac.reset
|
||||
for i = low, low + 10000, 1 do
|
||||
print('')
|
||||
@@ -186,7 +186,7 @@ local function main(args)
|
||||
local msg = (template):format(hi, i)
|
||||
local ans = utils.input(msg, 'y'):lower()
|
||||
if ans == 'y' then
|
||||
core.console( ('lf em 410x clone --id %02X%08X'):format(hi, i) )
|
||||
core.console( ('lf em 410x clone --id %02X%08X'):format(hi, i) )
|
||||
-- print ( ('lf em 410x clone --id %02X%08X'):format(hi, i) )
|
||||
|
||||
if got_pwd then
|
||||
|
||||
@@ -440,15 +440,15 @@ static void showSavePathState(savePaths_t path_index, prefShowOpt_t opt) {
|
||||
if (path_index < spItemCount) {
|
||||
if ((session.defaultPaths[path_index] == NULL) || (strcmp(session.defaultPaths[path_index], "") == 0)) {
|
||||
PrintAndLogEx(INFO, " %s %s "_WHITE_("not set"),
|
||||
prefShowMsg(opt),
|
||||
s
|
||||
);
|
||||
prefShowMsg(opt),
|
||||
s
|
||||
);
|
||||
} else {
|
||||
PrintAndLogEx(INFO, " %s %s "_GREEN_("%s"),
|
||||
prefShowMsg(opt),
|
||||
s,
|
||||
session.defaultPaths[path_index]
|
||||
);
|
||||
prefShowMsg(opt),
|
||||
s,
|
||||
session.defaultPaths[path_index]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ static void set_my_user_directory(void) {
|
||||
char *cwd_buffer = (char *)calloc(pathLen, sizeof(uint8_t));
|
||||
if (cwd_buffer == NULL) {
|
||||
PrintAndLogEx(WARNING, "failed to allocate memory");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
while (GetCurrentDir(cwd_buffer, pathLen) == NULL) {
|
||||
|
||||
@@ -1281,7 +1281,7 @@ static int l_cwd(lua_State *L) {
|
||||
uint16_t path_len = FILENAME_MAX; // should be a good starting point
|
||||
char *cwd = (char *)calloc(path_len, sizeof(uint8_t));
|
||||
if (cwd == NULL) {
|
||||
return returnToLuaWithError(L, "Failed to allocate memory");
|
||||
return returnToLuaWithError(L, "Failed to allocate memory");
|
||||
}
|
||||
|
||||
while (GetCurrentDir(cwd, path_len) == NULL) {
|
||||
|
||||
+4
-4
@@ -299,7 +299,7 @@ char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t brea
|
||||
// manchester wrong bit marker
|
||||
if (c == 7)
|
||||
c = '.';
|
||||
else
|
||||
else
|
||||
c += '0';
|
||||
|
||||
*(tmp++) = c;
|
||||
@@ -308,7 +308,7 @@ char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t brea
|
||||
if (breaks) {
|
||||
if (((i + 1) % breaks) == 0) {
|
||||
|
||||
*(tmp++) = '\n';
|
||||
*(tmp++) = '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1026,7 +1026,7 @@ int hexstring_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const char *str)
|
||||
int binstring_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const char *str) {
|
||||
uint32_t n = 0, i = 0;
|
||||
|
||||
for(;;) {
|
||||
for (;;) {
|
||||
|
||||
int res = sscanf(&str[i], "%1u", &n);
|
||||
if ((res != 1) || (n > 1))
|
||||
@@ -1050,7 +1050,7 @@ int binstring_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const char *str)
|
||||
*/
|
||||
int binarray_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, uint8_t *arr, int arrlen) {
|
||||
int i = 0;
|
||||
for(; i < arrlen; i++) {
|
||||
for (; i < arrlen; i++) {
|
||||
uint8_t n = arr[i];
|
||||
if (n > 1)
|
||||
break;
|
||||
|
||||
+2
-2
@@ -91,7 +91,7 @@ void DecodeBlock6(uint8_t *src) {
|
||||
c[5] = 0x02;
|
||||
ExchangeAPDUSC(false, c, sizeof(c), false, false, resp, sizeof(resp), &resp_len);
|
||||
|
||||
|
||||
|
||||
if (resp_len < 11) {
|
||||
return;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ int GetConfigCardByIdx(uint8_t typ, uint8_t *blocks) {
|
||||
|
||||
int resp_len = 0;
|
||||
uint8_t resp[254] = {0};
|
||||
uint8_t c[] = {0x96, CARD_INS_CC, 0x00, 0x00, 17, typ, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
uint8_t c[] = {0x96, CARD_INS_CC, 0x00, 0x00, 17, typ, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
ExchangeAPDUSC(false, c, sizeof(c), false, true, resp, sizeof(resp), &resp_len);
|
||||
|
||||
if (resp_len < 2) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MYSRCPATHS = ../../common ../../common/crapto1
|
||||
MYSRCPATHS = ../../common ../../common/crapto1
|
||||
MYSRCS = crypto1.c crapto1.c bucketsort.c iso14443crc.c sleep.c
|
||||
MYINCLUDES = -I../../include -I../../common
|
||||
MYINCLUDES = -I../../include -I../../common
|
||||
MYCFLAGS =
|
||||
MYDEFS =
|
||||
MYLDLIBS =
|
||||
@@ -22,4 +22,4 @@ endif
|
||||
|
||||
mf_nonce_brute : $(OBJDIR)/mf_nonce_brute.o $(MYOBJS)
|
||||
|
||||
mf_trace_brute : $(OBJDIR)/mf_trace_brute.o $(MYOBJS)
|
||||
mf_trace_brute : $(OBJDIR)/mf_trace_brute.o $(MYOBJS)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//
|
||||
//
|
||||
// bruteforce the upper 16bits of a partial key recovered from mf_nonce_brute.
|
||||
// J-run's original idea was a two part recovery vector with first a offline trace and then online for 2 bytes.
|
||||
//
|
||||
//
|
||||
// This idea is two use only offline, to recover a nested authentication key.
|
||||
// Assumption, we get a read/write command after a nested auth, we need 22 bytes of data.
|
||||
// Iceman, 2021,
|
||||
//
|
||||
//
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
|
||||
@@ -41,7 +41,7 @@ typedef struct thread_args {
|
||||
uint32_t part_key;
|
||||
uint32_t nt_enc;
|
||||
uint32_t nr_enc;
|
||||
uint8_t enc[ENC_LEN]; // next encrypted command + a full read/write
|
||||
uint8_t enc[ENC_LEN]; // next encrypted command + a full read/write
|
||||
} targs;
|
||||
|
||||
//------------------------------------------------------------------
|
||||
@@ -137,7 +137,7 @@ static int param_gethex_to_eol(const char *line, int paramnum, uint8_t *data, in
|
||||
}
|
||||
|
||||
static void hex_to_buffer(const uint8_t *buf, const uint8_t *hex_data, const size_t hex_len, const size_t hex_max_len,
|
||||
const size_t min_str_len, const size_t spaces_between, bool uppercase) {
|
||||
const size_t min_str_len, const size_t spaces_between, bool uppercase) {
|
||||
|
||||
if (buf == NULL) return;
|
||||
|
||||
@@ -216,10 +216,10 @@ static void *brute_thread(void *arguments) {
|
||||
|
||||
crypto1_deinit(pcs);
|
||||
|
||||
if (CheckCrc14443(CRC_14443_A, dec , 4)) {
|
||||
if (CheckCrc14443(CRC_14443_A, dec, 4)) {
|
||||
|
||||
// check crc-16 in the end
|
||||
|
||||
|
||||
if (CheckCrc14443(CRC_14443_A, dec + 4, 18)) {
|
||||
|
||||
// lock this section to avoid interlacing prints from different threats
|
||||
@@ -259,7 +259,7 @@ int main(int argc, char *argv[]) {
|
||||
sscanf(argv[4], "%x", &nr_enc);
|
||||
|
||||
int enc_len = 0;
|
||||
uint8_t enc[ENC_LEN] = {0}; // next encrypted command + a full read/write
|
||||
uint8_t enc[ENC_LEN] = {0}; // next encrypted command + a full read/write
|
||||
param_gethex_to_eol(argv[5], 0, enc, sizeof(enc), &enc_len);
|
||||
|
||||
printf("-------------------------------------------------\n");
|
||||
@@ -267,7 +267,7 @@ int main(int argc, char *argv[]) {
|
||||
printf("partial key.. %08x\n", part_key);
|
||||
printf("nt enc....... %08x\n", nt_enc);
|
||||
printf("nr enc....... %08x\n", nr_enc);
|
||||
printf("next encrypted cmd: %s\n", sprint_hex_inrow_ex(enc, ENC_LEN ,0));
|
||||
printf("next encrypted cmd: %s\n", sprint_hex_inrow_ex(enc, ENC_LEN, 0));
|
||||
|
||||
clock_t t1 = clock();
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user