CHG: 'hf mfu info' - now also tests for pwdgen algo D.

This commit is contained in:
iceman1001 2017-11-26 16:52:20 +01:00
parent b5010ddfe8
commit 1ebf4afd73

View file

@ -828,6 +828,9 @@ uint32_t GetHF14AMfU_Type(void){
return tagtype;
}
//
// extended tag information
//
int CmdHF14AMfUInfo(const char *Cmd){
uint8_t authlim = 0xff;
@ -1041,6 +1044,12 @@ int CmdHF14AMfUInfo(const char *Cmd){
len = ulev1_requestAuthentication(key, pack, sizeof(pack));
if (len > -1)
PrintAndLog("Found a default password: %s || Pack: %02X %02X",sprint_hex(key, 4), pack[0], pack[1]);
// test pwd gen D
num_to_bytes( ul_ev1_pwdgenD(card.uid), 4, key);
len = ulev1_requestAuthentication(key, pack, sizeof(pack));
if (len > -1)
PrintAndLog("Found a default password: %s || Pack: %02X %02X",sprint_hex(key, 4), pack[0], pack[1]);
if (!ul_auth_select( &card, tagtype, hasAuthKey, authkeyptr, pack, sizeof(pack))) return -1;
@ -1805,6 +1814,10 @@ static void wait4response(uint8_t b){
PrintAndLog("Command execute timeout");
}
}
//
// Restore dump file onto tag
//
int CmdHF14AMfURestore(const char *Cmd){
char tempStr[50] = {0};
@ -2034,13 +2047,17 @@ int CmdHF14AMfURestore(const char *Cmd){
free(dump);
return 0;
}
//
// Load emulator with dump file
//
int CmdHF14AMfUeLoad(const char *Cmd){
char c = param_getchar(Cmd, 0);
if ( c == 'h' || c == 'H' || c == 0x00) return usage_hf_mfu_eload();
return CmdHF14AMfELoad(Cmd);
}
//
// Simulate tag
//
int CmdHF14AMfUSim(const char *Cmd){
char c = param_getchar(Cmd, 0);
if ( c == 'h' || c == 'H' || c == 0x00) return usage_hf_mfu_sim();