mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
no printf, sprintf
This commit is contained in:
parent
10c64d755d
commit
da3e5dff82
1 changed files with 10 additions and 12 deletions
|
@ -885,7 +885,7 @@ static void smart_brute_prim(void) {
|
||||||
static int smart_brute_sfi(bool decodeTLV) {
|
static int smart_brute_sfi(bool decodeTLV) {
|
||||||
|
|
||||||
uint8_t *buf = calloc(PM3_CMD_DATA_SIZE, sizeof(uint8_t));
|
uint8_t *buf = calloc(PM3_CMD_DATA_SIZE, sizeof(uint8_t));
|
||||||
if (!buf)
|
if (buf == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
|
@ -895,8 +895,7 @@ static int smart_brute_sfi(bool decodeTLV) {
|
||||||
|
|
||||||
for (uint8_t sfi = 1; sfi <= 31; sfi++) {
|
for (uint8_t sfi = 1; sfi <= 31; sfi++) {
|
||||||
|
|
||||||
printf(".");
|
PrintAndLogEx(NORMAL, "." NOLF);
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
for (uint16_t rec = 1; rec <= 255; rec++) {
|
for (uint16_t rec = 1; rec <= 255; rec++) {
|
||||||
|
|
||||||
|
@ -1024,8 +1023,7 @@ static int CmdSmartBruteforceSFI(const char *Cmd) {
|
||||||
|
|
||||||
for (int i = 0; i < json_array_size(root); i++) {
|
for (int i = 0; i < json_array_size(root); i++) {
|
||||||
|
|
||||||
printf("+");
|
PrintAndLogEx(NORMAL, "+" NOLF);
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
if (caid)
|
if (caid)
|
||||||
free(caid);
|
free(caid);
|
||||||
|
@ -1033,21 +1031,21 @@ static int CmdSmartBruteforceSFI(const char *Cmd) {
|
||||||
json_t *data, *jaid;
|
json_t *data, *jaid;
|
||||||
|
|
||||||
data = json_array_get(root, i);
|
data = json_array_get(root, i);
|
||||||
if (!json_is_object(data)) {
|
if (json_is_object(data) == false) {
|
||||||
PrintAndLogEx(ERR, "data %d is not an object\n", i + 1);
|
PrintAndLogEx(ERR, "\ndata %d is not an object\n", i + 1);
|
||||||
json_decref(root);
|
json_decref(root);
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
jaid = json_object_get(data, "AID");
|
jaid = json_object_get(data, "AID");
|
||||||
if (!json_is_string(jaid)) {
|
if (json_is_string(jaid) == false) {
|
||||||
PrintAndLogEx(ERR, "AID data [%d] is not a string", i + 1);
|
PrintAndLogEx(ERR, "\nAID data [%d] is not a string", i + 1);
|
||||||
json_decref(root);
|
json_decref(root);
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *aid = json_string_value(jaid);
|
const char *aid = json_string_value(jaid);
|
||||||
if (!aid)
|
if (aid == false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
size_t aidlen = strlen(aid);
|
size_t aidlen = strlen(aid);
|
||||||
|
@ -1069,7 +1067,7 @@ static int CmdSmartBruteforceSFI(const char *Cmd) {
|
||||||
|
|
||||||
json_t *jvendor, *jname;
|
json_t *jvendor, *jname;
|
||||||
jvendor = json_object_get(data, "Vendor");
|
jvendor = json_object_get(data, "Vendor");
|
||||||
if (!json_is_string(jvendor)) {
|
if (json_is_string(jvendor) == false) {
|
||||||
PrintAndLogEx(ERR, "Vendor data [%d] is not a string", i + 1);
|
PrintAndLogEx(ERR, "Vendor data [%d] is not a string", i + 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1079,7 +1077,7 @@ static int CmdSmartBruteforceSFI(const char *Cmd) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
jname = json_object_get(data, "Name");
|
jname = json_object_get(data, "Name");
|
||||||
if (!json_is_string(jname)) {
|
if (json_is_string(jname) == false) {
|
||||||
PrintAndLogEx(ERR, "Name data [%d] is not a string", i + 1);
|
PrintAndLogEx(ERR, "Name data [%d] is not a string", i + 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue