mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-16 02:03:00 -07:00
iceman's finished t55xx detect parameter adjustments
This commit is contained in:
parent
d1cea2a4a0
commit
ab5ffe3bef
1 changed files with 35 additions and 20 deletions
|
@ -125,13 +125,15 @@ int usage_t55xx_dump(){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int usage_t55xx_detect(){
|
int usage_t55xx_detect(){
|
||||||
PrintAndLog("Usage: lf t55xx detect [1]");
|
PrintAndLog("Usage: lf t55xx detect [1] [p <password>]");
|
||||||
PrintAndLog("Options:");
|
PrintAndLog("Options:");
|
||||||
PrintAndLog(" [graph buffer data] - if set, use Graphbuffer otherwise read data from tag.");
|
PrintAndLog(" 1 - if set, use Graphbuffer otherwise read data from tag.");
|
||||||
|
PrintAndLog(" p <password> - OPTIONAL password (8 hex characters)");
|
||||||
PrintAndLog("");
|
PrintAndLog("");
|
||||||
PrintAndLog("Examples:");
|
PrintAndLog("Examples:");
|
||||||
PrintAndLog(" lf t55xx detect");
|
PrintAndLog(" lf t55xx detect");
|
||||||
PrintAndLog(" lf t55xx detect 1");
|
PrintAndLog(" lf t55xx detect 1");
|
||||||
|
PrintAndLog(" lf t55xx detect p 11223344");
|
||||||
PrintAndLog("");
|
PrintAndLog("");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -393,28 +395,41 @@ bool DecodeT55xxBlock(){
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdT55xxDetect(const char *Cmd){
|
int CmdT55xxDetect(const char *Cmd){
|
||||||
|
bool errors = FALSE;
|
||||||
|
bool useGB = FALSE;
|
||||||
|
bool usepwd = FALSE;
|
||||||
|
uint32_t password = 0;
|
||||||
|
uint8_t cmdp = 0;
|
||||||
|
|
||||||
uint32_t password = 0; //default to blank Block 7
|
while(param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||||
|
switch(param_getchar(Cmd, cmdp)) {
|
||||||
char cmdp = param_getchar(Cmd, 0);
|
case 'h':
|
||||||
if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H') return usage_t55xx_detect();
|
case 'H':
|
||||||
|
return usage_t55xx_detect();
|
||||||
bool usepwd = ( strlen(Cmd) > 0);
|
case 'p':
|
||||||
if ( usepwd ){
|
case 'P':
|
||||||
password = param_get32ex(Cmd, 0, 0, 16);
|
password = param_get32ex(Cmd, cmdp+1, 0, 16);
|
||||||
// if (param_getchar(Cmd, 1) =='o' )
|
usepwd = TRUE;
|
||||||
// override = true;
|
cmdp += 2;
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
// use Graphbuffer data
|
||||||
|
useGB = TRUE;
|
||||||
|
cmdp++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));
|
||||||
|
errors = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (errors) return usage_t55xx_detect();
|
||||||
|
|
||||||
if (strlen(Cmd)==1) {
|
if ( !useGB) {
|
||||||
password = param_get32ex(Cmd, 0, 0, 16);
|
if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, usepwd, password) )
|
||||||
//if (param_getchar(Cmd, 1) =='o' ) override = true;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, usepwd, password) )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if ( !tryDetectModulation() )
|
if ( !tryDetectModulation() )
|
||||||
PrintAndLog("Could not detect modulation automatically. Try setting it manually with \'lf t55xx config\'");
|
PrintAndLog("Could not detect modulation automatically. Try setting it manually with \'lf t55xx config\'");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue