mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 06:13:27 -07:00
added tlv tree to function
This commit is contained in:
parent
edf2582fd5
commit
0e4f7e9727
1 changed files with 7 additions and 2 deletions
|
@ -300,10 +300,15 @@ int UsageCmdHFEMVExec(void) {
|
||||||
#define TLV_ADD(tag, value)( tlvdb_add(tlvRoot, tlvdb_fixed(tag, sizeof(value) - 1, (const unsigned char *)value)) )
|
#define TLV_ADD(tag, value)( tlvdb_add(tlvRoot, tlvdb_fixed(tag, sizeof(value) - 1, (const unsigned char *)value)) )
|
||||||
#define dreturn(n) {free(pdol_data_tlv);tlvdb_free(tlvSelect);tlvdb_free(tlvRoot);DropField();return n;}
|
#define dreturn(n) {free(pdol_data_tlv);tlvdb_free(tlvSelect);tlvdb_free(tlvRoot);DropField();return n;}
|
||||||
|
|
||||||
bool ParamLoadFromJson() {
|
bool ParamLoadFromJson(struct tlvdb *tlv) {
|
||||||
json_t *root;
|
json_t *root;
|
||||||
json_error_t error;
|
json_error_t error;
|
||||||
|
|
||||||
|
if (!tlv) {
|
||||||
|
PrintAndLog("ERROR load params: tlv tree is NULL.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: add search current path
|
// TODO: add search current path
|
||||||
root = json_load_file("./emv/defparams.json", 0, &error);
|
root = json_load_file("./emv/defparams.json", 0, &error);
|
||||||
if (!root) {
|
if (!root) {
|
||||||
|
@ -507,7 +512,7 @@ int CmdHFEMVExec(const char *cmd) {
|
||||||
|
|
||||||
PrintAndLog("\n* Init transaction parameters.");
|
PrintAndLog("\n* Init transaction parameters.");
|
||||||
|
|
||||||
ParamLoadFromJson();
|
ParamLoadFromJson(tlvRoot);
|
||||||
|
|
||||||
//9F66:(Terminal Transaction Qualifiers (TTQ)) len:4
|
//9F66:(Terminal Transaction Qualifiers (TTQ)) len:4
|
||||||
char *qVSDC = "\x26\x00\x00\x00";
|
char *qVSDC = "\x26\x00\x00\x00";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue