CHG: some of @marshmellow42 's ref: 2b11c7c750

CHG: `lf em 410x` - when demoded to all zeros, it wasn't printed so some noninitalized tags just gets a empty "found em410x tag" message. Hav'nt decided on how to go further with it.
This commit is contained in:
iceman1001 2017-02-27 14:04:50 +01:00
commit 41611deef9
4 changed files with 125 additions and 120 deletions

View file

@ -14,6 +14,20 @@ uint64_t g_em410xid = 0;
static int CmdHelp(const char *Cmd);
int usage_lf_em410x_sim(void) {
PrintAndLog("Simulating EM410x tag");
PrintAndLog("");
PrintAndLog("Usage: lf em 410xsim [h] <uid> <clock>");
PrintAndLog("Options:");
PrintAndLog(" h - this help");
PrintAndLog(" uid - uid (10 HEX symbols)");
PrintAndLog(" clock - clock (32|64) (optional)");
PrintAndLog("samples:");
PrintAndLog(" lf em 410xsim 0F0368568B");
PrintAndLog(" lf em 410xsim 0F0368568B 32");
return 0;
}
int CmdEMdemodASK(const char *Cmd)
{
char cmdp = param_getchar(Cmd, 0);
@ -37,31 +51,12 @@ int CmdEM410xRead(const char *Cmd)
uint64_t lo = 0;
if(!AskEm410xDemod("", &hi, &lo, false)) return 0;
if (hi)
PrintAndLog ("EM410x XL pattern found");
else
PrintAndLog("EM410x pattern found: ");
printEM410x(hi, lo);
g_em410xid = lo;
return 1;
}
int usage_lf_em410x_sim(void) {
PrintAndLog("Simulating EM410x tag");
PrintAndLog("");
PrintAndLog("Usage: lf em 410xsim [h] <uid> <clock>");
PrintAndLog("Options:");
PrintAndLog(" h - this help");
PrintAndLog(" uid - uid (10 HEX symbols)");
PrintAndLog(" clock - clock (32|64) (optional)");
PrintAndLog("samples:");
PrintAndLog(" lf em 410xsim 0F0368568B");
PrintAndLog(" lf em 410xsim 0F0368568B 32");
return 0;
}
// emulate an EM410X tag
int CmdEM410xSim(const char *Cmd)
{
@ -889,7 +884,7 @@ int CmdEM4x05Write(const char *Cmd) {
PrintAndLog("Address must be between 0 and 15");
return 1;
}
if ( pwd == -1 )
if ( pwd == 1 )
PrintAndLog("Writing address %d data %08X", addr, data);
else {
usePwd = true;