mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-12 04:35:28 -07:00
cppcheck fixes for const
This commit is contained in:
parent
869ae27f35
commit
6bb301f4da
armsrc
client/src
common
@ -348,7 +348,7 @@ void RunMod(void) {
|
||||
state = STATE_READ;
|
||||
DbpString(_YELLOW_("[ ") "Initialized reading mode" _YELLOW_(" ]"));
|
||||
DbpString("\n" _YELLOW_("!!") "Waiting for a Visa card...");
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// We need to listen to the high-frequency, peak-detected path.
|
||||
|
@ -99,7 +99,7 @@ void RunMod() {
|
||||
|
||||
// For received Bluetooth package
|
||||
uint8_t rpacket[MAX_FRAME_SIZE] = { 0x00 };
|
||||
uint16_t lenpacket = 0;
|
||||
uint16_t lenpacket;
|
||||
|
||||
// For answering the commands
|
||||
uint8_t apdubuffer[MAX_FRAME_SIZE] = { 0x00 };
|
||||
@ -268,7 +268,7 @@ void RunMod() {
|
||||
SpinDelay(500);
|
||||
state = STATE_READ;
|
||||
DbpString(_YELLOW_("[ ") "Initialized reading mode" _YELLOW_(" ]"));
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// We need to listen to the high-frequency, peak-detected path.
|
||||
|
@ -200,7 +200,7 @@ void RunMod(void) {
|
||||
state = STATE_READ;
|
||||
DbpString(_YELLOW_("[ ") "Initialized reading mode" _YELLOW_(" ]"));
|
||||
DbpString("\n" _YELLOW_("!!") "Waiting for an ST25TA card...");
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// We need to listen to the high-frequency, peak-detected path.
|
||||
@ -378,7 +378,7 @@ void RunMod(void) {
|
||||
state = STATE_READ;
|
||||
DbpString(_YELLOW_("[ ") "Initialized reading mode" _YELLOW_(" ]"));
|
||||
DbpString("\n" _YELLOW_("!!") "Waiting for an ST25TA card...");
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// We need to listen to the high-frequency, peak-detected path.
|
||||
|
@ -1146,7 +1146,7 @@ void SniffHitag2(bool ledcontrol) {
|
||||
AT91C_BASE_TCB->TCB_BCR = 1;
|
||||
|
||||
int frame_count = 0, response = 0, overflow = 0, lastbit = 1, tag_sof = 4;
|
||||
bool rising_edge = false, reader_frame = false, bSkip = true;
|
||||
bool rising_edge, reader_frame = false, bSkip = true;
|
||||
uint8_t rx[HITAG_FRAME_LEN];
|
||||
size_t rxlen = 0;
|
||||
|
||||
@ -1915,6 +1915,11 @@ out:
|
||||
|
||||
// release allocated memory from BigBuff.
|
||||
BigBuf_free();
|
||||
//
|
||||
if (checked == -1) {
|
||||
// user interupted
|
||||
reply_mix(CMD_ACK, false, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (bSuccessful)
|
||||
reply_mix(CMD_ACK, bSuccessful, 0, 0, (uint8_t *)tag.sectors, tag_size);
|
||||
@ -2233,5 +2238,9 @@ out:
|
||||
// release allocated memory from BigBuff.
|
||||
BigBuf_free();
|
||||
|
||||
reply_mix(CMD_ACK, bSuccessful, 0, 0, (uint8_t *)tag.sectors, tag_size);
|
||||
if (checked == -1) {
|
||||
reply_mix(CMD_ACK, false, 0, 0, 0, 0);
|
||||
} else {
|
||||
reply_mix(CMD_ACK, bSuccessful, 0, 0, (uint8_t *)tag.sectors, tag_size);
|
||||
}
|
||||
}
|
||||
|
@ -1268,7 +1268,7 @@ void ReadHitagS(hitag_function htf, hitag_data *htd, bool ledcontrol) {
|
||||
uint8_t rx[HITAG_FRAME_LEN];
|
||||
size_t rxlen = 0;
|
||||
uint8_t tx[HITAG_FRAME_LEN];
|
||||
size_t txlen = 0;
|
||||
size_t txlen;
|
||||
int t_wait = HITAG_T_WAIT_MAX;
|
||||
|
||||
|
||||
|
@ -210,7 +210,7 @@ void ReadPCF7931(bool ledcontrol) {
|
||||
uint8_t single_blocks[8][17]; // PFC blocks with unknown position
|
||||
int single_blocks_cnt = 0;
|
||||
|
||||
size_t n = 0; // transmitted blocks
|
||||
size_t n; // transmitted blocks
|
||||
uint8_t tmp_blocks[4][16]; // temporary read buffer
|
||||
|
||||
uint8_t found_0_1 = 0; // flag: blocks 0 and 1 were found
|
||||
|
@ -1114,7 +1114,7 @@ typedef struct {
|
||||
uint8_t mlen;
|
||||
const char *match;
|
||||
uint32_t (*Pwd)(const uint8_t *uid);
|
||||
uint16_t (*Pack)(uint8_t *uid);
|
||||
uint16_t (*Pack)(const uint8_t *uid);
|
||||
const char *hint;
|
||||
} mfu_identify_t;
|
||||
|
||||
|
@ -157,10 +157,10 @@ uint16_t ul_ev1_packgenA(const uint8_t *uid) {
|
||||
uint16_t pack = (uid[0] ^ uid[1] ^ uid[2]) << 8 | (uid[2] ^ 8);
|
||||
return pack;
|
||||
}
|
||||
uint16_t ul_ev1_packgenB(uint8_t *uid) {
|
||||
uint16_t ul_ev1_packgenB(const uint8_t *uid) {
|
||||
return 0x8080;
|
||||
}
|
||||
uint16_t ul_ev1_packgenC(uint8_t *uid) {
|
||||
uint16_t ul_ev1_packgenC(const uint8_t *uid) {
|
||||
return 0xaa55;
|
||||
}
|
||||
uint16_t ul_ev1_packgenD(const uint8_t *uid) {
|
||||
@ -182,10 +182,11 @@ uint16_t ul_ev1_packgenD(const uint8_t *uid) {
|
||||
return BSWAP_16(p & 0xFFFF);
|
||||
}
|
||||
|
||||
// default shims
|
||||
uint32_t ul_ev1_pwdgen_def(const uint8_t *uid) {
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
uint16_t ul_ev1_packgen_def(uint8_t *uid) {
|
||||
uint16_t ul_ev1_packgen_def(const uint8_t *uid) {
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
|
@ -19,10 +19,10 @@ uint32_t ul_ev1_pwdgenB(const uint8_t *uid);
|
||||
uint32_t ul_ev1_pwdgenC(const uint8_t *uid);
|
||||
uint32_t ul_ev1_pwdgenD(const uint8_t *uid);
|
||||
|
||||
uint16_t ul_ev1_packgen_def(uint8_t *uid);
|
||||
uint16_t ul_ev1_packgen_def(const uint8_t *uid);
|
||||
uint16_t ul_ev1_packgenA(const uint8_t *uid);
|
||||
uint16_t ul_ev1_packgenB(uint8_t *uid);
|
||||
uint16_t ul_ev1_packgenC(uint8_t *uid);
|
||||
uint16_t ul_ev1_packgenB(const uint8_t *uid);
|
||||
uint16_t ul_ev1_packgenC(const uint8_t *uid);
|
||||
uint16_t ul_ev1_packgenD(const uint8_t *uid);
|
||||
|
||||
int mfc_algo_ving_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t *key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user