Merge branch 'master' into experimental_varlen2

* master: (33 commits)
  unified Proxmark3 text
  removed
  more colors
  rearranged banner output and messages
  textual
  revert
  revert
  revert
  style spaces
  fix fake com port
  style
  style
  styles
  not null?
  style
  style
  style
  style
  style
  style
  ...
This commit is contained in:
Philippe Teuwen
2019-04-16 20:58:58 +02:00
34 changed files with 148 additions and 177 deletions
@@ -21,4 +21,4 @@ Make a tarball
tar czvf proxmark3.tgz cov-int
```
Upload it to coverity.com
Upload it to scan.coverity.com
+7 -5
View File
@@ -292,19 +292,21 @@ test_script:
#proxmark logic tests
ExecTest "proxmark help" "proxmark3 -h" {bash -lc 'cd ~/client;./proxmark3 -h | grep -q Execute && echo Passed || echo Failed'}
ExecTest "proxmark help" "proxmark3 -h" {bash -lc 'cd ~/client;./proxmark3 -h | grep -q wait && echo Passed || echo Failed'}
ExecTest "proxmark help hardnested" "proxmark3 -h" {bash -lc 'cd ~/client;./proxmark3 -h | grep -q hardnested && echo Passed || echo Failed'}
ExecTest "proxmark help text ISO7816" "proxmark3 -t" {bash -lc 'cd ~/client;./proxmark3 -t 2>&1 | grep -q ISO7816 && echo Passed || echo Failed'}
ExecTest "proxmark help text hardnested" "proxmark3 -t" {bash -lc 'cd ~/client;./proxmark3 -t 2>&1 | grep -q hardnested && echo Passed || echo Failed'}
ExecTest "hf mf offline text" "hf mf" {bash -lc "cd ~/client;./proxmark3 comx -c 'hf mf'"} "at_enc"
ExecTest "hf mf offline text" "hf mf" {bash -lc "cd ~/client;./proxmark3 -c 'hf mf'"} "at_enc"
ExecTest "hf mf hardnested" "hf mf hardnested" {bash -lc "cd ~/client;./proxmark3 comx -c 'hf mf hardnested t 1 000000000000'"} "found:"
ExecTest "hf mf hardnested" "hf mf hardnested" {bash -lc "cd ~/client;./proxmark3 -c 'hf mf hardnested t 1 000000000000'"} "found:"
#proxmark crypto tests
ExecTest "emv test" "emv test" {bash -lc "cd ~/client;./proxmark3 comx -c 'emv test'"} "Tests ?OK"
ExecTest "emv test" "emv test" {bash -lc "cd ~/client;./proxmark3 -c 'emv test'"} "Test?s? ? OK"
if ($global:TestsPassed) {
+1
View File
@@ -376,6 +376,7 @@ void printUSBSpeed(void) {
uint32_t bytes_transferred = 0;
LED_B_ON();
while (end_time < start_time + USB_SPEED_TEST_MIN_TIME) {
cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, 0, USB_CMD_DATA_SIZE, 0, test_data, USB_CMD_DATA_SIZE);
end_time = GetTickCount();
+2 -2
View File
@@ -391,6 +391,7 @@ bool WaitForFelicaReply(uint16_t maxbytes) {
// clear RXRDY:
uint8_t b = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
(void)b;
uint32_t timeout = iso18092_get_timeout();
for (;;) {
@@ -481,7 +482,7 @@ void felica_sendraw(UsbCommand *c) {
felica_command_t param = c->arg[0];
size_t len = c->arg[1] & 0xffff;
uint8_t *cmd = c->d.asBytes;
uint32_t arg0 = 0;
uint32_t arg0;
felica_card_select_t card;
@@ -519,7 +520,6 @@ void felica_sendraw(UsbCommand *c) {
// Don't append crc on empty bytearray...
if (len > 0) {
AddCrc(buf, len);
len += 2;
}
}
+15 -15
View File
@@ -451,23 +451,23 @@ void FpgaWriteConfWord(uint8_t v) {
void SetAdcMuxFor(uint32_t whichGpio) {
#ifndef WITH_FPC
// When compiled without FPC support
AT91C_BASE_PIOA->PIO_OER =
GPIO_MUXSEL_HIPKD |
GPIO_MUXSEL_LOPKD |
GPIO_MUXSEL_LORAW |
GPIO_MUXSEL_HIRAW;
// When compiled without FPC support
AT91C_BASE_PIOA->PIO_OER =
GPIO_MUXSEL_HIPKD |
GPIO_MUXSEL_LOPKD |
GPIO_MUXSEL_LORAW |
GPIO_MUXSEL_HIRAW;
AT91C_BASE_PIOA->PIO_PER =
GPIO_MUXSEL_HIPKD |
GPIO_MUXSEL_LOPKD |
GPIO_MUXSEL_LORAW |
GPIO_MUXSEL_HIRAW;
AT91C_BASE_PIOA->PIO_PER =
GPIO_MUXSEL_HIPKD |
GPIO_MUXSEL_LOPKD |
GPIO_MUXSEL_LORAW |
GPIO_MUXSEL_HIRAW;
LOW(GPIO_MUXSEL_HIPKD);
LOW(GPIO_MUXSEL_LOPKD);
LOW(GPIO_MUXSEL_HIRAW);
LOW(GPIO_MUXSEL_LORAW);
LOW(GPIO_MUXSEL_HIPKD);
LOW(GPIO_MUXSEL_LOPKD);
LOW(GPIO_MUXSEL_HIRAW);
LOW(GPIO_MUXSEL_LORAW);
#else
// FPC serial uses HIRAW/LOWRAW pins, so they are excluded here.
+8 -13
View File
@@ -647,10 +647,10 @@ static void hitagS_handle_reader_command(uint8_t *rx, const size_t rxlen,
static int hitagS_handle_tag_auth(hitag_function htf, uint64_t key, uint64_t NrAr, uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t *txlen) {
uint8_t rx_air[HITAG_FRAME_LEN];
int response_bit[200];
int i, j, z, k;
int i, j, z;
unsigned char mask = 1;
unsigned char uid[32];
uint8_t uid1 = 0x00, uid2 = 0x00, uid3 = 0x00, uid4 = 0x00;
uint8_t uid1, uid2, uid3, uid4;
unsigned char crc;
uint64_t state;
uint8_t auth_ks[4];
@@ -673,7 +673,7 @@ static int hitagS_handle_tag_auth(hitag_function htf, uint64_t key, uint64_t NrA
z++;
}
}
k = 0;
uint16_t k = 0;
for (i = 5; i < z; i += 2) {
uid[k] = response_bit[i];
k++;
@@ -1749,22 +1749,17 @@ void WritePageHitagS(hitag_function htf, hitag_data *htd, int page) {
*/
void check_challenges(bool file_given, uint8_t *data) {
int i, j, z, k;
uint8_t uid_byte[4];
int frame_count = 0, response = 0;
uint8_t uid_byte[4];
uint8_t rx[HITAG_FRAME_LEN];
uint8_t unlocker[60][8];
int u1 = 0;
size_t rxlen = 0;
size_t rxlen = 0, txlen = 0;
uint8_t txbuf[HITAG_FRAME_LEN];
uint8_t *tx = txbuf;
size_t txlen = 0;
int lastbit;
bool bSkip;
int reset_sof;
int tag_sof;
uint8_t *tx;
int t_wait = HITAG_T_WAIT_MAX;
int STATE = 0;
bool bStop;
int lastbit, reset_sof, tag_sof, STATE = 0;;
bool bSkip, bStop;
int response_bit[200];
unsigned char mask = 1;
unsigned char uid[32];
+5 -5
View File
@@ -521,7 +521,7 @@ void RAMFUNC SniffIso14443a(uint8_t param) {
// triggered == false -- to wait first for card
bool triggered = !(param & 0x03);
uint32_t rsamples = 0;
uint32_t rx_samples = 0;
DbpString("Starting to sniff");
@@ -562,11 +562,11 @@ void RAMFUNC SniffIso14443a(uint8_t param) {
LED_A_OFF();
// Need two samples to feed Miller and Manchester-Decoder
if (rsamples & 0x01) {
if (rx_samples & 0x01) {
if (!TagIsActive) { // no need to try decoding reader data if the tag is sending
uint8_t readerdata = (previous_data & 0xF0) | (*data >> 4);
if (MillerDecoding(readerdata, (rsamples - 1) * 4)) {
if (MillerDecoding(readerdata, (rx_samples - 1) * 4)) {
LED_C_ON();
// check - if there is a short 7bit request from reader
@@ -593,7 +593,7 @@ void RAMFUNC SniffIso14443a(uint8_t param) {
// no need to try decoding tag data if the reader is sending - and we cannot afford the time
if (!ReaderIsActive) {
uint8_t tagdata = (previous_data << 4) | (*data & 0x0F);
if (ManchesterDecoding(tagdata, 0, (rsamples - 1) * 4)) {
if (ManchesterDecoding(tagdata, 0, (rx_samples - 1) * 4)) {
LED_B_ON();
if (!LogTrace(receivedResp,
@@ -617,7 +617,7 @@ void RAMFUNC SniffIso14443a(uint8_t param) {
}
previous_data = *data;
rsamples++;
rx_samples++;
data++;
if (data == dmaBuf + DMA_BUFFER_SIZE) {
data = dmaBuf;
+2 -3
View File
@@ -947,7 +947,6 @@ static RAMFUNC int Handle14443bTagSamplesDemod(int ci, int cq) {
static void GetTagSamplesFor14443bDemod() {
bool gotFrame, finished = false;
// int lastRxCounter = ISO14443B_DMA_BUFFER_SIZE;
int ci = 0, cq = 0;
uint32_t time_0 = 0, time_stop = 0;
BigBuf_free();
@@ -978,8 +977,8 @@ static void GetTagSamplesFor14443bDemod() {
WDT_HIT();
// LSB is a fpga signal bit.
ci = upTo[0];
cq = upTo[1];
int ci = upTo[0];
int cq = upTo[1];
upTo += 2;
// lastRxCounter -= 2;
+2 -3
View File
@@ -112,7 +112,7 @@ void opt_successor(const uint8_t *k, State *s, bool y, State *successor) {
void opt_suc(const uint8_t *k, State *s, uint8_t *in, uint8_t length, bool add32Zeroes) {
State x2;
int i;
uint8_t head = 0;
uint8_t head;
for (i = 0; i < length; i++) {
head = 1 & (in[i] >> 7);
opt_successor(k, s, head, &x2);
@@ -149,8 +149,7 @@ void opt_suc(const uint8_t *k, State *s, uint8_t *in, uint8_t length, bool add32
}
void opt_output(const uint8_t *k, State *s, uint8_t *buffer) {
uint8_t times = 0;
uint8_t bout = 0;
uint8_t bout, times = 0;
State temp = {0, 0, 0, 0};
for (; times < 4; times++) {
bout = 0;
+1 -1
View File
@@ -2552,7 +2552,7 @@ static int arg_rex_scanfn(struct arg_rex *parent, const char *argval) {
int errorcode = 0;
const TRexChar *error = NULL;
TRex *rex = NULL;
TRexBool is_match = TRex_False;
TRexBool is_match;
if (parent->count == parent->hdr.maxcount) {
/* maximum number of arguments exceeded */
+1 -6
View File
@@ -222,10 +222,7 @@ static uint16_t calcBSDchecksum4(uint8_t *bytes, uint8_t len, uint32_t mask) {
// measuring LFSR maximum length
static int CmdAnalyseLfsr(const char *Cmd) {
uint16_t start_state = 0; /* Any nonzero start state will work. */
uint16_t lfsr = start_state;
//uint32_t period = 0;
uint16_t lfsr; /* Any nonzero start state will work. */
uint8_t iv = param_get8ex(Cmd, 0, 0, 16);
uint8_t find = param_get8ex(Cmd, 1, 0, 16);
@@ -233,11 +230,9 @@ static int CmdAnalyseLfsr(const char *Cmd) {
PrintAndLogEx(NORMAL, " bit# | lfsr | ^0x40 | 0x%02X ^ lfsr \n", find);
for (uint8_t i = 0x01; i < 0x30; i += 1) {
//period = 0;
legic_prng_init(iv);
legic_prng_forward(i);
lfsr = legic_prng_get_bits(12);
PrintAndLogEx(NORMAL, " %02X | %03X | %03X | %03X \n", i, lfsr, 0x40 ^ lfsr, find ^ lfsr);
}
return 0;
+10 -9
View File
@@ -57,8 +57,6 @@ int GetModels(char *Models[], int *count, uint8_t *width) {
SETBMP();
int args = 0, psets, pass;
int Cnt = 0;
if (width[0] == 0) { //reveng -D
*count = mcount();
if (!*count) {
@@ -100,6 +98,8 @@ int GetModels(char *Models[], int *count, uint8_t *width) {
if (!ptst(qpoly))
rflags &= ~R_HAVEQ;
int pass;
/* if endianness not specified, try
* little-endian then big-endian.
* NB: crossed-endian algorithms will not be
@@ -108,7 +108,7 @@ int GetModels(char *Models[], int *count, uint8_t *width) {
/* scan against preset models */
if (~uflags & C_NOPCK) {
pass = 0;
Cnt = 0;
int Cnt = 0, psets;
do {
psets = mcount();
@@ -190,6 +190,7 @@ int GetModels(char *Models[], int *count, uint8_t *width) {
return 0;
}
pass = 0;
int args = 0;
do {
mptr = candmods = reveng(&model, qpoly, rflags, args, apolys);
if (mptr && plen(mptr->spoly)) {
@@ -233,7 +234,7 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res
static model_t model = MZERO;
int ibperhx = 8, obperhx = 8;
int rflags = 0; // search flags
// int rflags = 0; // search flags
int c;
poly_t apoly, crc;
@@ -255,17 +256,17 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res
PrintAndLogEx(WARNING, "no preset models available");
return 0;
}
rflags |= R_HAVEP | R_HAVEI | R_HAVERI | R_HAVERO | R_HAVEX;
// rflags |= R_HAVEP | R_HAVEI | R_HAVERI | R_HAVERO | R_HAVEX;
//set flags
switch (endian) {
case 'b': /* b big-endian (RefIn = false, RefOut = false ) */
model.flags &= ~P_REFIN;
rflags |= R_HAVERI;
//rflags |= R_HAVERI;
/* fall through: */
case 'B': /* B big-endian output (RefOut = false) */
model.flags &= ~P_REFOUT;
rflags |= R_HAVERO;
//rflags |= R_HAVERO;
mnovel(&model);
/* fall through: */
case 'r': /* r right-justified */
@@ -273,11 +274,11 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res
break;
case 'l': /* l little-endian input and output */
model.flags |= P_REFIN;
rflags |= R_HAVERI;
//rflags |= R_HAVERI;
/* fall through: */
case 'L': /* L little-endian output */
model.flags |= P_REFOUT;
rflags |= R_HAVERO;
//rflags |= R_HAVERO;
mnovel(&model);
/* fall through: */
case 't': /* t left-justified */
+2 -2
View File
@@ -1527,7 +1527,7 @@ int CmdTuneSamples(const char *Cmd) {
int timeout = 0;
PrintAndLogEx(INFO, "\nmeasuring antenna characteristics, please wait...");
PrintAndLogEx(INFO, "\nMeasuring antenna characteristics, please wait...");
UsbCommand c = {CMD_MEASURE_ANTENNA_TUNING, {0, 0, 0}, {{0}}};
clearCommandBuffer();
@@ -1538,7 +1538,7 @@ int CmdTuneSamples(const char *Cmd) {
printf(".");
fflush(stdout);
if (timeout > 7) {
PrintAndLogEx(WARNING, "\nno response from Proxmark. Aborting...");
PrintAndLogEx(WARNING, "\nNo response from Proxmark3. Aborting...");
return 1;
}
}
+4 -4
View File
@@ -531,7 +531,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
UsbCommand ca = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
SendCommand(&ca);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(ERR, "Proxmark connection timeout.");
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
return 1;
}
@@ -553,7 +553,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
memcpy(cr.d.asBytes, rats, 2);
SendCommand(&cr);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(ERR, "Proxmark connection timeout.");
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
return 1;
}
@@ -630,7 +630,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
UsbCommand ca = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
SendCommand(&ca);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(ERR, "Proxmark connection timeout.");
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
return 1;
}
@@ -652,7 +652,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
memcpy(cr.d.asBytes, rats, 2);
SendCommand(&cr);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(ERR, "Proxmark connection timeout.");
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
return 1;
}
+1 -1
View File
@@ -781,7 +781,7 @@ static int CmdHFFido2GetAssertion(const char *cmd) {
char fname[300] = {0};
CLIParserInit("hf fido assert",
"Execute a FIDO2 Get Assertion command. Needs json file with parameters. Sample file `fido2.json`. File can be placed in proxmark directory or in `proxmark/fido` directory.",
"Execute a FIDO2 Get Assertion command. Needs json file with parameters. Sample file " _YELLOW_("`fido2.json`") ". File can be placed in proxmark directory or in `proxmark/fido` directory.",
"Usage:\n\thf fido assert -> execute command default parameters file `fido2.json`\n"
"\thf fido assert test.json -l -> execute command with parameters file `text.json` and add to request CredentialId");
+1 -1
View File
@@ -1994,7 +1994,7 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
printf(".");
fflush(stdout);
if (timeout > 120) {
PrintAndLogEx(WARNING, "\nNo response from Proxmark. Aborting...");
PrintAndLogEx(WARNING, "\nNo response from Proxmark3. Aborting...");
goto out;
}
}
+10 -13
View File
@@ -605,10 +605,8 @@ static int CmdHF14AMfRdBl(const char *Cmd) {
static int CmdHF14AMfRdSc(const char *Cmd) {
int i;
uint8_t sectorNo = 0;
uint8_t keyType = 0;
uint8_t isOK, sectorNo = 0, keyType = 0;
uint8_t key[6] = {0, 0, 0, 0, 0, 0};
uint8_t isOK = 0;
uint8_t *data = NULL;
char cmdp = 0x00;
@@ -799,10 +797,9 @@ static int CmdHF14AMfDump(const char *Cmd) {
fclose(f);
PrintAndLogEx(INFO, "Reading sector access bits...");
uint8_t tries = 0;
uint8_t tries;
for (sectorNo = 0; sectorNo < numSectors; sectorNo++) {
for (tries = 0; tries < MIFARE_SECTOR_RETRY; tries++) {
@@ -1140,7 +1137,7 @@ static int CmdHF14AMfNested(const char *Cmd) {
int16_t isOK = mfnested(blockNo, keyType, key, trgBlockNo, trgKeyType, keyBlock, true);
switch (isOK) {
case -1 :
PrintAndLogEx(WARNING, "Error: No response from Proxmark.\n");
PrintAndLogEx(WARNING, "Error: No response from Proxmark3.\n");
break;
case -2 :
PrintAndLogEx(WARNING, "Button pressed. Aborted.\n");
@@ -1210,7 +1207,7 @@ static int CmdHF14AMfNested(const char *Cmd) {
int16_t isOK = mfnested(blockNo, keyType, key, FirstBlockOfSector(sectorNo), trgKeyType, keyBlock, calibrate);
switch (isOK) {
case -1 :
PrintAndLogEx(WARNING, "error: No response from Proxmark.\n");
PrintAndLogEx(WARNING, "error: No response from Proxmark3.\n");
break;
case -2 :
PrintAndLogEx(WARNING, "button pressed. Aborted.\n");
@@ -1500,7 +1497,7 @@ static int CmdHF14AMfNestedHard(const char *Cmd) {
if (isOK) {
switch (isOK) {
case 1 :
PrintAndLogEx(WARNING, "Error: No response from Proxmark.\n");
PrintAndLogEx(WARNING, "Error: No response from Proxmark3.\n");
break;
case 2 :
PrintAndLogEx(NORMAL, "Button pressed. Aborted.\n");
@@ -2286,7 +2283,7 @@ static int CmdHF14AMfSniff(const char *Cmd) {
PrintAndLogEx(NORMAL, "-------------------------------------------------------------------------\n");
PrintAndLogEx(NORMAL, "Executing mifare sniffing command. \n");
PrintAndLogEx(NORMAL, "Press the key on the proxmark3 device to abort both proxmark3 and client.\n");
PrintAndLogEx(NORMAL, "Press the key on the Proxmark3 device to abort both Proxmark3 and client.\n");
PrintAndLogEx(NORMAL, "Press the key on pc keyboard to abort the client.\n");
PrintAndLogEx(NORMAL, "-------------------------------------------------------------------------\n");
@@ -3542,7 +3539,7 @@ static command_t CommandTable[] = {
{"chk", CmdHF14AMfChk, 0, "Check keys"},
{"fchk", CmdHF14AMfChk_fast, 0, "Check keys fast, targets all keys on card"},
{"decrypt", CmdHf14AMfDecryptBytes, 1, "[nt] [ar_enc] [at_enc] [data] - to decrypt sniff or trace"},
{"-----------", CmdHelp, 1, ""},
{"-----------", CmdHelp, 0, ""},
{"dbg", CmdHF14AMfDbg, 0, "Set default debug mode"},
{"rdbl", CmdHF14AMfRdBl, 0, "Read MIFARE classic block"},
{"rdsc", CmdHF14AMfRdSc, 0, "Read MIFARE classic sector"},
@@ -3552,7 +3549,7 @@ static command_t CommandTable[] = {
{"setmod", CmdHf14AMfSetMod, 0, "Set MIFARE Classic EV1 load modulation strength"},
{"auth4", CmdHF14AMfAuth4, 0, "ISO14443-4 AES authentication"},
// {"sniff", CmdHF14AMfSniff, 0, "Sniff card-reader communication"},
{"-----------", CmdHelp, 1, ""},
{"-----------", CmdHelp, 0, ""},
{"sim", CmdHF14AMf1kSim, 0, "Simulate MIFARE card"},
{"eclr", CmdHF14AMfEClear, 0, "Clear simulator memory block"},
{"eget", CmdHF14AMfEGet, 0, "Get simulator memory block"},
@@ -3561,14 +3558,14 @@ static command_t CommandTable[] = {
{"esave", CmdHF14AMfESave, 0, "Save to file emul dump"},
{"ecfill", CmdHF14AMfECFill, 0, "Fill simulator memory with help of keys from simulator"},
{"ekeyprn", CmdHF14AMfEKeyPrn, 0, "Print keys from simulator memory"},
{"-----------", CmdHelp, 1, ""},
{"-----------", CmdHelp, 0, ""},
{"csetuid", CmdHF14AMfCSetUID, 0, "Set UID for magic Chinese card"},
{"csetblk", CmdHF14AMfCSetBlk, 0, "Write block - Magic Chinese card"},
{"cgetblk", CmdHF14AMfCGetBlk, 0, "Read block - Magic Chinese card"},
{"cgetsc", CmdHF14AMfCGetSc, 0, "Read sector - Magic Chinese card"},
{"cload", CmdHF14AMfCLoad, 0, "Load dump into magic Chinese card"},
{"csave", CmdHF14AMfCSave, 0, "Save dump from magic Chinese card into file or emulator"},
{"-----------", CmdHelp, 1, ""},
{"-----------", CmdHelp, 0, ""},
{"mad", CmdHF14AMfMAD, 0, "Checks and prints MAD"},
{"ndef", CmdHFMFNDEF, 0, "Prints NDEF records from card"},
+4 -4
View File
@@ -476,10 +476,10 @@ static command_t CommandTable[] = {
{"setlfdivisor", CmdSetDivisor, 0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},
{"setmux", CmdSetMux, 0, "<loraw|hiraw|lopkd|hipkd> -- Set the ADC mux to a specific value"},
{"tune", CmdTune, 0, "Measure antenna tuning"},
{"version", CmdVersion, 0, "Show version information about the connected Proxmark"},
{"status", CmdStatus, 0, "Show runtime status information about the connected Proxmark"},
{"ping", CmdPing, 0, "Test if the pm3 is responsive"},
{"pingng", CmdPingNG, 0, "Test if the pm3 is responsive"},
{"version", CmdVersion, 0, "Show version information about the connected Proxmark3"},
{"status", CmdStatus, 0, "Show runtime status information about the connected Proxmark3"},
{"ping", CmdPing, 0, "Test if the Proxmark3 is responding"},
{"pingng", CmdPingNG, 0, "Test if the Proxmark3 is responsive, using new frame format (experimental)"},
{NULL, NULL, 0, NULL}
};
+2 -2
View File
@@ -506,7 +506,7 @@ static bool DecodeT5555TraceBlock(void) {
// sanity check. Don't use proxmark if it is offline and you didn't specify useGraphbuf
static int SanityOfflineCheck(bool useGraphBuffer) {
if (!useGraphBuffer && IsOffline()) {
PrintAndLogEx(NORMAL, "Your proxmark3 device is offline. Specify [1] to use graphbuffer data instead");
PrintAndLogEx(WARNING, "Your proxmark3 device is offline. Specify [1] to use graphbuffer data instead");
return 0;
}
return 1;
@@ -1866,7 +1866,7 @@ static int CmdT55xxChkPwds(const char *Cmd) {
printf(".");
fflush(stdout);
if (timeout > 180) {
PrintAndLogEx(WARNING, "\nno response from Proxmark. Aborting...");
PrintAndLogEx(WARNING, "\nNo response from Proxmark3. Aborting...");
return 2;
}
}
+11 -13
View File
@@ -62,7 +62,7 @@ void SendCommand(UsbCommand *c) {
#endif
if (offline) {
PrintAndLogEx(NORMAL, "Sending bytes to proxmark failed - offline");
PrintAndLogEx(WARNING, "Sending bytes to Proxmark3 failed." _YELLOW_("offline") );
return;
}
@@ -258,7 +258,7 @@ bool hookUpPM3() {
ret = false;
offline = 1;
} else {
PrintAndLogEx(SUCCESS, "Proxmark reconnected\n");
PrintAndLogEx(SUCCESS, "Proxmark3 reconnected\n");
serial_port_name = ;
ret = true;
offline = 0;
@@ -325,13 +325,13 @@ __attribute__((force_align_arg_pointer))
if (txBufferNGLen) { // NG packet
if (!uart_send(sp, (uint8_t *) &txBufferNG, txBufferNGLen)) {
//counter_to_offline++;
PrintAndLogEx(WARNING, "sending bytes to proxmark failed");
PrintAndLogEx(WARNING, "sending bytes to Proxmark3 device" _RED_("failed") );
}
txBufferNGLen = 0;
} else {
if (!uart_send(sp, (uint8_t *) &txBuffer, sizeof(UsbCommand))) {
//counter_to_offline++;
PrintAndLogEx(WARNING, "sending bytes to proxmark failed");
PrintAndLogEx(WARNING, "sending bytes to Proxmark3 device" _RED_("failed") );
}
}
txBuffer_pending = false;
@@ -362,7 +362,7 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode,
PrintAndLogEx(INFO, "Using UART port " _YELLOW_("%s"), portname);
sp = uart_open(portname, speed);
} else {
PrintAndLogEx(SUCCESS, "Waiting for Proxmark to appear on " _YELLOW_("%s"), portname);
PrintAndLogEx(SUCCESS, "Waiting for Proxmark3 to appear on " _YELLOW_("%s"), portname);
fflush(stdout);
int openCount = 0;
do {
@@ -399,17 +399,16 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode,
}
}
// check if we can communicate with Pm3
int TestProxmark(void) {
// check if we can communicate with Pm3
clearCommandBuffer();
UsbCommand resp;
UsbCommand c = {CMD_PING, {0, 0, 0}, {{0}}};
SendCommand(&c);
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
PrintAndLogEx(INFO, "Ping successful, communicating with PM3 over %s.", resp.arg[0] == 1 ? "FPC" : "USB");
if (WaitForResponseTimeout(CMD_ACK, &resp, 5000)) {
PrintAndLogEx(INFO, "Communicating with PM3 over %s.", resp.arg[0] == 1 ? "FPC" : "USB");
return 1;
} else {
PrintAndLogEx(WARNING, _RED_("Ping failed"));
return 0;
}
}
@@ -417,7 +416,6 @@ int TestProxmark(void) {
void CloseProxmark(void) {
conn.run = false;
#ifdef __BIONIC__
if (USB_communication_thread != 0) {
pthread_join(USB_communication_thread, NULL);
@@ -478,8 +476,8 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand *response, size_t ms_timeo
if (msclock() - start_time > 3000 && show_warning) {
// 3 seconds elapsed (but this doesn't mean the timeout was exceeded)
PrintAndLogEx(NORMAL, "Waiting for a response from the proxmark...");
PrintAndLogEx(NORMAL, "You can cancel this operation by pressing the pm3 button");
PrintAndLogEx(INFO, "Waiting for a response from the proxmark3...");
PrintAndLogEx(INFO, "You can cancel this operation by pressing the pm3 button");
show_warning = false;
}
}
@@ -588,7 +586,7 @@ bool dl_it(uint8_t *dest, uint32_t bytes, uint32_t start_index, UsbCommand *resp
if (msclock() - start_time > 3000 && show_warning) {
// 3 seconds elapsed (but this doesn't mean the timeout was exceeded)
PrintAndLogEx(NORMAL, "Waiting for a response from the proxmark...");
PrintAndLogEx(NORMAL, "Waiting for a response from the Proxmark3...");
PrintAndLogEx(NORMAL, "You can cancel this operation by pressing the pm3 button");
show_warning = false;
}

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