earlier test
This commit is contained in:
@@ -658,6 +658,14 @@ static int CmdLegicWrbl(const char *Cmd) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OUT-OF-BOUNDS checks
|
||||
// UID 4+1 bytes can't be written to.
|
||||
if (offset < 5) {
|
||||
PrintAndLogEx(WARNING, "Out-of-bounds, bytes 0-1-2-3-4 can't be written to. Offset = %d", offset);
|
||||
return PM3_EOUTOFBOUND;
|
||||
}
|
||||
|
||||
//Validations
|
||||
if (errors || cmdp == 0) {
|
||||
if (data)
|
||||
@@ -674,13 +682,6 @@ static int CmdLegicWrbl(const char *Cmd) {
|
||||
|
||||
legic_print_type(card.cardsize, 0);
|
||||
|
||||
// OUT-OF-BOUNDS checks
|
||||
// UID 4+1 bytes can't be written to.
|
||||
if (offset < 5) {
|
||||
PrintAndLogEx(WARNING, "Out-of-bounds, bytes 0-1-2-3-4 can't be written to. Offset = %d", offset);
|
||||
return PM3_EOUTOFBOUND;
|
||||
}
|
||||
|
||||
if (len + offset > card.cardsize) {
|
||||
PrintAndLogEx(WARNING, "Out-of-bounds, Cardsize = %d, [offset+len = %d ]", card.cardsize, len + offset);
|
||||
return PM3_EOUTOFBOUND;
|
||||
|
||||
Reference in New Issue
Block a user