mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
add: first part emv @merlokk
This commit is contained in:
parent
ccfcd8e991
commit
23506bd1d7
10 changed files with 1443 additions and 0 deletions
31
client/emv/emvcore.c
Normal file
31
client/emv/emvcore.c
Normal file
|
@ -0,0 +1,31 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2017 Merlok
|
||||
//
|
||||
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// EMV core functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "emvcore.h"
|
||||
|
||||
static bool print_cb(void *data, const struct tlv *tlv) {
|
||||
emv_tag_dump(tlv, stdout);
|
||||
dump_buffer(tlv->value, tlv->len, stdout);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TLVPrintFromBuffer(uint8_t *data, int datalen) {
|
||||
struct tlvdb *t = NULL;
|
||||
t = tlvdb_parse_multi(data, datalen);
|
||||
if (t) {
|
||||
PrintAndLog("TLV decoded:");
|
||||
|
||||
tlvdb_visit(t, print_cb, NULL);
|
||||
tlvdb_free(t);
|
||||
} else {
|
||||
PrintAndLog("TLV ERROR: Can't parse response as TLV tree.");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue