lf em 4x05 view is a new command to view dump files. lf em 4x05 view got detailed breakdown of config word bits. protection bits are guarded by verbose flag and identifcation got better generic instead of an wrongly absolut match

This commit is contained in:
iceman1001 2024-01-18 16:11:21 +01:00
commit 98e44176a9
3 changed files with 721 additions and 356 deletions

View file

@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased] ## [unreleased][unreleased]
- Change `lf em 4x05 info` - use `-v` verbose flag to see protection bits (@iceman1001)
- Changed `lf em 4x05 info` - output now shows detailed bits (@iceman1001)
- Added `lf em 4x05 view` - now supports viewing of dump files (@iceman1001)
- Changed `hf 15 eview/view` - now supports the `-z` flag for dense output (@iceman1001) - Changed `hf 15 eview/view` - now supports the `-z` flag for dense output (@iceman1001)
- Changed `hf mf cload` - now supports specifying tag size (@augustozanellato) - Changed `hf mf cload` - now supports specifying tag size (@augustozanellato)
- Added `hf 14b raw --pico` - now supports picopass anticollision over ISO14443-B (@iceman1001) - Added `hf 14b raw --pico` - now supports picopass anticollision over ISO14443-B (@iceman1001)

File diff suppressed because it is too large Load diff

View file

@ -565,18 +565,18 @@ char *sprint_breakdown_bin(color_t color, const char* bs, int width, int padn, i
} }
const char *prepad = " "; const char *prepad = " ";
const char *postmarker = "................................"; const char *postmarker = " ................................";
static char buf[32 + 120] = {0}; static char buf[32 + 120] = {0};
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
int8_t end = (width - padn - 1 - bits); int8_t end = (width - padn - bits);
if (end < 0) { if (end < 0) {
end = 0; end = 0;
} }
switch (color) { switch (color) {
case C_GREEN: { case C_GREEN: {
snprintf(buf, sizeof(buf), "%.*s" _GREEN_("%.*s") " %.*s - " _GREEN_("%s") snprintf(buf, sizeof(buf), "%.*s" _GREEN_("%.*s") "%.*s - " _GREEN_("%s")
, padn, prepad , padn, prepad
, bits, bs + padn , bits, bs + padn
, end, postmarker , end, postmarker
@ -585,7 +585,7 @@ char *sprint_breakdown_bin(color_t color, const char* bs, int width, int padn, i
break; break;
} }
case C_RED: { case C_RED: {
snprintf(buf, sizeof(buf), "%.*s" _RED_("%.*s") " %.*s - " _RED_("%s") snprintf(buf, sizeof(buf), "%.*s" _RED_("%.*s") "%.*s - " _RED_("%s")
, padn, prepad , padn, prepad
, bits, bs + padn , bits, bs + padn
, end, postmarker , end, postmarker
@ -594,7 +594,7 @@ char *sprint_breakdown_bin(color_t color, const char* bs, int width, int padn, i
break; break;
} }
case C_YELLOW: { case C_YELLOW: {
snprintf(buf, sizeof(buf), "%.*s" _YELLOW_("%.*s") " %.*s - " _YELLOW_("%s") snprintf(buf, sizeof(buf), "%.*s" _YELLOW_("%.*s") "%.*s - " _YELLOW_("%s")
, padn, prepad , padn, prepad
, bits, bs + padn , bits, bs + padn
, end, postmarker , end, postmarker
@ -604,7 +604,7 @@ char *sprint_breakdown_bin(color_t color, const char* bs, int width, int padn, i
} }
case C_NONE: case C_NONE:
default: { default: {
snprintf(buf, sizeof(buf), "%.*s%.*s %.*s - %s" snprintf(buf, sizeof(buf), "%.*s%.*s%.*s - %s"
, padn, prepad , padn, prepad
, bits, bs + padn , bits, bs + padn
, end, postmarker , end, postmarker