mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
use more static and fix [-Wmissing-prototypes], ongoing...
This commit is contained in:
parent
05374fce07
commit
4f32655004
25 changed files with 167 additions and 151 deletions
|
@ -107,7 +107,7 @@ static const char *GetAIDDescription(uint16_t AID) {
|
|||
return unknownAID;
|
||||
}
|
||||
|
||||
int madCRCCheck(uint8_t *sector, bool verbose, int MADver) {
|
||||
static int madCRCCheck(uint8_t *sector, bool verbose, int MADver) {
|
||||
if (MADver == 1) {
|
||||
uint8_t crc = CRC8Mad(§or[16 + 1], 15 + 16);
|
||||
if (crc != sector[16]) {
|
||||
|
@ -125,7 +125,7 @@ int madCRCCheck(uint8_t *sector, bool verbose, int MADver) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
uint16_t madGetAID(uint8_t *sector, int MADver, int sectorNo) {
|
||||
static uint16_t madGetAID(uint8_t *sector, int MADver, int sectorNo) {
|
||||
if (MADver == 1)
|
||||
return (sector[16 + 2 + (sectorNo - 1) * 2] << 8) + (sector[16 + 2 + (sectorNo - 1) * 2 + 1]);
|
||||
else
|
||||
|
|
|
@ -95,8 +95,8 @@ const char *mfGetAccessConditionsDesc(uint8_t blockn, uint8_t *data) {
|
|||
|
||||
return StaticNone;
|
||||
};
|
||||
|
||||
int CalculateEncIVCommand(mf4Session *session, uint8_t *iv, bool verbose) {
|
||||
/*
|
||||
static int CalculateEncIVCommand(mf4Session *session, uint8_t *iv, bool verbose) {
|
||||
memcpy(&iv[0], session->TI, 4);
|
||||
memcpy(&iv[4], &session->R_Ctr, 2);
|
||||
memcpy(&iv[6], &session->W_Ctr, 2);
|
||||
|
@ -108,7 +108,7 @@ int CalculateEncIVCommand(mf4Session *session, uint8_t *iv, bool verbose) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CalculateEncIVResponse(mf4Session *session, uint8_t *iv, bool verbose) {
|
||||
static int CalculateEncIVResponse(mf4Session *session, uint8_t *iv, bool verbose) {
|
||||
memcpy(&iv[0], &session->R_Ctr, 2);
|
||||
memcpy(&iv[2], &session->W_Ctr, 2);
|
||||
memcpy(&iv[4], &session->R_Ctr, 2);
|
||||
|
@ -119,7 +119,7 @@ int CalculateEncIVResponse(mf4Session *session, uint8_t *iv, bool verbose) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
int CalculateMAC(mf4Session *session, MACType_t mtype, uint8_t blockNum, uint8_t blockCount, uint8_t *data, int datalen, uint8_t *mac, bool verbose) {
|
||||
if (!session || !session->Authenticated || !mac || !data || !datalen || datalen < 1)
|
||||
|
@ -308,7 +308,7 @@ int MifareAuth4(mf4Session *session, uint8_t *keyn, uint8_t *key, bool activateF
|
|||
return 0;
|
||||
}
|
||||
|
||||
int intExchangeRAW14aPlus(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen) {
|
||||
static int intExchangeRAW14aPlus(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen) {
|
||||
if (VerboseMode)
|
||||
PrintAndLogEx(INFO, ">>> %s", sprint_hex(datain, datainlen));
|
||||
|
||||
|
|
|
@ -263,14 +263,14 @@ int mfKeyBrute(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint64_t *resultk
|
|||
}
|
||||
|
||||
// Compare 16 Bits out of cryptostate
|
||||
int Compare16Bits(const void *a, const void *b) {
|
||||
static int Compare16Bits(const void *a, const void *b) {
|
||||
if ((*(uint64_t *)b & 0x00ff000000ff0000) == (*(uint64_t *)a & 0x00ff000000ff0000)) return 0;
|
||||
if ((*(uint64_t *)b & 0x00ff000000ff0000) > (*(uint64_t *)a & 0x00ff000000ff0000)) return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// wrapper function for multi-threaded lfsr_recovery32
|
||||
void
|
||||
static void
|
||||
#ifdef __has_attribute
|
||||
#if __has_attribute(force_align_arg_pointer)
|
||||
__attribute__((force_align_arg_pointer))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue