mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-26 17:16:22 +08:00
move defparams.json to resources/emv_defparams.json
This commit is contained in:
parent
382129205f
commit
40709f4536
3 changed files with 13 additions and 12 deletions
|
@ -232,7 +232,7 @@ static int CmdEMVGPO(const char *Cmd) {
|
||||||
void *argtable[] = {
|
void *argtable[] = {
|
||||||
arg_param_begin,
|
arg_param_begin,
|
||||||
arg_lit0("kK", "keep", "keep field ON for next command"),
|
arg_lit0("kK", "keep", "keep field ON for next command"),
|
||||||
arg_lit0("pP", "params", "load parameters from `emv/defparams.json` file for PDOLdata making from PDOL and parameters"),
|
arg_lit0("pP", "params", "load parameters from `emv_defparams.json` file for PDOLdata making from PDOL and parameters"),
|
||||||
arg_lit0("mM", "make", "make PDOLdata from PDOL (tag 9F38) and parameters (by default uses default parameters)"),
|
arg_lit0("mM", "make", "make PDOLdata from PDOL (tag 9F38) and parameters (by default uses default parameters)"),
|
||||||
arg_lit0("aA", "apdu", "show APDU reqests and responses"),
|
arg_lit0("aA", "apdu", "show APDU reqests and responses"),
|
||||||
arg_lit0("tT", "tlv", "TLV decode results of selected applets"),
|
arg_lit0("tT", "tlv", "TLV decode results of selected applets"),
|
||||||
|
@ -398,7 +398,7 @@ static int CmdEMVAC(const char *Cmd) {
|
||||||
arg_lit0("kK", "keep", "keep field ON for next command"),
|
arg_lit0("kK", "keep", "keep field ON for next command"),
|
||||||
arg_lit0("cC", "cda", "executes CDA transaction. Needs to get SDAD in results."),
|
arg_lit0("cC", "cda", "executes CDA transaction. Needs to get SDAD in results."),
|
||||||
arg_str0("dD", "decision", "<aac|tc|arqc>", "Terminal decision. aac - declined, tc - approved, arqc - online authorisation requested"),
|
arg_str0("dD", "decision", "<aac|tc|arqc>", "Terminal decision. aac - declined, tc - approved, arqc - online authorisation requested"),
|
||||||
arg_lit0("pP", "params", "load parameters from `emv/defparams.json` file for CDOLdata making from CDOL and parameters"),
|
arg_lit0("pP", "params", "load parameters from `emv_defparams.json` file for CDOLdata making from CDOL and parameters"),
|
||||||
arg_lit0("mM", "make", "make CDOLdata from CDOL (tag 8C and 8D) and parameters (by default uses default parameters)"),
|
arg_lit0("mM", "make", "make CDOLdata from CDOL (tag 8C and 8D) and parameters (by default uses default parameters)"),
|
||||||
arg_lit0("aA", "apdu", "show APDU reqests and responses"),
|
arg_lit0("aA", "apdu", "show APDU reqests and responses"),
|
||||||
arg_lit0("tT", "tlv", "TLV decode results of selected applets"),
|
arg_lit0("tT", "tlv", "TLV decode results of selected applets"),
|
||||||
|
@ -564,7 +564,7 @@ static int CmdEMVInternalAuthenticate(const char *Cmd) {
|
||||||
void *argtable[] = {
|
void *argtable[] = {
|
||||||
arg_param_begin,
|
arg_param_begin,
|
||||||
arg_lit0("kK", "keep", "keep field ON for next command"),
|
arg_lit0("kK", "keep", "keep field ON for next command"),
|
||||||
arg_lit0("pP", "params", "load parameters from `emv/defparams.json` file for DDOLdata making from DDOL and parameters"),
|
arg_lit0("pP", "params", "load parameters from `emv_defparams.json` file for DDOLdata making from DDOL and parameters"),
|
||||||
arg_lit0("mM", "make", "make DDOLdata from DDOL (tag 9F49) and parameters (by default uses default parameters)"),
|
arg_lit0("mM", "make", "make DDOLdata from DDOL (tag 9F49) and parameters (by default uses default parameters)"),
|
||||||
arg_lit0("aA", "apdu", "show APDU reqests and responses"),
|
arg_lit0("aA", "apdu", "show APDU reqests and responses"),
|
||||||
arg_lit0("tT", "tlv", "TLV decode results of selected applets"),
|
arg_lit0("tT", "tlv", "TLV decode results of selected applets"),
|
||||||
|
@ -785,7 +785,7 @@ static int CmdEMVExec(const char *Cmd) {
|
||||||
arg_lit0("sS", "select", "activate field and select card."),
|
arg_lit0("sS", "select", "activate field and select card."),
|
||||||
arg_lit0("aA", "apdu", "show APDU reqests and responses."),
|
arg_lit0("aA", "apdu", "show APDU reqests and responses."),
|
||||||
arg_lit0("tT", "tlv", "TLV decode results."),
|
arg_lit0("tT", "tlv", "TLV decode results."),
|
||||||
arg_lit0("jJ", "jload", "Load transaction parameters from `emv/defparams.json` file."),
|
arg_lit0("jJ", "jload", "Load transaction parameters from `emv_defparams.json` file."),
|
||||||
arg_lit0("fF", "forceaid", "Force search AID. Search AID instead of execute PPSE."),
|
arg_lit0("fF", "forceaid", "Force search AID. Search AID instead of execute PPSE."),
|
||||||
arg_rem("By default:", "Transaction type - MSD"),
|
arg_rem("By default:", "Transaction type - MSD"),
|
||||||
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
||||||
|
@ -1376,7 +1376,7 @@ static int CmdEMVScan(const char *Cmd) {
|
||||||
arg_lit0("aA", "apdu", "show APDU reqests and responses."),
|
arg_lit0("aA", "apdu", "show APDU reqests and responses."),
|
||||||
arg_lit0("tT", "tlv", "TLV decode results."),
|
arg_lit0("tT", "tlv", "TLV decode results."),
|
||||||
arg_lit0("eE", "extract", "Extract TLV elements and fill Application Data"),
|
arg_lit0("eE", "extract", "Extract TLV elements and fill Application Data"),
|
||||||
arg_lit0("jJ", "jload", "Load transaction parameters from `emv/defparams.json` file."),
|
arg_lit0("jJ", "jload", "Load transaction parameters from `emv_defparams.json` file."),
|
||||||
arg_rem("By default:", "Transaction type - MSD"),
|
arg_rem("By default:", "Transaction type - MSD"),
|
||||||
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
||||||
arg_lit0("cC", "qvsdccda", "Transaction type - qVSDC or M/Chip plus CDA (SDAD generation)."),
|
arg_lit0("cC", "qvsdccda", "Transaction type - qVSDC or M/Chip plus CDA (SDAD generation)."),
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "proxmark3.h"
|
#include "proxmark3.h"
|
||||||
#include "emv_tags.h"
|
#include "emv_tags.h"
|
||||||
|
#include "fileutils.h"
|
||||||
|
#include "pm3_cmd.h"
|
||||||
|
|
||||||
static const ApplicationDataElm ApplicationData[] = {
|
static const ApplicationDataElm ApplicationData[] = {
|
||||||
{0x82, "AIP"},
|
{0x82, "AIP"},
|
||||||
|
@ -303,13 +305,12 @@ bool ParamLoadFromJson(struct tlvdb *tlv) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// current path + file name
|
char *path;
|
||||||
const char *relfname = "emv/defparams.json";
|
if (searchFile(&path, RESOURCES_SUBDIR, "emv_defparams", ".json") != PM3_SUCCESS) {
|
||||||
char fname[strlen(get_my_executable_directory()) + strlen(relfname) + 1];
|
return false;
|
||||||
strcpy(fname, get_my_executable_directory());
|
}
|
||||||
strcat(fname, relfname);
|
root = json_load_file(path, 0, &error);
|
||||||
|
free(path);
|
||||||
root = json_load_file(fname, 0, &error);
|
|
||||||
if (!root) {
|
if (!root) {
|
||||||
PrintAndLogEx(ERR, "Load params: json error on line " _YELLOW_("%d") ": %s", error.line, error.text);
|
PrintAndLogEx(ERR, "Load params: json error on line " _YELLOW_("%d") ": %s", error.line, error.text);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue