mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-25 07:35:40 -07:00
fix CID #416734
This commit is contained in:
parent
b90326be61
commit
0cbc0c2f8b
1 changed files with 6 additions and 7 deletions
|
@ -1238,8 +1238,9 @@ static int CmdHFiClassESetBlk(const char *Cmd) {
|
||||||
|
|
||||||
int blk = arg_get_int_def(ctx, 1, 0);
|
int blk = arg_get_int_def(ctx, 1, 0);
|
||||||
|
|
||||||
if (blk > 255) {
|
if (blk > 255 || blk < 0) {
|
||||||
PrintAndLogEx(WARNING, "block number must be between 0 and 255. Got %i", blk);
|
PrintAndLogEx(WARNING, "block number must be between 0 and 255. Got " _RED_("%i"), blk);
|
||||||
|
CLIParserFree(ctx);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1247,18 +1248,17 @@ static int CmdHFiClassESetBlk(const char *Cmd) {
|
||||||
int datalen = 0;
|
int datalen = 0;
|
||||||
int res = CLIParamHexToBuf(arg_get_str(ctx, 2), data, sizeof(data), &datalen);
|
int res = CLIParamHexToBuf(arg_get_str(ctx, 2), data, sizeof(data), &datalen);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
PrintAndLogEx(FAILED, "Error parsing bytes");
|
PrintAndLogEx(FAILED, "Error parsing bytes");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (datalen != sizeof(data)) {
|
if (datalen != PICOPASS_BLOCK_SIZE) {
|
||||||
PrintAndLogEx(WARNING, "block data must include 8 HEX bytes. Got %i", datalen);
|
PrintAndLogEx(WARNING, "block data must include 8 HEX bytes. Got " _RED_("%i"), datalen);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLIParserFree(ctx);
|
|
||||||
|
|
||||||
uint16_t bytes_sent = 0;
|
uint16_t bytes_sent = 0;
|
||||||
iclass_upload_emul(data, sizeof(data), blk * PICOPASS_BLOCK_SIZE, &bytes_sent);
|
iclass_upload_emul(data, sizeof(data), blk * PICOPASS_BLOCK_SIZE, &bytes_sent);
|
||||||
|
|
||||||
|
@ -1805,7 +1805,6 @@ static int CmdHFiClassDump(const char *Cmd) {
|
||||||
uint8_t tag_data[0x100 * 8];
|
uint8_t tag_data[0x100 * 8];
|
||||||
memset(tag_data, 0xFF, sizeof(tag_data));
|
memset(tag_data, 0xFF, sizeof(tag_data));
|
||||||
|
|
||||||
|
|
||||||
iclass_card_select_t payload_rdr = {
|
iclass_card_select_t payload_rdr = {
|
||||||
.flags = (FLAG_ICLASS_READER_INIT | FLAG_ICLASS_READER_CLEARTRACE)
|
.flags = (FLAG_ICLASS_READER_INIT | FLAG_ICLASS_READER_CLEARTRACE)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue