mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
commit
11ca483617
2 changed files with 11 additions and 5 deletions
|
@ -157,11 +157,14 @@ int CLIParamHexToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int
|
||||||
int ibuf = 0;
|
int ibuf = 0;
|
||||||
uint8_t tmp_buf[256] = {0};
|
uint8_t tmp_buf[256] = {0};
|
||||||
int res = CLIParamStrToBuf(argstr, tmp_buf, maxdatalen * 2, &ibuf); // *2 because here HEX
|
int res = CLIParamStrToBuf(argstr, tmp_buf, maxdatalen * 2, &ibuf); // *2 because here HEX
|
||||||
if (res || !ibuf){
|
if (res) {
|
||||||
printf("Parameter error: buffer overflow.\n");
|
printf("Parameter error: buffer overflow.\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
if (ibuf == 0) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
switch (param_gethex_to_eol((char *)tmp_buf, 0, data, maxdatalen, datalen)) {
|
switch (param_gethex_to_eol((char *)tmp_buf, 0, data, maxdatalen, datalen)) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -199,12 +202,13 @@ int CLIParamStrToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int
|
||||||
if (!ibuf)
|
if (!ibuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ibuf > maxdatalen)
|
if (ibuf > maxdatalen) {
|
||||||
|
fflush(stdout);
|
||||||
return 2;
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(data, tmp_buf, ibuf);
|
memcpy(data, tmp_buf, ibuf);
|
||||||
*datalen = ibuf;
|
*datalen = ibuf;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2734,7 +2734,6 @@ static int CmdHF14MfuNDEF(const char *Cmd) {
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(Cmd, argtable, true);
|
CLIExecWithReturn(Cmd, argtable, true);
|
||||||
|
|
||||||
CLIGetHexWithReturn(1, key, &keylen);
|
CLIGetHexWithReturn(1, key, &keylen);
|
||||||
swapEndian = arg_get_lit(2);
|
swapEndian = arg_get_lit(2);
|
||||||
CLIParserFree();
|
CLIParserFree();
|
||||||
|
@ -2753,7 +2752,10 @@ static int CmdHF14MfuNDEF(const char *Cmd) {
|
||||||
|
|
||||||
// Get tag type
|
// Get tag type
|
||||||
TagTypeUL_t tagtype = GetHF14AMfU_Type();
|
TagTypeUL_t tagtype = GetHF14AMfU_Type();
|
||||||
if (tagtype == UL_ERROR) return PM3_ESOFT;
|
if (tagtype == UL_ERROR) {
|
||||||
|
PrintAndLogEx(WARNING, "No Ultraligth / NTAG based tag found");
|
||||||
|
return PM3_ESOFT;
|
||||||
|
}
|
||||||
|
|
||||||
// Is tag UL/NTAG?
|
// Is tag UL/NTAG?
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue