mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-03 19:43:09 +08:00
hf emrtd info: Replace padding with spaces on names
This commit is contained in:
parent
013a8abcd8
commit
9945107016
1 changed files with 11 additions and 0 deletions
|
@ -1115,6 +1115,14 @@ static int emrtd_mrz_determine_separator(char *mrz, int offset, int max_length)
|
|||
return i ? i - 1 : 0;
|
||||
}
|
||||
|
||||
static void emrtd_mrz_replace_pad(char *data, int datalen, char newchar) {
|
||||
for (int i = 0; i < datalen; i++) {
|
||||
if (data[i] == '<') {
|
||||
data[i] = newchar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void emrtd_print_optional_elements(char *mrz, int offset, int length, bool verify_check_digit) {
|
||||
int i = emrtd_mrz_determine_length(mrz, offset, length);
|
||||
|
||||
|
@ -1154,6 +1162,9 @@ static void emrtd_print_name(char *mrz, int offset, int max_length, bool localiz
|
|||
memcpy(final_name, mrz + offset, namelen);
|
||||
}
|
||||
|
||||
// Replace < characters with spaces
|
||||
emrtd_mrz_replace_pad(final_name, namelen, ' ');
|
||||
|
||||
if (localized) {
|
||||
PrintAndLogEx(SUCCESS, "Legal Name (Localized): " _YELLOW_("%s"), final_name);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue