mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-01 02:27:21 +08:00
cmdhflegic: Make sure to show help text
Show usage when parameter h is used or none parameter
This commit is contained in:
parent
cf7796aeaf
commit
e9087175a2
1 changed files with 11 additions and 11 deletions
|
@ -629,6 +629,10 @@ static int CmdLegicWrbl(const char *Cmd) {
|
||||||
|
|
||||||
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||||
switch (tolower(param_getchar(Cmd, cmdp))) {
|
switch (tolower(param_getchar(Cmd, cmdp))) {
|
||||||
|
case 'h': {
|
||||||
|
errors = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'd': {
|
case 'd': {
|
||||||
// peek at length of the input string so we can
|
// peek at length of the input string so we can
|
||||||
// figure out how many elements to malloc in "data"
|
// figure out how many elements to malloc in "data"
|
||||||
|
@ -679,10 +683,6 @@ static int CmdLegicWrbl(const char *Cmd) {
|
||||||
cmdp += 2;
|
cmdp += 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'h': {
|
|
||||||
errors = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'y': {
|
case 'y': {
|
||||||
autoconfirm = true;
|
autoconfirm = true;
|
||||||
break;
|
break;
|
||||||
|
@ -695,6 +695,13 @@ static int CmdLegicWrbl(const char *Cmd) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Validations
|
||||||
|
if (errors || cmdp == 0) {
|
||||||
|
if (data)
|
||||||
|
free(data);
|
||||||
|
return usage_legic_wrbl();
|
||||||
|
}
|
||||||
|
|
||||||
// OUT-OF-BOUNDS checks
|
// OUT-OF-BOUNDS checks
|
||||||
// UID 4+1 bytes can't be written to.
|
// UID 4+1 bytes can't be written to.
|
||||||
if (offset < 5) {
|
if (offset < 5) {
|
||||||
|
@ -704,13 +711,6 @@ static int CmdLegicWrbl(const char *Cmd) {
|
||||||
return PM3_EOUTOFBOUND;
|
return PM3_EOUTOFBOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Validations
|
|
||||||
if (errors || cmdp == 0) {
|
|
||||||
if (data)
|
|
||||||
free(data);
|
|
||||||
return usage_legic_wrbl();
|
|
||||||
}
|
|
||||||
|
|
||||||
// tagtype
|
// tagtype
|
||||||
legic_card_select_t card;
|
legic_card_select_t card;
|
||||||
if (legic_get_type(&card) != PM3_SUCCESS) {
|
if (legic_get_type(&card) != PM3_SUCCESS) {
|
||||||
|
|
Loading…
Reference in a new issue