mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
modified hw tune output layout
This commit is contained in:
parent
1101a26957
commit
78174588dd
4 changed files with 48 additions and 28 deletions
|
@ -1978,16 +1978,16 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
struct p *package = (struct p *)resp.data.asBytes;
|
||||
|
||||
if (package->v_lf125 > NON_VOLTAGE)
|
||||
PrintAndLogEx(SUCCESS, "LF antenna: %5.2f V - %.2f kHz", (package->v_lf125 * ANTENNA_ERROR) / 1000.0, LF_DIV2FREQ(LF_DIVISOR_125));
|
||||
PrintAndLogEx(SUCCESS, "At %.2f kHz .......... " _YELLOW_("%5.2f") " V", LF_DIV2FREQ(LF_DIVISOR_125), (package->v_lf125 * ANTENNA_ERROR) / 1000.0);
|
||||
|
||||
if (package->v_lf134 > NON_VOLTAGE)
|
||||
PrintAndLogEx(SUCCESS, "LF antenna: %5.2f V - %.2f kHz", (package->v_lf134 * ANTENNA_ERROR) / 1000.0, LF_DIV2FREQ(LF_DIVISOR_134));
|
||||
PrintAndLogEx(SUCCESS, "At %.2f kHz .......... " _YELLOW_("%5.2f") " V", LF_DIV2FREQ(LF_DIVISOR_134), (package->v_lf134 * ANTENNA_ERROR) / 1000.0);
|
||||
|
||||
if (package->v_lfconf > NON_VOLTAGE && package->divisor > 0 && package->divisor != LF_DIVISOR_125 && package->divisor != LF_DIVISOR_134)
|
||||
PrintAndLogEx(SUCCESS, "LF antenna: %5.2f V - %.2f kHz", (package->v_lfconf * ANTENNA_ERROR) / 1000.0, LF_DIV2FREQ(package->divisor));
|
||||
PrintAndLogEx(SUCCESS, "At %.2f kHz .......... " _YELLOW_("%5.2f") " V", LF_DIV2FREQ(package->divisor), (package->v_lfconf * ANTENNA_ERROR) / 1000.0);
|
||||
|
||||
if (package->peak_v > NON_VOLTAGE && package->peak_f > 0)
|
||||
PrintAndLogEx(SUCCESS, "LF optimal: %5.2f V - %6.2f kHz", (package->peak_v * ANTENNA_ERROR) / 1000.0, LF_DIV2FREQ(package->peak_f));
|
||||
PrintAndLogEx(SUCCESS, "At %.2f kHz optimal... " _YELLOW_("%5.2f") " V", LF_DIV2FREQ(package->peak_f), (package->peak_v * ANTENNA_ERROR) / 1000.0);
|
||||
|
||||
// Empirical measures in mV
|
||||
const double vdd_rdv4 = 9000;
|
||||
|
@ -2008,6 +2008,9 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "");
|
||||
PrintAndLogEx(SUCCESS, "Approx. Q factor measurement (*)");
|
||||
double lfq1 = 0;
|
||||
if (s4 != 0) { // we got all our points of interest
|
||||
double a = package->results[s2 - 1];
|
||||
|
@ -2017,12 +2020,12 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
double d = package->results[s4];
|
||||
double f2 = LF_DIV2FREQ(s4 - 1 + (c - v_3db_scaled) / (c - d));
|
||||
lfq1 = LF_DIV2FREQ(package->peak_f) / (f1 - f2);
|
||||
PrintAndLogEx(SUCCESS, "Approx. Q factor (*): %.1lf by frequency bandwidth measurement", lfq1);
|
||||
PrintAndLogEx(SUCCESS, "Frequency bandwidth..... " _YELLOW_("%.1lf"), lfq1);
|
||||
}
|
||||
|
||||
// Q measure with Vlr=Q*(2*Vdd/pi)
|
||||
double lfq2 = (double)package->peak_v * 3.14 / 2 / vdd;
|
||||
PrintAndLogEx(SUCCESS, "Approx. Q factor (*): %.1lf by peak voltage measurement", lfq2);
|
||||
PrintAndLogEx(SUCCESS, "Peak voltage............ " _YELLOW_("%.1lf") , lfq2);
|
||||
// cross-check results
|
||||
if (lfq1 > 3) {
|
||||
double approx_vdd = (double)package->peak_v * 3.14 / 2 / lfq1;
|
||||
|
@ -2047,34 +2050,40 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
memset(judgement, 0, sizeof(judgement));
|
||||
// LF evaluation
|
||||
if (package->peak_v < LF_UNUSABLE_V)
|
||||
snprintf(judgement, sizeof(judgement), _RED_("UNUSABLE"));
|
||||
snprintf(judgement, sizeof(judgement), _RED_("unusable"));
|
||||
else if (package->peak_v < LF_MARGINAL_V)
|
||||
snprintf(judgement, sizeof(judgement), _YELLOW_("MARGINAL"));
|
||||
snprintf(judgement, sizeof(judgement), _YELLOW_("marginal"));
|
||||
else
|
||||
snprintf(judgement, sizeof(judgement), _GREEN_("OK"));
|
||||
snprintf(judgement, sizeof(judgement), _GREEN_("ok"));
|
||||
|
||||
PrintAndLogEx((package->peak_v < LF_UNUSABLE_V) ? WARNING : SUCCESS, "LF antenna is %s", judgement);
|
||||
PrintAndLogEx((package->peak_v < LF_UNUSABLE_V) ? WARNING : SUCCESS, "LF antenna ( %s )", judgement);
|
||||
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(INFO, "---------- " _CYAN_("HF Antenna") " ----------");
|
||||
// HF evaluation
|
||||
if (package->v_hf > NON_VOLTAGE)
|
||||
PrintAndLogEx(SUCCESS, "HF antenna: %5.2f V - 13.56 MHz", (package->v_hf * ANTENNA_ERROR) / 1000.0);
|
||||
if (package->v_hf > NON_VOLTAGE) {
|
||||
PrintAndLogEx(SUCCESS, "13.56 MHz............... " _YELLOW_("%5.2f") " V", (package->v_hf * ANTENNA_ERROR) / 1000.0);
|
||||
}
|
||||
|
||||
memset(judgement, 0, sizeof(judgement));
|
||||
|
||||
PrintAndLogEx(SUCCESS, "");
|
||||
PrintAndLogEx(SUCCESS, "Approx. Q factor measurement (*)");
|
||||
|
||||
if (package->v_hf >= HF_UNUSABLE_V) {
|
||||
// Q measure with Vlr=Q*(2*Vdd/pi)
|
||||
double hfq = (double)package->v_hf * 3.14 / 2 / vdd;
|
||||
PrintAndLogEx(SUCCESS, "Approx. Q factor (*): %.1lf by peak voltage measurement", hfq);
|
||||
PrintAndLogEx(SUCCESS, "peak voltage............ " _YELLOW_("%.1lf") , hfq);
|
||||
}
|
||||
if (package->v_hf < HF_UNUSABLE_V)
|
||||
snprintf(judgement, sizeof(judgement), _RED_("UNUSABLE"));
|
||||
else if (package->v_hf < HF_MARGINAL_V)
|
||||
snprintf(judgement, sizeof(judgement), _YELLOW_("MARGINAL"));
|
||||
else
|
||||
snprintf(judgement, sizeof(judgement), _GREEN_("OK"));
|
||||
|
||||
PrintAndLogEx((package->v_hf < HF_UNUSABLE_V) ? WARNING : SUCCESS, "HF antenna is %s", judgement);
|
||||
if (package->v_hf < HF_UNUSABLE_V)
|
||||
snprintf(judgement, sizeof(judgement), _RED_("unusable"));
|
||||
else if (package->v_hf < HF_MARGINAL_V)
|
||||
snprintf(judgement, sizeof(judgement), _YELLOW_("marginal"));
|
||||
else
|
||||
snprintf(judgement, sizeof(judgement), _GREEN_("ok"));
|
||||
|
||||
PrintAndLogEx((package->v_hf < HF_UNUSABLE_V) ? WARNING : SUCCESS, "HF antenna ( %s )", judgement);
|
||||
PrintAndLogEx(NORMAL, "\n(*) Q factor must be measured without tag on the antenna");
|
||||
|
||||
// graph LF measurements
|
||||
|
@ -2086,8 +2095,16 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
}
|
||||
|
||||
if (test1 > 0) {
|
||||
PrintAndLogEx(SUCCESS, "\nDisplaying LF tuning graph. Divisor %d (blue) is %.2f kHz, %d (red) is %.2f kHz.\n\n",
|
||||
LF_DIVISOR_134, LF_DIV2FREQ(LF_DIVISOR_134), LF_DIVISOR_125, LF_DIV2FREQ(LF_DIVISOR_125));
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(INFO, "-------- " _CYAN_("LF tuning graph") " ---------");
|
||||
PrintAndLogEx(SUCCESS, "Blue line Divisor %d / %.2f kHz"
|
||||
, LF_DIVISOR_134
|
||||
, LF_DIV2FREQ(LF_DIVISOR_134)
|
||||
);
|
||||
PrintAndLogEx(SUCCESS, "Red line Divisor %d / %.2f kHz\n\n"
|
||||
, LF_DIVISOR_125
|
||||
, LF_DIV2FREQ(LF_DIVISOR_125)
|
||||
);
|
||||
g_GraphTraceLen = 256;
|
||||
g_CursorCPos = LF_DIVISOR_125;
|
||||
g_CursorDPos = LF_DIVISOR_134;
|
||||
|
|
|
@ -552,7 +552,7 @@ static int mf_analyse_st_block(uint8_t blockno, uint8_t *block, bool force) {
|
|||
return PM3_EINVARG;
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(SUCCESS, "ST passed checks, continuing...");
|
||||
PrintAndLogEx(SUCCESS, "ST checks ( " _GREEN_("ok") " )");
|
||||
}
|
||||
|
||||
return PM3_SUCCESS;
|
||||
|
|
|
@ -828,7 +828,10 @@ static int ulev1_print_configuration(uint64_t tagtype, uint8_t *data, uint8_t st
|
|||
default:
|
||||
break;
|
||||
}
|
||||
PrintAndLogEx(INFO, " mirror start page %02X | byte pos %02X - %s", mirror_page, mirror_byte, (mirror_page >= 0x4 && ((mirror_user_mem_start_byte + bytes_required_for_mirror_data) <= 144)) ? _GREEN_("OK") : _YELLOW_("Invalid value"));
|
||||
PrintAndLogEx(INFO, " mirror start page %02X | byte pos %02X - %s"
|
||||
, mirror_page, mirror_byte
|
||||
, (mirror_page >= 0x4 && ((mirror_user_mem_start_byte + bytes_required_for_mirror_data) <= 144)) ? _GREEN_("ok") : _YELLOW_("Invalid value")
|
||||
);
|
||||
}
|
||||
|
||||
} else if (tagtype & (MFU_TT_NTAG_213_F | MFU_TT_NTAG_216_F)) {
|
||||
|
|
|
@ -488,11 +488,11 @@ int CmdEM4x70WritePIN(const char *Cmd) {
|
|||
|
||||
if (resp.status) {
|
||||
print_info_result(resp.data.asBytes);
|
||||
PrintAndLogEx(INFO, "Writing new PIN: " _GREEN_("SUCCESS"));
|
||||
PrintAndLogEx(INFO, "Writing new PIN: " _GREEN_("ok"));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
PrintAndLogEx(FAILED, "Writing new PIN: " _RED_("FAILED"));
|
||||
PrintAndLogEx(FAILED, "Writing new PIN: " _RED_("failed"));
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
@ -539,11 +539,11 @@ int CmdEM4x70WriteKey(const char *Cmd) {
|
|||
}
|
||||
|
||||
if (resp.status) {
|
||||
PrintAndLogEx(INFO, "Writing new crypt key: " _GREEN_("SUCCESS"));
|
||||
PrintAndLogEx(INFO, "Writing new crypt key: " _GREEN_("ok"));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
PrintAndLogEx(FAILED, "Writing new crypt key: " _RED_("FAILED"));
|
||||
PrintAndLogEx(FAILED, "Writing new crypt key: " _RED_("failed"));
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue