Merge branch 'master' into 4x50_serial

update 201219
This commit is contained in:
tharexde
2020-12-19 22:02:31 +01:00
3 changed files with 435 additions and 204 deletions
+419 -203
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -13,8 +13,21 @@
#include "common.h"
typedef struct emrtd_dg_s {
uint8_t tag;
const char *fileid;
const char *filename;
const char *desc;
bool pace;
bool required; // some are required only if PACE
bool fastdump; // fast to dump
int (*parser)(uint8_t *data, size_t datalen);
int (*dumper)(uint8_t *data, size_t datalen);
} emrtd_dg_t;
int CmdHFeMRTD(const char *Cmd);
int dumpHF_EMRTD(char *documentnumber, char *dob, char *expiry, bool BAC_available);
int infoHF_EMRTD(char *documentnumber, char *dob, char *expiry, bool BAC_available);
int infoHF_EMRTD_offline(const char *path);
#endif
+3 -1
View File
@@ -208,7 +208,9 @@ void print_buffer(const uint8_t *data, const size_t len, int level) {
char buf[UTIL_BUFFER_SIZE_SPRINT + 3];
int i;
for (i = 0; i < len; i += 16) {
if (len - i < 16) { // incomplete block, will be treated out of the loop
break;
}
// (16 * 3) + (16) + + 1
memset(buf, 0, sizeof(buf));
sprintf(buf, "%*s%02x: ", (level * 4), " ", i);