mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
cppcheck fixes const
This commit is contained in:
parent
2bf2bb301a
commit
89a05b47a8
9 changed files with 17 additions and 17 deletions
|
@ -880,7 +880,7 @@ int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidt
|
|||
}
|
||||
|
||||
// "MAGIC" CARD
|
||||
int mfCSetUID(uint8_t *uid, uint8_t uidlen, uint8_t *atqa, uint8_t *sak, uint8_t *old_uid, uint8_t *verifed_uid, uint8_t wipecard) {
|
||||
int mfCSetUID(uint8_t *uid, uint8_t uidlen, const uint8_t *atqa, const uint8_t *sak, uint8_t *old_uid, uint8_t *verifed_uid, uint8_t wipecard) {
|
||||
|
||||
uint8_t params = MAGIC_SINGLE;
|
||||
uint8_t block0[16];
|
||||
|
@ -945,7 +945,7 @@ int mfCSetUID(uint8_t *uid, uint8_t uidlen, uint8_t *atqa, uint8_t *sak, uint8_t
|
|||
return res;
|
||||
}
|
||||
|
||||
int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
|
||||
int mfCWipe(uint8_t *uid, const uint8_t *atqa, const uint8_t *sak) {
|
||||
uint8_t block0[16] = {0x01, 0x02, 0x03, 0x04, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xAF};
|
||||
uint8_t blockD[16] = {0x00};
|
||||
uint8_t blockK[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0x77, 0x8F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
|
|
|
@ -76,8 +76,8 @@ int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);
|
|||
int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);
|
||||
int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidth);
|
||||
|
||||
int mfCSetUID(uint8_t *uid, uint8_t uidlen, uint8_t *atqa, uint8_t *sak, uint8_t *old_uid, uint8_t *verifed_uid, uint8_t wipecard);
|
||||
int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak);
|
||||
int mfCSetUID(uint8_t *uid, uint8_t uidlen, const uint8_t *atqa, const uint8_t *sak, uint8_t *old_uid, uint8_t *verifed_uid, uint8_t wipecard);
|
||||
int mfCWipe(uint8_t *uid, const uint8_t *atqa, const uint8_t *sak);
|
||||
int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t params);
|
||||
int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params);
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ static const char *URI_s[] = {
|
|||
static int ndefRecordDecodeAndPrint(uint8_t *ndefRecord, size_t ndefRecordLen);
|
||||
static int ndefDecodePayload(NDEFHeader_t *ndef);
|
||||
|
||||
static uint16_t ndefTLVGetLength(uint8_t *data, size_t *indx) {
|
||||
static uint16_t ndefTLVGetLength(const uint8_t *data, size_t *indx) {
|
||||
uint16_t len = 0;
|
||||
if (data[0] == 0xff) {
|
||||
len = (data[1] << 8) + data[2];
|
||||
|
|
|
@ -843,7 +843,7 @@ int hextobinstring(char *target, char *source) {
|
|||
|
||||
// convert binary array of 0x00/0x01 values to hex
|
||||
// return number of bits converted
|
||||
int binarraytohex(char *target, const size_t targetlen, char *source, size_t srclen) {
|
||||
int binarraytohex(char *target, const size_t targetlen, const char *source, size_t srclen) {
|
||||
uint8_t i = 0, x = 0;
|
||||
uint32_t t = 0; // written target chars
|
||||
uint32_t r = 0; // consumed bits
|
||||
|
@ -914,7 +914,7 @@ int binstring2binarray(uint8_t *target, char *source, int length) {
|
|||
}
|
||||
|
||||
// return parity bit required to match type
|
||||
uint8_t GetParity(uint8_t *bits, uint8_t type, int length) {
|
||||
uint8_t GetParity(const uint8_t *bits, uint8_t type, int length) {
|
||||
int x;
|
||||
for (x = 0 ; length > 0 ; --length)
|
||||
x += bits[length - 1];
|
||||
|
@ -939,7 +939,7 @@ void wiegand_add_parity_swapped(uint8_t *target, uint8_t *source, uint8_t length
|
|||
}
|
||||
|
||||
// Pack a bitarray into a uint32_t.
|
||||
uint32_t PackBits(uint8_t start, uint8_t len, uint8_t *bits) {
|
||||
uint32_t PackBits(uint8_t start, uint8_t len, const uint8_t *bits) {
|
||||
|
||||
if (len > 32) return 0;
|
||||
|
||||
|
@ -1082,7 +1082,7 @@ int binstring_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const char *str)
|
|||
*
|
||||
* Returns the number of bits entered.
|
||||
*/
|
||||
int binarray_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, uint8_t *arr, int arrlen) {
|
||||
int binarray_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const uint8_t *arr, int arrlen) {
|
||||
int i = 0;
|
||||
for (; i < arrlen; i++) {
|
||||
uint8_t n = arr[i];
|
||||
|
|
|
@ -86,17 +86,17 @@ int param_getstr(const char *line, int paramnum, char *str, size_t buffersize);
|
|||
|
||||
int hextobinarray(char *target, char *source);
|
||||
int hextobinstring(char *target, char *source);
|
||||
int binarraytohex(char *target, const size_t targetlen, char *source, size_t srclen);
|
||||
int binarraytohex(char *target, const size_t targetlen, const char *source, size_t srclen);
|
||||
void binarraytobinstring(char *target, char *source, int length);
|
||||
int binstring2binarray(uint8_t *target, char *source, int length);
|
||||
|
||||
uint8_t GetParity(uint8_t *bits, uint8_t type, int length);
|
||||
uint8_t GetParity(const uint8_t *bits, uint8_t type, int length);
|
||||
void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length);
|
||||
void wiegand_add_parity_swapped(uint8_t *target, uint8_t *source, uint8_t length);
|
||||
|
||||
//void xor(unsigned char *dst, unsigned char *src, size_t len);
|
||||
|
||||
uint32_t PackBits(uint8_t start, uint8_t len, uint8_t *bits);
|
||||
uint32_t PackBits(uint8_t start, uint8_t len, const uint8_t *bits);
|
||||
uint64_t HornerScheme(uint64_t num, uint64_t divider, uint64_t factor);
|
||||
|
||||
int num_CPUs(void); // number of logical CPUs
|
||||
|
@ -111,7 +111,7 @@ char *str_dup(const char *src);
|
|||
char *str_ndup(const char *src, size_t len);
|
||||
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);
|
||||
int binarray_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, uint8_t *arr, int arrlen);
|
||||
int binarray_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const uint8_t *arr, int arrlen);
|
||||
|
||||
uint32_t bitcount32(uint32_t a);
|
||||
uint64_t bitcount64(uint64_t a);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue