stricter warnings, wip

This commit is contained in:
Philippe Teuwen
2020-05-03 01:13:28 +02:00
parent 9358554884
commit 3529aea157
43 changed files with 140 additions and 142 deletions
+3 -2
View File
@@ -55,8 +55,9 @@ ZLIB = $(OBJDIR)/libz.a
LIBS = -I$(LUALIBPATH) -I$(MBEDTLSLIBPATH) -I$(JANSSONLIBPATH) -I$(CBORLIBPATH) -I$(ZLIBPATH) -I$(REVENGPATH) -I$(AMIIBOLIBPATH) -I$(HARDNESTEDPATH) -I$(CLIPARSERPATH)
INCLUDES_CLIENT += -I./src -I../include -I../common -I../common_fpga $(LIBS)
CFLAGS ?= -Wall -Werror -O3
#CFLAGS ?= -Wall -Werror -O3 -Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Wredundant-decls -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wmissing-declarations
#CFLAGS ?= -Wall -Werror -O3
CFLAGS ?= -Wall -Werror -O3 -Wchar-subscripts -Wundef -Wcast-align -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wstrict-prototypes -Wnested-externs -Wmissing-declarations
# -Wshadow -Wmissing-prototypes -Wredundant-decls
# -Wbad-function-cast -Wextra -Wswitch-enum -Wold-style-definition
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
+1 -1
View File
@@ -15,7 +15,7 @@
static char *self;
void amiitool_usage() {
void amiitool_usage(void) {
fprintf(stderr,
/*"amiitool build %i (commit %s-%08x)\n"*/
"by Marcos Del Sol Vives <marcos@dracon.es>\n"
+1 -1
View File
@@ -143,7 +143,7 @@ int CLIParserParseStringEx(const char *str, void *vargtable[], size_t vargtableL
return CLIParserParseArg(argc, argv, vargtable, vargtableLen, allowEmptyExec);
}
void CLIParserFree() {
void CLIParserFree(void) {
arg_freetable(argtable, argtableLen);
argtable = NULL;
+4 -4
View File
@@ -13,7 +13,7 @@
#include "fileutils.h"
#include "pm3_cmd.h"
int openAIDFile(json_t **root, bool verbose) {
static int openAIDFile(json_t **root, bool verbose) {
json_error_t error;
char *path;
@@ -42,7 +42,7 @@ out:
return retval;
}
int closeAIDFile(json_t *root) {
static int closeAIDFile(json_t *root) {
json_decref(root);
return PM3_SUCCESS;
@@ -71,7 +71,7 @@ int AIDSearchFree(json_t *root) {
return closeAIDFile(root);
}
const char *jsonStrGet(json_t *data, char *name) {
static const char *jsonStrGet(json_t *data, const char *name) {
json_t *jstr;
jstr = json_object_get(data, name);
@@ -88,7 +88,7 @@ const char *jsonStrGet(json_t *data, char *name) {
return cstr;
}
bool aidCompare(const char *aidlarge, const char *aidsmall) {
static bool aidCompare(const char *aidlarge, const char *aidsmall) {
if (strcmp(aidlarge, aidsmall) == 0)
return true;
+1 -1
View File
@@ -23,6 +23,6 @@ int PrintAIDDescriptionBuf(json_t *root, uint8_t *aid, size_t aidlen, bool verbo
json_t *AIDSearchInit(bool verbose);
json_t *AIDSearchGetElm(json_t *root, int elmindx);
bool AIDGetFromElm(json_t *data, uint8_t *aid, size_t aidmaxlen, int *aidlen);
int AIDSearchFree();
int AIDSearchFree(json_t *root);
#endif
+3 -3
View File
@@ -44,7 +44,7 @@
static int CmdHelp(const char *Cmd);
static int usage_hf_search() {
static int usage_hf_search(void) {
PrintAndLogEx(NORMAL, "Usage: hf search");
PrintAndLogEx(NORMAL, "Will try to find a HF read out of the unknown tag. Stops when found.");
PrintAndLogEx(NORMAL, "Options:");
@@ -53,7 +53,7 @@ static int usage_hf_search() {
return PM3_SUCCESS;
}
static int usage_hf_sniff() {
static int usage_hf_sniff(void) {
PrintAndLogEx(NORMAL, "The high frequence sniffer will assign all available memory on device for sniffed data");
PrintAndLogEx(NORMAL, "Use " _YELLOW_("'data samples'")" command to download from device, and " _YELLOW_("'data plot'")" to look at it");
PrintAndLogEx(NORMAL, "Press button to quit the sniffing.\n");
@@ -69,7 +69,7 @@ static int usage_hf_sniff() {
return PM3_SUCCESS;
}
static int usage_hf_tune() {
static int usage_hf_tune(void) {
PrintAndLogEx(NORMAL, "Continuously measure HF antenna tuning.");
PrintAndLogEx(NORMAL, "Press button or Enter to interrupt.");
PrintAndLogEx(NORMAL, "Usage: hf tune [h] [<iter>]");
+2 -2
View File
@@ -1261,7 +1261,7 @@ typedef enum {
} nxp_mifare_type_t;
// According to NXP AN10833 Rev 3.6 MIFARE Type Identification, Table 6
int detect_nxp_card(uint8_t sak, uint16_t atqa) {
static int detect_nxp_card(uint8_t sak, uint16_t atqa) {
int type = MTNONE;
if (sak == 0x00) {
@@ -1355,7 +1355,7 @@ const uidname uidmap[] = {
{0x00, 0x00, "None"}
};
void getTagLabel(uint8_t uid0, uint8_t uid1) {
static void getTagLabel(uint8_t uid0, uint8_t uid1) {
int i = 0;
while (uidmap[i].uid0 != 0x00) {
if ((uidmap[i].uid0 == uid0) && (uidmap[i].uid1 == uid1)) {
+1 -1
View File
@@ -684,7 +684,7 @@ static bool HF14B_Std_Reader(bool verbose) {
}
// test for other 14b type tags (mimic another reader - don't have tags to identify)
static bool HF14B_Other_Reader() {
static bool HF14B_Other_Reader(void) {
// uint8_t data[] = {0x00, 0x0b, 0x3f, 0x80};
// uint8_t datalen = 4;
+15 -15
View File
@@ -123,7 +123,7 @@ static int usage_hf_felica_request_response(void) {
return PM3_SUCCESS;
}
static void print_status_flag1_interpretation() {
static void print_status_flag1_interpretation(void) {
PrintAndLogEx(NORMAL, "\nStatus Flag1:");
PrintAndLogEx(NORMAL, " - 00h : Indicates the successful completion of a command.");
PrintAndLogEx(NORMAL, " - FFh : If an error occurs during the processing of a command that includes no list in the command packet, or if "
@@ -133,7 +133,7 @@ static void print_status_flag1_interpretation() {
"indicating the location of the error.");
}
static void print_status_flag2_interpration() {
static void print_status_flag2_interpration(void) {
PrintAndLogEx(NORMAL, "\nStatus Flag2:");
PrintAndLogEx(NORMAL, " - 00h : Indicates the successful completion of a command.");
PrintAndLogEx(NORMAL, " - 01h : The calculated result is either less than zero when the purse data is decremented, or exceeds 4"
@@ -167,7 +167,7 @@ static void print_status_flag2_interpration() {
PrintAndLogEx(NORMAL, " - C2h : Command is disabled already: This is the error that occurs in issuance commands.");
}
static void print_block_list_element_constraints() {
static void print_block_list_element_constraints(void) {
PrintAndLogEx(NORMAL, " - Each Block List Element shall satisfy the following conditions:");
PrintAndLogEx(NORMAL, " - The value of Service Code List Order shall not exceed Number of Service.");
PrintAndLogEx(NORMAL, " - Access Mode shall be 000b.");
@@ -177,22 +177,22 @@ static void print_block_list_element_constraints() {
PrintAndLogEx(NORMAL, " - Block Number shall be in the range of the number of Blocks assigned to the specified Service.");
}
static void print_number_of_service_constraints() {
static void print_number_of_service_constraints(void) {
PrintAndLogEx(NORMAL, " - Number of Service: shall be a positive integer in the range of 1 to 16, inclusive.");
}
static void print_number_of_block_constraints() {
static void print_number_of_block_constraints(void) {
PrintAndLogEx(NORMAL, " - Number of Block: shall be less than or equal to the maximum number of Blocks that can be read simultaneously. "
"The maximum number of Blocks that can be read simultaneously can differ, depending on the product being used. Use as default 01");
}
static void print_service_code_list_constraints() {
static void print_service_code_list_constraints(void) {
PrintAndLogEx(NORMAL, " - Service Code List: For Service Code List, only Service Code existing in the product shall be specified:");
PrintAndLogEx(NORMAL, " - Even when Service Code exists in the product, Service Code not referenced from Block List shall not be specified to Service Code List.");
PrintAndLogEx(NORMAL, " - For existence or nonexistence of Service in a product, please check using the Request Service (or Request Service v2) command.");
}
static int usage_hf_felica_read_without_encryption() {
static int usage_hf_felica_read_without_encryption(void) {
PrintAndLogEx(NORMAL, "\nInfo: Use this command to read Block Data from authentication-not-required Service.");
PrintAndLogEx(NORMAL, " - Mode shall be Mode0.");
print_number_of_service_constraints();
@@ -215,7 +215,7 @@ static int usage_hf_felica_read_without_encryption() {
return PM3_SUCCESS;
}
static int usage_hf_felica_write_without_encryption() {
static int usage_hf_felica_write_without_encryption(void) {
PrintAndLogEx(NORMAL, "\nInfo: Use this command to write Block Data to authentication-not-required Service.");
PrintAndLogEx(NORMAL, " - Mode shall be Mode0.");
print_number_of_service_constraints();
@@ -234,7 +234,7 @@ static int usage_hf_felica_write_without_encryption() {
return PM3_SUCCESS;
}
static int usage_hf_felica_request_system_code() {
static int usage_hf_felica_request_system_code(void) {
PrintAndLogEx(NORMAL, "\nInfo: Use this command to acquire System Code registered to the card.");
PrintAndLogEx(NORMAL, " - If a card is divided into more than one System, this command acquires System Code of each System existing in the card.");
PrintAndLogEx(NORMAL, "\nUsage: hf felica rqsyscode [-h] [-i]");
@@ -246,7 +246,7 @@ static int usage_hf_felica_request_system_code() {
return PM3_SUCCESS;
}
static int usage_hf_felica_reset_mode() {
static int usage_hf_felica_reset_mode(void) {
PrintAndLogEx(NORMAL, "\nInfo: Use this command to reset Mode to Mode 0.");
print_status_flag1_interpretation();
print_status_flag2_interpration();
@@ -261,7 +261,7 @@ static int usage_hf_felica_reset_mode() {
return PM3_SUCCESS;
}
static int usage_hf_felica_request_specification_version() {
static int usage_hf_felica_request_specification_version(void) {
PrintAndLogEx(NORMAL, "\nInfo: Use this command to acquire the version of card OS.");
PrintAndLogEx(NORMAL, " - Response:");
PrintAndLogEx(NORMAL, " - Format Version: Fixed value 00h. Provided only if Status Flag1 = 00h.");
@@ -283,7 +283,7 @@ static int usage_hf_felica_request_specification_version() {
return PM3_SUCCESS;
}
static int usage_hf_felica_authentication1() {
static int usage_hf_felica_authentication1(void) {
PrintAndLogEx(NORMAL, "\nInfo: Initiate mutual authentication. This command must always be executed before Authentication2 command"
", and mutual authentication is achieve only after Authentication2 command has succeeded.");
PrintAndLogEx(NORMAL, " - Auth1 Parameters:");
@@ -311,7 +311,7 @@ static int usage_hf_felica_authentication1() {
return PM3_SUCCESS;
}
static int usage_hf_felica_authentication2() {
static int usage_hf_felica_authentication2(void) {
PrintAndLogEx(NORMAL, "\nInfo: Complete mutual authentication. This command can only be executed subsquent to Authentication1"
" command.");
PrintAndLogEx(NORMAL, " - Auth2 Parameters:");
@@ -551,7 +551,7 @@ static bool check_last_idm(uint8_t *data, uint16_t datalen) {
* @param wr_noCry_resp frame in which the response will be saved.
* @return success if response was received.
*/
int send_wr_unencrypted(uint8_t flags, uint16_t datalen, uint8_t *data, bool verbose, felica_status_response_t *wr_noCry_resp) {
static int send_wr_unencrypted(uint8_t flags, uint16_t datalen, uint8_t *data, bool verbose, felica_status_response_t *wr_noCry_resp) {
clear_and_send_command(flags, datalen, data, verbose);
PacketResponseNG resp;
if (!waitCmdFelica(0, &resp, verbose)) {
@@ -1464,7 +1464,7 @@ static int CmdHFFelicaSimLite(const char *Cmd) {
return PM3_SUCCESS;
}
static void printSep() {
static void printSep(void) {
PrintAndLogEx(INFO, "------------------------------------------------------------------------------------");
}
+1 -1
View File
@@ -191,7 +191,7 @@ static int usage_hf_iclass_readblock(void) {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_hf_iclass_readtagfile() {
static int usage_hf_iclass_readtagfile(void) {
PrintAndLogEx(NORMAL, "Print a iClass tag-dump file\n");
PrintAndLogEx(NORMAL, "Usage: hf iClass readtagfile [f <filename>] [s <startblock>] [e <endblock>] [v]\n");
PrintAndLogEx(NORMAL, "Options:");
+1 -1
View File
@@ -37,7 +37,7 @@ enum MifareAuthSeq {
static enum MifareAuthSeq MifareAuthState;
static TAuthData AuthData;
void ClearAuthData() {
void ClearAuthData(void) {
AuthData.uid = 0;
AuthData.nt = 0;
AuthData.first_auth = true;
+2 -2
View File
@@ -3132,7 +3132,7 @@ out:
sector_t *k_sector = NULL;
uint8_t k_sectorsCount = 40;
void showSectorTable() {
void showSectorTable(void) {
if (k_sector != NULL) {
printKeyTable(k_sectorsCount, k_sector);
free(k_sector);
@@ -4806,7 +4806,7 @@ static int CmdHFMFNDEF(const char *Cmd) {
return PM3_SUCCESS;
}
int CmdHFMFPersonalize(const char *cmd) {
static int CmdHFMFPersonalize(const char *cmd) {
CLIParserInit("hf mf personalize",
"Personalize the UID of a Mifare Classic EV1 card. This is only possible if it is a 7Byte UID card and if it is not already personalized.",
+2 -2
View File
@@ -1302,7 +1302,7 @@ static void simulate_MFplus_RNG(uint32_t test_cuid, uint64_t test_key, uint32_t
}
static void simulate_acquire_nonces() {
static void simulate_acquire_nonces(void) {
time_t time1 = time(NULL);
last_sample_clock = 0;
sample_period = 1000; // for simulation
@@ -2108,7 +2108,7 @@ static uint16_t SumProperty(struct Crypto1State *s) {
return (sum_odd * (16 - sum_even) + (16 - sum_odd) * sum_even);
}
static void Tests() {
static void Tests(void) {
if (known_target_key == -1)
return;
+2 -2
View File
@@ -949,7 +949,7 @@ static int CmdHFMFPWrbl(const char *Cmd) {
#define AES_KEY_LEN 16
#define MAX_KEYS_LIST_LEN 1024
int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyAB, uint8_t endKeyAB,
static int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyAB, uint8_t endKeyAB,
uint8_t keyList[MAX_KEYS_LIST_LEN][AES_KEY_LEN], size_t keyListLen, uint8_t foundKeys[2][64][AES_KEY_LEN + 1],
bool verbose) {
int res;
@@ -1027,7 +1027,7 @@ int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyAB, uint
return PM3_SUCCESS;
}
void Fill2bPattern(uint8_t keyList[MAX_KEYS_LIST_LEN][AES_KEY_LEN], size_t *keyListLen, uint32_t *startPattern) {
static void Fill2bPattern(uint8_t keyList[MAX_KEYS_LIST_LEN][AES_KEY_LEN], size_t *keyListLen, uint32_t *startPattern) {
for (uint32_t pt = *startPattern; pt < 0x10000; pt++) {
keyList[*keyListLen][0] = (pt >> 8) & 0xff;
keyList[*keyListLen][1] = pt & 0xff;
+2 -2
View File
@@ -855,7 +855,7 @@ static int ulev1_print_configuration(uint32_t tagtype, uint8_t *data, uint8_t st
return PM3_SUCCESS;
}
static int ulev1_print_counters() {
static int ulev1_print_counters(void) {
PrintAndLogEx(INFO, "--- " _CYAN_("Tag Counters"));
uint8_t tear[1] = {0};
uint8_t counter[3] = {0, 0, 0};
@@ -1004,7 +1004,7 @@ static int ulc_magic_test(){
return returnValue;
}
*/
static int ul_magic_test() {
static int ul_magic_test(void) {
// Magic Ultralight tests
// 1) take present UID, and try to write it back. OBSOLETE
// 2) make a wrong length write to page0, and see if tag answers with ACK/NACK:
+1 -1
View File
@@ -670,7 +670,7 @@ int CmdLFSniff(const char *Cmd) {
return PM3_SUCCESS;
}
static void ChkBitstream() {
static void ChkBitstream(void) {
// convert to bitstream if necessary
for (int i = 0; i < (int)(GraphTraceLen / 2); i++) {
if (GraphBuffer[i] > 1 || GraphBuffer[i] < 0) {
+6 -6
View File
@@ -1055,7 +1055,7 @@ static int CmdEM4x50Dump(const char *Cmd) {
#define EM_PREAMBLE_LEN 6
// download samples from device and copy to Graphbuffer
static bool downloadSamplesEM() {
static bool downloadSamplesEM(void) {
// 8 bit preamble + 32 bit word response (max clock (128) * 40bits = 5120 samples)
uint8_t got[6000];
@@ -1097,7 +1097,7 @@ static bool doPreambleSearch(size_t *startIdx) {
return true;
}
static bool detectFSK() {
static bool detectFSK(void) {
// detect fsk clock
if (GetFskClock("", false) == 0) {
PrintAndLogEx(DEBUG, "DEBUG: Error - EM: FSK clock failed");
@@ -1112,7 +1112,7 @@ static bool detectFSK() {
return true;
}
// PSK clocks should be easy to detect ( but difficult to demod a non-repeating pattern... )
static bool detectPSK() {
static bool detectPSK(void) {
int ans = GetPskClock("", false);
if (ans <= 0) {
PrintAndLogEx(DEBUG, "DEBUG: Error - EM: PSK clock failed");
@@ -1136,7 +1136,7 @@ static bool detectPSK() {
return true;
}
// try manchester - NOTE: ST only applies to T55x7 tags.
static bool detectASK_MAN() {
static bool detectASK_MAN(void) {
bool stcheck = false;
if (ASKDemod_ext("0 0 0", false, false, 1, &stcheck) != PM3_SUCCESS) {
PrintAndLogEx(DEBUG, "DEBUG: Error - EM: ASK/Manchester Demod failed");
@@ -1145,7 +1145,7 @@ static bool detectASK_MAN() {
return true;
}
static bool detectASK_BI() {
static bool detectASK_BI(void) {
int ans = ASKbiphaseDemod("0 0 1", false);
if (ans != PM3_SUCCESS) {
PrintAndLogEx(DEBUG, "DEBUG: Error - EM: ASK/biphase normal demod failed");
@@ -1158,7 +1158,7 @@ static bool detectASK_BI() {
}
return true;
}
static bool detectNRZ() {
static bool detectNRZ(void) {
int ans = NRZrawDemod("0 0 1", false);
if (ans != PM3_SUCCESS) {
PrintAndLogEx(DEBUG, "DEBUG: Error - EM: NRZ normal demod failed");
+1 -1
View File
@@ -22,7 +22,7 @@
static int CmdHelp(const char *Cmd);
static char *getHitagTypeStr(uint32_t uid) {
static const char *getHitagTypeStr(uint32_t uid) {
//uid s/n ********
uint8_t type = (uid >> 4) & 0xF;
switch (type) {
+5 -5
View File
@@ -32,7 +32,7 @@ struct pcf7931_config configPcf = {
};
// Resets the configuration settings to default values.
int pcf7931_resetConfig() {
int pcf7931_resetConfig(void) {
memset(configPcf.Pwd, 0xFF, sizeof(configPcf.Pwd));
configPcf.InitDelay = PCF7931_DEFAULT_INITDELAY;
configPcf.OffsetWidth = PCF7931_DEFAULT_OFFSET_WIDTH;
@@ -40,7 +40,7 @@ int pcf7931_resetConfig() {
return PM3_SUCCESS;
}
int pcf7931_printConfig() {
int pcf7931_printConfig(void) {
PrintAndLogEx(NORMAL, "Password (LSB first on bytes) : %s", sprint_hex(configPcf.Pwd, sizeof(configPcf.Pwd)));
PrintAndLogEx(NORMAL, "Tag initialization delay : %d us", configPcf.InitDelay);
PrintAndLogEx(NORMAL, "Offset low pulses width : %d us", configPcf.OffsetWidth);
@@ -48,7 +48,7 @@ int pcf7931_printConfig() {
return PM3_SUCCESS;
}
static int usage_pcf7931_read() {
static int usage_pcf7931_read(void) {
PrintAndLogEx(NORMAL, "Usage: lf pcf7931 read [h] ");
PrintAndLogEx(NORMAL, "This command tries to read a PCF7931 tag.");
PrintAndLogEx(NORMAL, "Options:");
@@ -58,7 +58,7 @@ static int usage_pcf7931_read() {
return PM3_SUCCESS;
}
static int usage_pcf7931_write() {
static int usage_pcf7931_write(void) {
PrintAndLogEx(NORMAL, "Usage: lf pcf7931 write [h] <block address> <byte address> <data>");
PrintAndLogEx(NORMAL, "This command tries to write a PCF7931 tag.");
PrintAndLogEx(NORMAL, "Options:");
@@ -71,7 +71,7 @@ static int usage_pcf7931_write() {
return PM3_SUCCESS;
}
static int usage_pcf7931_config() {
static int usage_pcf7931_config(void) {
PrintAndLogEx(NORMAL, "Usage: lf pcf7931 config [h] [r] <pwd> <delay> <offset width> <offset position>");
PrintAndLogEx(NORMAL, "This command tries to set the configuration used with PCF7931 commands");
PrintAndLogEx(NORMAL, "The time offsets could be useful to correct slew rate generated by the antenna");
+23 -23
View File
@@ -57,7 +57,7 @@ t55xx_conf_block_t config = {
t55xx_memory_item_t cardmem[T55x7_BLOCK_COUNT] = {{0}};
t55xx_conf_block_t Get_t55xx_Config() {
t55xx_conf_block_t Get_t55xx_Config(void) {
return config;
}
@@ -78,7 +78,7 @@ static void print_usage_t55xx_downloadlink(uint8_t ShowAll, uint8_t dl_mode_defa
PrintAndLogEx(NORMAL, " 4 - Try all downlink modes%s", (dl_mode_default == 4) ? " (default)" : "");
}
static int usage_t55xx_config() {
static int usage_t55xx_config(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx config [c <blk0>] [d <demodulation>] [i [0/1]] [o <offset>] [Q5 [0/1]] [ST [0/1]]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " h - This help");
@@ -99,7 +99,7 @@ static int usage_t55xx_config() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_read() {
static int usage_t55xx_read(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx read [r <mode>] b <block> [p <password>] [o] <page1>");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " b <block> - block number to read. Between 0-7");
@@ -119,7 +119,7 @@ static int usage_t55xx_read() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_resetread() {
static int usage_t55xx_resetread(void) {
PrintAndLogEx(NORMAL, "Send Reset Cmd then lf read the stream to attempt to identify the start of it (needs a demod and/or plot after)");
PrintAndLogEx(NORMAL, "Usage: lf t55xx resetread [r <mode>]");
PrintAndLogEx(NORMAL, "Options:");
@@ -130,7 +130,7 @@ static int usage_t55xx_resetread() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_write() {
static int usage_t55xx_write(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx write [r <mode>] b <block> d <data> [p <password>] [1] [t] [v]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " b <block> - block number to write. Between 0-7");
@@ -148,7 +148,7 @@ static int usage_t55xx_write() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_trace() {
static int usage_t55xx_trace(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx trace [1] [r mode]");
PrintAndLogEx(NORMAL, "Options:");
print_usage_t55xx_downloadlink(T55XX_DLMODE_SINGLE, config.downlink_mode);
@@ -160,7 +160,7 @@ static int usage_t55xx_trace() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_info() {
static int usage_t55xx_info(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx info [1] [r <mode>] [c <blk0> [q]]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " (default) - read data from tag.");
@@ -180,7 +180,7 @@ static int usage_t55xx_info() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_dump() {
static int usage_t55xx_dump(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx dump [r <mode>] [p <password> [o]]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " p <password> - OPTIONAL password 4bytes (8 hex symbols)");
@@ -194,7 +194,7 @@ static int usage_t55xx_dump() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_restore() {
static int usage_t55xx_restore(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx restore f <filename> [p password]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " f <filename> - filename of the dump file (.bin/.eml)");
@@ -208,7 +208,7 @@ static int usage_t55xx_restore() {
return PM3_SUCCESS;
}
static int usage_t55xx_detect() {
static int usage_t55xx_detect(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx detect [1] [r <mode>] [p <password>]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " 1 - if set, use Graphbuffer otherwise read data from tag.");
@@ -222,7 +222,7 @@ static int usage_t55xx_detect() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_detectP1() {
static int usage_t55xx_detectP1(void) {
PrintAndLogEx(NORMAL, "Command: Detect Page 1 of a t55xx chip");
PrintAndLogEx(NORMAL, "Usage: lf t55xx p1detect [1] [r <mode>] [p <password>]");
PrintAndLogEx(NORMAL, "Options:");
@@ -237,7 +237,7 @@ static int usage_t55xx_detectP1() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_wakup() {
static int usage_t55xx_wakup(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx wakeup [h] [r <mode>] p <password>");
PrintAndLogEx(NORMAL, "This commands sends the Answer-On-Request command and leaves the readerfield ON afterwards.");
PrintAndLogEx(NORMAL, "Options:");
@@ -249,7 +249,7 @@ static int usage_t55xx_wakup() {
PrintAndLogEx(NORMAL, " lf t55xx wakeup p 11223344 - send wakeup password");
return PM3_SUCCESS;
}
static int usage_t55xx_chk() {
static int usage_t55xx_chk(void) {
PrintAndLogEx(NORMAL, "This command uses a dictionary attack");
PrintAndLogEx(NORMAL, "press " _YELLOW_("'enter'") " to cancel the command");
PrintAndLogEx(NORMAL, _RED_("WARNING:") " this may brick non-password protected chips!");
@@ -267,7 +267,7 @@ static int usage_t55xx_chk() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_bruteforce() {
static int usage_t55xx_bruteforce(void) {
PrintAndLogEx(NORMAL, "This command uses bruteforce to scan a number range");
PrintAndLogEx(NORMAL, "press " _YELLOW_("'enter'") " to cancel the command");
PrintAndLogEx(NORMAL, _RED_("WARNING:") " this may brick non-password protected chips!");
@@ -285,7 +285,7 @@ static int usage_t55xx_bruteforce() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_recoverpw() {
static int usage_t55xx_recoverpw(void) {
PrintAndLogEx(NORMAL, "This command uses a few tricks to try to recover mangled password");
PrintAndLogEx(NORMAL, "press " _YELLOW_("'enter'") " to cancel the command");
PrintAndLogEx(NORMAL, _RED_("WARNING:") " this may brick non-password protected chips!");
@@ -306,7 +306,7 @@ static int usage_t55xx_recoverpw() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_wipe() {
static int usage_t55xx_wipe(void) {
PrintAndLogEx(NORMAL, "Usage: lf t55xx wipe [h] [Q5] [p <password>] [c <blk0>]");
PrintAndLogEx(NORMAL, "This commands wipes a tag, fills blocks 1-7 with zeros and a default configuration block");
PrintAndLogEx(NORMAL, "Options:");
@@ -319,7 +319,7 @@ static int usage_t55xx_wipe() {
PrintAndLogEx(NORMAL, " lf t55xx wipe q - wipes a T5555 ( Q5 ) tag, config block 0x6001F004");
return PM3_SUCCESS;
}
static int usage_t55xx_deviceconfig() {
static int usage_t55xx_deviceconfig(void) {
PrintAndLogEx(NORMAL, "Sets t55x7 timings for direct commands. The timings are set here in Field Clocks (FC), \nwhich is converted to (US) on device");
PrintAndLogEx(NORMAL, "Usage: lf t55xx deviceconfig [r <mode>] a <gap> b <gap> c <gap> d <gap> e <gap> f <gap> g <gap> [p]");
PrintAndLogEx(NORMAL, "Options:");
@@ -340,7 +340,7 @@ static int usage_t55xx_deviceconfig() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_protect() {
static int usage_t55xx_protect(void) {
PrintAndLogEx(NORMAL, "This command sets the pwd bit on T5577.");
PrintAndLogEx(NORMAL, _RED_("WARNING:") " this locks the tag!");
PrintAndLogEx(NORMAL, "Usage: lf t55xx protect [r <mode>] [p <password>] [o] [n <new_password>]");
@@ -356,7 +356,7 @@ static int usage_t55xx_protect() {
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}
static int usage_t55xx_dangerraw() {
static int usage_t55xx_dangerraw(void) {
PrintAndLogEx(NORMAL, "This command allows to emit arbitrary raw commands on T5577 and cut the field after arbitrary duration.");
PrintAndLogEx(NORMAL, _RED_("WARNING:") " this may lock definitively the tag in an unusable state!");
PrintAndLogEx(NORMAL, "Uncontrolled usage can easily write an invalid configuration, activate lock bits,");
@@ -372,7 +372,7 @@ static int usage_t55xx_dangerraw() {
return PM3_SUCCESS;
}
static int usage_t55xx_clonehelp() {
static int usage_t55xx_clonehelp(void) {
PrintAndLogEx(NORMAL, "For cloning specific techs on T55xx tags, see commands available in corresponding LF sub-menus, e.g.:");
PrintAndLogEx(NORMAL, _GREEN_("lf awid clone"));
// todo: rename to clone
@@ -408,13 +408,13 @@ static int CmdT55xxCloneHelp(const char *Cmd) {
return usage_t55xx_clonehelp();
}
void T55x7_SaveBlockData(uint8_t idx, uint32_t data) {
static void T55x7_SaveBlockData(uint8_t idx, uint32_t data) {
if (idx < T55x7_BLOCK_COUNT) {
cardmem[idx].valid = true;
cardmem[idx].blockdata = data;
}
}
void T55x7_ClearAllBlockData(void) {
static void T55x7_ClearAllBlockData(void) {
for (uint8_t idx = 0; idx < T55x7_BLOCK_COUNT; idx++) {
cardmem[idx].valid = false;
cardmem[idx].blockdata = 0x00;
@@ -1011,7 +1011,7 @@ static int SanityOfflineCheck(bool useGraphBuffer) {
return PM3_SUCCESS;
}
void T55xx_Print_DownlinkMode(uint8_t downlink_mode) {
static void T55xx_Print_DownlinkMode(uint8_t downlink_mode) {
char msg[80];
sprintf(msg, "Downlink Mode used : ");

Some files were not shown because too many files have changed in this diff Show More