From 3d6d58aae5688d58a4b42e8fcb6b167dbec35c0c Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 10 Apr 2019 13:06:05 +0200 Subject: [PATCH] internal help fcts -> static --- client/cmdanalyse.c | 10 +- client/cmdanalyse.h | 7 - client/cmddata.c | 36 ++-- client/cmdflashmem.c | 12 +- client/cmdhf.c | 4 +- client/cmdhf.h | 2 - client/cmdhf14a.c | 10 +- client/cmdhf14a.h | 4 - client/cmdhf14b.c | 16 +- client/cmdhf14b.h | 8 - client/cmdhf15.c | 26 +-- client/cmdhf15.h | 16 -- client/cmdhffelica.c | 10 +- client/cmdhffelica.h | 4 - client/cmdhficlass.c | 36 ++-- client/cmdhflegic.c | 22 +-- client/cmdhflegic.h | 10 -- client/cmdhfmf.c | 54 +++--- client/cmdhfmfu.c | 366 ++++++++++++++++++++-------------------- client/cmdhfmfu.h | 12 -- client/cmdlf.c | 16 +- client/cmdlf.h | 8 - client/cmdlfawid.c | 8 +- client/cmdlfawid.h | 5 - client/cmdlfcotag.c | 2 +- client/cmdlfcotag.h | 1 - client/cmdlfem4x.c | 26 +-- client/cmdlfem4x.h | 15 -- client/cmdlffdx.c | 4 +- client/cmdlffdx.h | 4 - client/cmdlfguard.c | 4 +- client/cmdlfguard.h | 2 - client/cmdlfhid.c | 10 +- client/cmdlfhid.h | 6 - client/cmdlfhitag.c | 14 +- client/cmdlfindala.c | 6 +- client/cmdlfindala.h | 3 - client/cmdlfio.c | 6 +- client/cmdlfio.h | 3 - client/cmdlfjablotron.c | 4 +- client/cmdlfjablotron.h | 5 - client/cmdlfkeri.c | 4 +- client/cmdlfkeri.h | 2 - client/cmdlfnedap.c | 4 +- client/cmdlfnedap.h | 3 - client/cmdlfnoralsy.c | 4 +- client/cmdlfnoralsy.h | 4 - client/cmdlfparadox.c | 2 +- client/cmdlfpcf7931.c | 6 +- client/cmdlfpcf7931.h | 4 - client/cmdlfpresco.c | 4 +- client/cmdlfpresco.h | 2 - client/cmdlfpyramid.c | 4 +- client/cmdlfpyramid.h | 3 - client/cmdlft55xx.c | 28 +-- client/cmdlfviking.c | 4 +- client/cmdlfviking.h | 2 - client/cmdlfvisa2000.c | 4 +- client/cmdlfvisa2000.h | 4 - client/cmdsmartcard.c | 12 +- client/cmdsmartcard.h | 4 - client/cmdtrace.c | 6 +- client/cmdtrace.h | 4 - 63 files changed, 392 insertions(+), 539 deletions(-) diff --git a/client/cmdanalyse.c b/client/cmdanalyse.c index 3cb6c5b47..9ba84636e 100644 --- a/client/cmdanalyse.c +++ b/client/cmdanalyse.c @@ -11,7 +11,7 @@ static int CmdHelp(const char *Cmd); -int usage_analyse_lcr(void) { +static int usage_analyse_lcr(void) { PrintAndLogEx(NORMAL, "Specifying the bytes of a UID with a known LRC will find the last byte value"); PrintAndLogEx(NORMAL, "needed to generate that LRC with a rolling XOR. All bytes should be specified in HEX."); PrintAndLogEx(NORMAL, ""); @@ -25,7 +25,7 @@ int usage_analyse_lcr(void) { PrintAndLogEx(NORMAL, "expected output: Target (BA) requires final LRC XOR byte value: 5A"); return 0; } -int usage_analyse_checksum(void) { +static int usage_analyse_checksum(void) { PrintAndLogEx(NORMAL, "The bytes will be added with eachother and than limited with the applied mask"); PrintAndLogEx(NORMAL, "Finally compute ones' complement of the least significant bytes"); PrintAndLogEx(NORMAL, ""); @@ -41,7 +41,7 @@ int usage_analyse_checksum(void) { PrintAndLogEx(NORMAL, "expected output: 0x61"); return 0; } -int usage_analyse_crc(void) { +static int usage_analyse_crc(void) { PrintAndLogEx(NORMAL, "A stub method to test different crc implementations inside the PM3 sourcecode. Just because you figured out the poly, doesn't mean you get the desired output"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Usage: analyse crc [h] "); @@ -53,7 +53,7 @@ int usage_analyse_crc(void) { PrintAndLogEx(NORMAL, " analyse crc 137AF00A0A0D"); return 0; } -int usage_analyse_nuid(void) { +static int usage_analyse_nuid(void) { PrintAndLogEx(NORMAL, "Generate 4byte NUID from 7byte UID"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Usage: analyse hid [h] "); @@ -65,7 +65,7 @@ int usage_analyse_nuid(void) { PrintAndLogEx(NORMAL, " analyse nuid 11223344556677"); return 0; } -int usage_analyse_a(void) { +static int usage_analyse_a(void) { PrintAndLogEx(NORMAL, "Iceman's personal garbage test command"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Usage: analyse a [h] d "); diff --git a/client/cmdanalyse.h b/client/cmdanalyse.h index 131fe0d11..4c5c486e6 100644 --- a/client/cmdanalyse.h +++ b/client/cmdanalyse.h @@ -26,13 +26,6 @@ #include "mifare/mfkey.h" // nonce2key #include "util_posix.h" // msclock - -int usage_analyse_lcr(void); -int usage_analyse_checksum(void); -int usage_analyse_crc(void); -int usage_analyse_hid(void); -int usage_analyse_nuid(void); - int CmdAnalyse(const char *Cmd); int CmdAnalyseLCR(const char *Cmd); int CmdAnalyseCHKSUM(const char *Cmd); diff --git a/client/cmddata.c b/client/cmddata.c index ac9e3aebc..9beb7f6e2 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -17,7 +17,7 @@ int g_DemodClock = 0; static int CmdHelp(const char *Cmd); -int usage_data_printdemodbuf(void) { +static int usage_data_printdemodbuf(void) { PrintAndLogEx(NORMAL, "Usage: data printdemodbuffer x o l "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h This help"); @@ -26,7 +26,7 @@ int usage_data_printdemodbuf(void) { PrintAndLogEx(NORMAL, " l enter length to print in # of bits or hex characters respectively"); return 0; } -int usage_data_manrawdecode(void) { +static int usage_data_manrawdecode(void) { PrintAndLogEx(NORMAL, "Usage: data manrawdecode [invert] [maxErr]"); PrintAndLogEx(NORMAL, " Takes 10 and 01 and converts to 0 and 1 respectively"); PrintAndLogEx(NORMAL, " --must have binary sequence in demodbuffer (run data askrawdemod first)"); @@ -36,7 +36,7 @@ int usage_data_manrawdecode(void) { PrintAndLogEx(NORMAL, " Example: data manrawdecode = decode manchester bitstream from the demodbuffer"); return 0; } -int usage_data_biphaserawdecode(void) { +static int usage_data_biphaserawdecode(void) { PrintAndLogEx(NORMAL, "Usage: data biphaserawdecode [offset] [invert] [maxErr]"); PrintAndLogEx(NORMAL, " Converts 10 or 01 to 1 and 11 or 00 to 0"); PrintAndLogEx(NORMAL, " --must have binary sequence in demodbuffer (run data askrawdemod first)"); @@ -50,7 +50,7 @@ int usage_data_biphaserawdecode(void) { PrintAndLogEx(NORMAL, " Example: data biphaserawdecode 1 1 = decode biphase bitstream from the demodbuffer, set offset, and invert output"); return 0; } -int usage_data_rawdemod(void) { +static int usage_data_rawdemod(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod [modulation] |"); PrintAndLogEx(NORMAL, " [modulation] as 2 char, 'ab' for ask/biphase, 'am' for ask/manchester, 'ar' for ask/raw, 'fs' for fsk, ..."); PrintAndLogEx(NORMAL, " 'nr' for nrz/direct, 'p1' for psk1, 'p2' for psk2"); @@ -67,7 +67,7 @@ int usage_data_rawdemod(void) { PrintAndLogEx(NORMAL, " : data rawdemod p2 = demod GraphBuffer using: psk2 - autodetect"); return 0; } -int usage_data_rawdemod_am(void) { +static int usage_data_rawdemod_am(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod am [clock] [maxError] [maxLen] [amplify]"); PrintAndLogEx(NORMAL, " ['s'] optional, check for Sequence Terminator"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, if not set, autodetect"); @@ -83,7 +83,7 @@ int usage_data_rawdemod_am(void) { PrintAndLogEx(NORMAL, " : data rawdemod am 64 1 0 = demod an ask/manchester tag from GraphBuffer using a clock of RF/64, inverting data and allowing 0 demod errors"); return 0; } -int usage_data_rawdemod_ab(void) { +static int usage_data_rawdemod_ab(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod ab [offset] [clock] [maxError] [maxLen] "); PrintAndLogEx(NORMAL, " [offset], offset to begin biphase, default=0"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, if not set, autodetect"); @@ -106,7 +106,7 @@ int usage_data_rawdemod_ab(void) { PrintAndLogEx(NORMAL, " : data rawdemod ab 0 64 1 0 0 a = demod an ask/biph tag from GraphBuffer using a clock of RF/64, inverting data and allowing 0 demod errors, and amp"); return 0; } -int usage_data_rawdemod_ar(void) { +static int usage_data_rawdemod_ar(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod ar [clock] [maxError] [maxLen] [amplify]"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, if not set, autodetect"); PrintAndLogEx(NORMAL, " , 1 to invert output"); @@ -123,7 +123,7 @@ int usage_data_rawdemod_ar(void) { PrintAndLogEx(NORMAL, " : data rawdemod ar 64 1 0 0 a = demod an ask tag from GraphBuffer using a clock of RF/64, inverting data and allowing 0 demod errors, and amp"); return 0; } -int usage_data_rawdemod_fs(void) { +static int usage_data_rawdemod_fs(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod fs [clock] [fchigh] [fclow]"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, omit for autodetect."); PrintAndLogEx(NORMAL, " , 1 for invert output, can be used even if the clock is omitted"); @@ -139,7 +139,7 @@ int usage_data_rawdemod_fs(void) { PrintAndLogEx(NORMAL, " : data rawdemod fs 50 1 10 8 = demod an fsk2a RF/50 tag from GraphBuffer"); return 0; } -int usage_data_rawdemod_nr(void) { +static int usage_data_rawdemod_nr(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod nr [clock] <0|1> [maxError]"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, if not set, autodetect."); PrintAndLogEx(NORMAL, " , 1 for invert output"); @@ -152,7 +152,7 @@ int usage_data_rawdemod_nr(void) { PrintAndLogEx(NORMAL, " : data rawdemod nr 64 1 0 = demod a nrz/direct tag from GraphBuffer using a clock of RF/64, inverting data and allowing 0 demod errors"); return 0; } -int usage_data_rawdemod_p1(void) { +static int usage_data_rawdemod_p1(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod p1 [clock] <0|1> [maxError]"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, if not set, autodetect."); PrintAndLogEx(NORMAL, " , 1 for invert output"); @@ -165,7 +165,7 @@ int usage_data_rawdemod_p1(void) { PrintAndLogEx(NORMAL, " : data rawdemod p1 64 1 0 = demod a psk1 tag from GraphBuffer using a clock of RF/64, inverting data and allowing 0 demod errors"); return 0; } -int usage_data_rawdemod_p2(void) { +static int usage_data_rawdemod_p2(void) { PrintAndLogEx(NORMAL, "Usage: data rawdemod p2 [clock] <0|1> [maxError]"); PrintAndLogEx(NORMAL, " [set clock as integer] optional, if not set, autodetect."); PrintAndLogEx(NORMAL, " , 1 for invert output"); @@ -178,7 +178,7 @@ int usage_data_rawdemod_p2(void) { PrintAndLogEx(NORMAL, " : data rawdemod p2 64 1 0 = demod a psk2 tag from GraphBuffer using a clock of RF/64, inverting output and allowing 0 demod errors"); return 0; } -int usage_data_autocorr(void) { +static int usage_data_autocorr(void) { PrintAndLogEx(NORMAL, "Autocorrelate is used to detect repeating sequences. We use it as detection of length in bits a message inside the signal is"); PrintAndLogEx(NORMAL, "Usage: data autocorr w [g]"); PrintAndLogEx(NORMAL, "Options:"); @@ -187,7 +187,7 @@ int usage_data_autocorr(void) { PrintAndLogEx(NORMAL, " g save back to GraphBuffer (overwrite)"); return 0; } -int usage_data_undecimate(void) { +static int usage_data_undecimate(void) { PrintAndLogEx(NORMAL, "Usage: data undec [factor]"); PrintAndLogEx(NORMAL, "This function performs un-decimation, by repeating each sample N times"); PrintAndLogEx(NORMAL, "Options:"); @@ -196,7 +196,7 @@ int usage_data_undecimate(void) { PrintAndLogEx(NORMAL, "Example: 'data undec 3'"); return 0; } -int usage_data_detectclock(void) { +static int usage_data_detectclock(void) { PrintAndLogEx(NORMAL, "Usage: data detectclock [modulation] "); PrintAndLogEx(NORMAL, " [modulation as char], specify the modulation type you want to detect the clock of"); PrintAndLogEx(NORMAL, " , specify the clock (optional - to get best start position only)"); @@ -208,24 +208,24 @@ int usage_data_detectclock(void) { PrintAndLogEx(NORMAL, " data detectclock n = detect the clock of an nrz/direct modulated wave in the GraphBuffer"); return 0; } -int usage_data_hex2bin(void) { +static int usage_data_hex2bin(void) { PrintAndLogEx(NORMAL, "Usage: data hex2bin "); PrintAndLogEx(NORMAL, " This function will ignore all non-hexadecimal characters (but stop reading on whitespace)"); return 0; } -int usage_data_bin2hex(void) { +static int usage_data_bin2hex(void) { PrintAndLogEx(NORMAL, "Usage: data bin2hex "); PrintAndLogEx(NORMAL, " This function will ignore all characters not 1 or 0 (but stop reading on whitespace)"); return 0; } -int usage_data_buffclear(void) { +static int usage_data_buffclear(void) { PrintAndLogEx(NORMAL, "This function clears the bigbuff on deviceside"); PrintAndLogEx(NORMAL, "Usage: data buffclear [h]"); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h This help"); return 0; } -int usage_data_fsktonrz() { +static int usage_data_fsktonrz() { PrintAndLogEx(NORMAL, "Usage: data fsktonrz c l f "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h This help"); diff --git a/client/cmdflashmem.c b/client/cmdflashmem.c index 33804c1f0..311d07ed3 100644 --- a/client/cmdflashmem.c +++ b/client/cmdflashmem.c @@ -26,7 +26,7 @@ static int CmdHelp(const char *Cmd); -int usage_flashmem_spibaud(void) { +static int usage_flashmem_spibaud(void) { PrintAndLogEx(NORMAL, "Usage: mem spibaud [h] "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h this help"); @@ -40,7 +40,7 @@ int usage_flashmem_spibaud(void) { return 0; } -int usage_flashmem_read(void) { +static int usage_flashmem_read(void) { PrintAndLogEx(NORMAL, "Read flash memory on device"); PrintAndLogEx(NORMAL, "Usage: mem read o l "); PrintAndLogEx(NORMAL, " o : offset in memory"); @@ -51,7 +51,7 @@ int usage_flashmem_read(void) { PrintAndLogEx(NORMAL, " mem read o 1024 l 10"); // read 10 bytes starting at offset 1024 return 0; } -int usage_flashmem_load(void) { +static int usage_flashmem_load(void) { PrintAndLogEx(NORMAL, "Loads binary file into flash memory on device"); PrintAndLogEx(NORMAL, "Usage: mem load o f m t i"); PrintAndLogEx(NORMAL, " o : offset in memory"); @@ -68,7 +68,7 @@ int usage_flashmem_load(void) { PrintAndLogEx(NORMAL, " mem load f default_iclass_keys i"); return 0; } -int usage_flashmem_save(void) { +static int usage_flashmem_save(void) { PrintAndLogEx(NORMAL, "Saves flash memory on device into the file"); PrintAndLogEx(NORMAL, " Usage: mem save o l f "); PrintAndLogEx(NORMAL, " o : offset in memory"); @@ -81,7 +81,7 @@ int usage_flashmem_save(void) { PrintAndLogEx(NORMAL, " mem save f myfile o 1024 l 4096"); // downlowd 4096 bytes from offset 1024 to file myfile return 0; } -int usage_flashmem_wipe(void) { +static int usage_flashmem_wipe(void) { PrintAndLogEx(WARNING, "[OBS] use with caution."); PrintAndLogEx(NORMAL, "Wipe flash memory on device, which fills memory with 0xFF\n"); @@ -95,7 +95,7 @@ int usage_flashmem_wipe(void) { PrintAndLogEx(NORMAL, " mem wipe p 0"); // wipes first page. return 0; } -int usage_flashmem_info(void) { +static int usage_flashmem_info(void) { PrintAndLogEx(NORMAL, "Collect signature and verify it from flash memory\n"); PrintAndLogEx(NORMAL, " Usage: mem info [h|s|w]"); PrintAndLogEx(NORMAL, " s : create a signature"); diff --git a/client/cmdhf.c b/client/cmdhf.c index fd61925a5..d7a3ccce3 100644 --- a/client/cmdhf.c +++ b/client/cmdhf.c @@ -12,7 +12,7 @@ static int CmdHelp(const char *Cmd); -int usage_hf_search() { +static int usage_hf_search() { 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:"); @@ -20,7 +20,7 @@ int usage_hf_search() { PrintAndLogEx(NORMAL, ""); return 0; } -int usage_hf_sniff() { +static int usage_hf_sniff() { 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"); diff --git a/client/cmdhf.h b/client/cmdhf.h index 9db6795ac..4540caf3d 100644 --- a/client/cmdhf.h +++ b/client/cmdhf.h @@ -38,6 +38,4 @@ int CmdHFTune(const char *Cmd); int CmdHFSearch(const char *Cmd); int CmdHFSniff(const char *Cmd); -int usage_hf_search(void); -int usage_hf_sniff(void); #endif diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 757a9820e..570ecec83 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -153,7 +153,7 @@ const char *getTagInfo(uint8_t uid) { static uint16_t frameLength = 0; uint16_t atsFSC[] = {16, 24, 32, 40, 48, 64, 96, 128, 256}; -int usage_hf_14a_sim(void) { +static int usage_hf_14a_sim(void) { // PrintAndLogEx(NORMAL, "\n Emulating ISO/IEC 14443 type A tag with 4,7 or 10 byte UID\n"); PrintAndLogEx(NORMAL, "\n Emulating ISO/IEC 14443 type A tag with 4,7 byte UID\n"); PrintAndLogEx(NORMAL, "Usage: hf 14a sim [h] t u [x] [e] [v]"); @@ -180,7 +180,7 @@ int usage_hf_14a_sim(void) { // PrintAndLogEx(NORMAL, " hf 14a sim t 1 u 11223445566778899AA\n"); return 0; } -int usage_hf_14a_sniff(void) { +static int usage_hf_14a_sniff(void) { PrintAndLogEx(NORMAL, "It get data from the field and saves it into command buffer."); PrintAndLogEx(NORMAL, "Buffer accessible from command 'hf list 14a'"); PrintAndLogEx(NORMAL, "Usage: hf 14a sniff [c][r]"); @@ -190,7 +190,7 @@ int usage_hf_14a_sniff(void) { PrintAndLogEx(NORMAL, " hf 14a sniff c r"); return 0; } -int usage_hf_14a_raw(void) { +static int usage_hf_14a_raw(void) { PrintAndLogEx(NORMAL, "Usage: hf 14a raw [-h] [-r] [-c] [-p] [-a] [-T] [-t] [-b] <0A 0B 0C ... hex>"); PrintAndLogEx(NORMAL, " -h this help"); PrintAndLogEx(NORMAL, " -r do not read response"); @@ -204,7 +204,7 @@ int usage_hf_14a_raw(void) { PrintAndLogEx(NORMAL, " -3 ISO14443-3 select only (skip RATS)"); return 0; } -int usage_hf_14a_reader(void) { +static int usage_hf_14a_reader(void) { PrintAndLogEx(NORMAL, "Usage: hf 14a reader [k|s|x] [3]"); PrintAndLogEx(NORMAL, " k keep the field active after command executed"); PrintAndLogEx(NORMAL, " s silent (no messages)"); @@ -212,7 +212,7 @@ int usage_hf_14a_reader(void) { PrintAndLogEx(NORMAL, " 3 ISO14443-3 select only (skip RATS)"); return 0; } -int usage_hf_14a_info(void) { +static int usage_hf_14a_info(void) { PrintAndLogEx(NORMAL, "This command makes more extensive tests against a ISO14443a tag in order to collect information"); PrintAndLogEx(NORMAL, "Usage: hf 14a info [h|s]"); PrintAndLogEx(NORMAL, " s silent (no messages)"); diff --git a/client/cmdhf14a.h b/client/cmdhf14a.h index cababc217..ad0860bf1 100644 --- a/client/cmdhf14a.h +++ b/client/cmdhf14a.h @@ -53,8 +53,4 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card); int ExchangeAPDU14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen); int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen); -int usage_hf_14a_sim(void); -int usage_hf_14a_sniff(void); -int usage_hf_14a_raw(void); -int usage_hf_14a_antifuzz(void); #endif diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index 7405db431..60722b849 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -14,7 +14,7 @@ #define TIMEOUT 2000 static int CmdHelp(const char *Cmd); -int usage_hf_14b_info(void) { +static int usage_hf_14b_info(void) { PrintAndLogEx(NORMAL, "Usage: hf 14b info [h] [s]"); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h this help"); @@ -23,7 +23,7 @@ int usage_hf_14b_info(void) { PrintAndLogEx(NORMAL, " hf 14b info"); return 0; } -int usage_hf_14b_reader(void) { +static int usage_hf_14b_reader(void) { PrintAndLogEx(NORMAL, "Usage: hf 14b reader [h] [s]"); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h this help"); @@ -32,7 +32,7 @@ int usage_hf_14b_reader(void) { PrintAndLogEx(NORMAL, " hf 14b reader"); return 0; } -int usage_hf_14b_raw(void) { +static int usage_hf_14b_raw(void) { PrintAndLogEx(NORMAL, "Usage: hf 14b raw [-h] [-r] [-c] [-p] [-s / -ss] [-t] <0A 0B 0C ... hex>"); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " -h this help"); @@ -46,7 +46,7 @@ int usage_hf_14b_raw(void) { PrintAndLogEx(NORMAL, " hf 14b raw -s -c -p 0200a40400"); return 0; } -int usage_hf_14b_sniff(void) { +static int usage_hf_14b_sniff(void) { PrintAndLogEx(NORMAL, "It get data from the field and saves it into command buffer."); PrintAndLogEx(NORMAL, "Buffer accessible from command 'hf list 14b'"); PrintAndLogEx(NORMAL, "Usage: hf 14b sniff [h]"); @@ -56,7 +56,7 @@ int usage_hf_14b_sniff(void) { PrintAndLogEx(NORMAL, " hf 14b sniff"); return 0; } -int usage_hf_14b_sim(void) { +static int usage_hf_14b_sim(void) { PrintAndLogEx(NORMAL, "Emulating ISO/IEC 14443 type B tag with 4 UID / PUPI"); PrintAndLogEx(NORMAL, "Usage: hf 14b sim [h] u "); PrintAndLogEx(NORMAL, "Options:"); @@ -67,7 +67,7 @@ int usage_hf_14b_sim(void) { PrintAndLogEx(NORMAL, " hf 14b sim u 11223344"); return 0; } -int usage_hf_14b_read_srx(void) { +static int usage_hf_14b_read_srx(void) { PrintAndLogEx(NORMAL, "Usage: hf 14b sriread [h] <1|2>"); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h this help"); @@ -77,7 +77,7 @@ int usage_hf_14b_read_srx(void) { PrintAndLogEx(NORMAL, " hf 14b sriread 2"); return 0; } -int usage_hf_14b_write_srx(void) { +static int usage_hf_14b_write_srx(void) { PrintAndLogEx(NORMAL, "Usage: hf 14b [h] sriwrite <1|2> "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h this help"); @@ -91,7 +91,7 @@ int usage_hf_14b_write_srx(void) { PrintAndLogEx(NORMAL, " hf 14b sriwrite 2 FF 11223344"); return 0; } -int usage_hf_14b_dump(void) { +static int usage_hf_14b_dump(void) { PrintAndLogEx(NORMAL, "This command dumps the contents of a ISO-14443-B tag and save it to file\n" "\n" "Usage: hf 14b dump [h] [card memory] \n" diff --git a/client/cmdhf14b.h b/client/cmdhf14b.h index f2d78778c..675e7d947 100644 --- a/client/cmdhf14b.h +++ b/client/cmdhf14b.h @@ -29,14 +29,6 @@ #include "mifare.h" // structs/enum for ISO14B #include "protocols.h" // definitions of ISO14B protocol -int usage_hf_14b_info(void); -int usage_hf_14b_reader(void); -int usage_hf_14b_raw(void); -int usage_hf_14b_sniff(void); -int usage_hf_14b_sim(void); -int usage_hf_14b_read_srx(void); -int usage_hf_14b_write_srx(void); - int CmdHF14B(const char *Cmd); int CmdHF14BList(const char *Cmd); int CmdHF14BInfo(const char *Cmd); diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 1b3baa000..649fb8dc6 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -284,17 +284,17 @@ static const char *TagErrorStr(uint8_t error) { } } -int usage_15_demod(void) { +static int usage_15_demod(void) { PrintAndLogEx(NORMAL, "Tries to demodulate / decode ISO15693, from downloaded samples.\n" "Gather samples with 'hf 15 read' / 'hf 15 record'"); return 0; } -int usage_15_samples(void) { +static int usage_15_samples(void) { PrintAndLogEx(NORMAL, "Acquire samples as Reader (enables carrier, send inquiry\n" "and download it to graphbuffer. Try 'hf 15 demod' to try to demodulate/decode signal"); return 0; } -int usage_15_info(void) { +static int usage_15_info(void) { PrintAndLogEx(NORMAL, "Uses the optional command 'get_systeminfo' 0x2B to try and extract information\n" "command may fail, depending on tag.\n" "defaults to '1 out of 4' mode\n" @@ -310,11 +310,11 @@ int usage_15_info(void) { "\thf 15 info u"); return 0; } -int usage_15_record(void) { +static int usage_15_record(void) { PrintAndLogEx(NORMAL, "Record activity without enableing carrier"); return 0; } -int usage_15_reader(void) { +static int usage_15_reader(void) { PrintAndLogEx(NORMAL, "This command identifies a ISO 15693 tag\n" "\n" "Usage: hf 15 reader [h]\n" @@ -325,18 +325,18 @@ int usage_15_reader(void) { "\thf 15 reader"); return 0; } -int usage_15_sim(void) { +static int usage_15_sim(void) { PrintAndLogEx(NORMAL, "Usage: hf 15 sim \n" "\n" "Example:\n" "\thf 15 sim E016240000000000"); return 0; } -int usage_15_findafi(void) { +static int usage_15_findafi(void) { PrintAndLogEx(NORMAL, "'hf 15 finafi' This command needs a helptext. Feel free to add one!"); return 0; } -int usage_15_dump(void) { +static int usage_15_dump(void) { PrintAndLogEx(NORMAL, "This command dumps the contents of a ISO-15693 tag and save it to file\n" "\n" "Usage: hf 15 dump [h] \n" @@ -349,7 +349,7 @@ int usage_15_dump(void) { "\thf 15 dump f mydump"); return 0; } -int usage_15_restore(void) { +static int usage_15_restore(void) { const char *options[][2] = { {"h", "this help"}, {"-2", "use slower '1 out of 256' mode"}, @@ -363,7 +363,7 @@ int usage_15_restore(void) { PrintAndLogOptions(options, 7, 3); return 0; } -int usage_15_raw(void) { +static int usage_15_raw(void) { const char *options[][2] = { {"-r", "do not read response" }, {"-2", "use slower '1 out of 256' mode" }, @@ -374,7 +374,7 @@ int usage_15_raw(void) { PrintAndLogOptions(options, 4, 3); return 0; } -int usage_15_read(void) { +static int usage_15_read(void) { PrintAndLogEx(NORMAL, "Usage: hf 15 read [options] \n" "Options:\n" "\t-2 use slower '1 out of 256' mode\n" @@ -385,7 +385,7 @@ int usage_15_read(void) { "\tpage#: page number 0-255"); return 0; } -int usage_15_write(void) { +static int usage_15_write(void) { PrintAndLogEx(NORMAL, "Usage: hf 15 write [options] \n" "Options:\n" "\t-2 use slower '1 out of 256' mode\n" @@ -398,7 +398,7 @@ int usage_15_write(void) { "\thexdata: data to be written eg AA BB CC DD"); return 0; } -int usage_15_readmulti(void) { +static int usage_15_readmulti(void) { PrintAndLogEx(NORMAL, "Usage: hf 15 readmulti [options] \n" "Options:\n" "\t-2 use slower '1 out of 256' mode\n" diff --git a/client/cmdhf15.h b/client/cmdhf15.h index 5a3753100..e9ae7939b 100644 --- a/client/cmdhf15.h +++ b/client/cmdhf15.h @@ -45,21 +45,5 @@ int CmdHF15Write(const char *Cmd); int CmdHF15Help(const char *Cmd); -// usages -int usage_15_demod(void); -int usage_15_samples(void); -int usage_15_info(void); -int usage_15_record(void); -int usage_15_reader(void); -int usage_15_sim(void); -int usage_15_findafi(void); -int usage_15_dump(void); -int usage_15_restore(void); -int usage_15_raw(void); - -int usage_15_read(void); -int usage_15_write(void); -int usage_15_readmulti(void); - int prepareHF15Cmd(char **cmd, UsbCommand *c, uint8_t iso15cmd); #endif diff --git a/client/cmdhffelica.c b/client/cmdhffelica.c index 3f2e36971..d641e39e0 100644 --- a/client/cmdhffelica.c +++ b/client/cmdhffelica.c @@ -11,7 +11,7 @@ static int CmdHelp(const char *Cmd); -int usage_hf_felica_sim(void) { +static int usage_hf_felica_sim(void) { PrintAndLogEx(NORMAL, "\n Emulating ISO/18092 FeliCa tag \n"); PrintAndLogEx(NORMAL, "Usage: hf felica sim [h] t [v]"); PrintAndLogEx(NORMAL, "Options:"); @@ -23,7 +23,7 @@ int usage_hf_felica_sim(void) { PrintAndLogEx(NORMAL, " hf felica sim t 1 "); return 0; } -int usage_hf_felica_sniff(void) { +static int usage_hf_felica_sniff(void) { PrintAndLogEx(NORMAL, "It get data from the field and saves it into command buffer."); PrintAndLogEx(NORMAL, "Buffer accessible from command 'hf list felica'"); PrintAndLogEx(NORMAL, "Usage: hf felica sniff "); @@ -33,7 +33,7 @@ int usage_hf_felica_sniff(void) { PrintAndLogEx(NORMAL, " hf felica sniff s 1000"); return 0; } -int usage_hf_felica_simlite(void) { +static int usage_hf_felica_simlite(void) { PrintAndLogEx(NORMAL, "\n Emulating ISO/18092 FeliCa Lite tag \n"); PrintAndLogEx(NORMAL, "Usage: hf felica litesim [h] u "); PrintAndLogEx(NORMAL, "Options:"); @@ -43,7 +43,7 @@ int usage_hf_felica_simlite(void) { PrintAndLogEx(NORMAL, " hf felica litesim 11223344556677"); return 0; } -int usage_hf_felica_dumplite(void) { +static int usage_hf_felica_dumplite(void) { PrintAndLogEx(NORMAL, "\n Dump ISO/18092 FeliCa Lite tag \n"); PrintAndLogEx(NORMAL, "press button to abort run, otherwise it will loop for 200sec."); PrintAndLogEx(NORMAL, "Usage: hf felica litedump [h]"); @@ -53,7 +53,7 @@ int usage_hf_felica_dumplite(void) { PrintAndLogEx(NORMAL, " hf felica litedump"); return 0; } -int usage_hf_felica_raw(void) { +static int usage_hf_felica_raw(void) { PrintAndLogEx(NORMAL, "Usage: hf felica raw [-h] [-r] [-c] [-p] [-a] <0A 0B 0C ... hex>"); PrintAndLogEx(NORMAL, " -h this help"); PrintAndLogEx(NORMAL, " -r do not read response"); diff --git a/client/cmdhffelica.h b/client/cmdhffelica.h index 9dfd78b0b..0b22762e0 100644 --- a/client/cmdhffelica.h +++ b/client/cmdhffelica.h @@ -32,10 +32,6 @@ int CmdHFFelicaSim(const char *Cmd); int CmdHFFelicaSniff(const char *Cmd); int CmdHFFelicaCmdRaw(const char *Cmd); -int usage_hf_felica_sim(void); -int usage_hf_felica_sniff(void); -int usage_hf_fFelica_raw(void); - void waitCmdFelica(uint8_t iSelect); //temp diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index 6a2663d7f..f92bfb78d 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -29,7 +29,7 @@ static uint8_t iClass_Key_Table[ICLASS_KEYS_MAX][8] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; -int usage_hf_iclass_sim(void) { +static int usage_hf_iclass_sim(void) { PrintAndLogEx(NORMAL, "Usage: hf iclass sim