mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
make style
This commit is contained in:
parent
60e27b305a
commit
8af75cb220
4 changed files with 128 additions and 127 deletions
|
@ -75,7 +75,7 @@ static void PrintChannel(Iso7816CommandChannel channel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int emv_parse_track1(const uint8_t *d, size_t n, bool verbose){
|
static int emv_parse_track1(const uint8_t *d, size_t n, bool verbose) {
|
||||||
if (d == NULL || n < 10) {
|
if (d == NULL || n < 10) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
@ -89,19 +89,19 @@ static int emv_parse_track1(const uint8_t *d, size_t n, bool verbose){
|
||||||
}
|
}
|
||||||
|
|
||||||
// decoder
|
// decoder
|
||||||
char *tmp = str_ndup((const char*)d, n);
|
char *tmp = str_ndup((const char *)d, n);
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
char delim[2] = "^";
|
char delim[2] = "^";
|
||||||
char *token = strtok(tmp, delim);
|
char *token = strtok(tmp, delim);
|
||||||
while (token != NULL) {
|
while (token != NULL) {
|
||||||
|
|
||||||
switch(i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
PrintAndLogEx(INFO, "PAN...................... %c%c%c%c %c%c%c%c %c%c%c%c %c%c%c%c",
|
PrintAndLogEx(INFO, "PAN...................... %c%c%c%c %c%c%c%c %c%c%c%c %c%c%c%c",
|
||||||
token[1], token[2],token[3], token[4],
|
token[1], token[2], token[3], token[4],
|
||||||
token[5], token[6],token[7], token[8],
|
token[5], token[6], token[7], token[8],
|
||||||
token[9], token[10],token[11], token[12],
|
token[9], token[10], token[11], token[12],
|
||||||
token[13], token[14],token[15], token[16]
|
token[13], token[14], token[15], token[16]
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -121,7 +121,7 @@ static int emv_parse_track1(const uint8_t *d, size_t n, bool verbose){
|
||||||
token += 4;
|
token += 4;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "CVV / iCvv............... %.*s", 3, token);
|
PrintAndLogEx(INFO, "CVV / iCvv............... %.*s", 3, token);
|
||||||
token +=3;
|
token += 3;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Trailing................. %s", token);
|
PrintAndLogEx(INFO, "Trailing................. %s", token);
|
||||||
break;
|
break;
|
||||||
|
@ -152,10 +152,10 @@ static int emv_parse_track2(const uint8_t *d, size_t n, bool verbose) {
|
||||||
tmp++;
|
tmp++;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "PAN...................... %c%c%c%c %c%c%c%c %c%c%c%c %c%c%c%c",
|
PrintAndLogEx(INFO, "PAN...................... %c%c%c%c %c%c%c%c %c%c%c%c %c%c%c%c",
|
||||||
tmp[0], tmp[1], tmp[2],tmp[3],
|
tmp[0], tmp[1], tmp[2], tmp[3],
|
||||||
tmp[4], tmp[5], tmp[6],tmp[7],
|
tmp[4], tmp[5], tmp[6], tmp[7],
|
||||||
tmp[8], tmp[9], tmp[10],tmp[11],
|
tmp[8], tmp[9], tmp[10], tmp[11],
|
||||||
tmp[12],tmp[13], tmp[14],tmp[15]
|
tmp[12], tmp[13], tmp[14], tmp[15]
|
||||||
);
|
);
|
||||||
tmp += 16;
|
tmp += 16;
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ static int emv_parse_track2(const uint8_t *d, size_t n, bool verbose) {
|
||||||
tmp += 4;
|
tmp += 4;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "CVV / iCvv............... %.*s", 3, tmp);
|
PrintAndLogEx(INFO, "CVV / iCvv............... %.*s", 3, tmp);
|
||||||
tmp +=3;
|
tmp += 3;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Trailing................. %s", tmp);
|
PrintAndLogEx(INFO, "Trailing................. %s", tmp);
|
||||||
|
|
||||||
|
|
|
@ -771,6 +771,7 @@ const static vocabulory_t vocabulory[] = {
|
||||||
{ 1, "smart help" },
|
{ 1, "smart help" },
|
||||||
{ 1, "smart list" },
|
{ 1, "smart list" },
|
||||||
{ 0, "smart info" },
|
{ 0, "smart info" },
|
||||||
|
{ 0, "smart relay" },
|
||||||
{ 0, "smart reader" },
|
{ 0, "smart reader" },
|
||||||
{ 0, "smart raw" },
|
{ 0, "smart raw" },
|
||||||
{ 1, "smart upgrade" },
|
{ 1, "smart upgrade" },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue