mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-21 15:56:21 +08:00
FIX: strange bug in "lf em em410xwatch" , which the client crasches when it reads a valid em tag.
This commit is contained in:
parent
d115f9a454
commit
3c6354e99a
|
@ -13,7 +13,7 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "cmdlfem4x.h"
|
#include "cmdlfem4x.h"
|
||||||
|
|
||||||
char *global_em410xId;
|
uint64_t g_em410xid = 0;
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
|
|
||||||
|
@ -47,11 +47,7 @@ int CmdEM410xRead(const char *Cmd)
|
||||||
PrintAndLog ("EM410x XL pattern found");
|
PrintAndLog ("EM410x XL pattern found");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
char id[12] = {0x00};
|
g_em410xid = lo;
|
||||||
//sprintf(id, "%010llx",lo);
|
|
||||||
sprintf(id, "%010"PRIu64, lo);
|
|
||||||
|
|
||||||
global_em410xId = id;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,11 +146,18 @@ int CmdEM410xWatch(const char *Cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
//currently only supports manchester modulations
|
//currently only supports manchester modulations
|
||||||
|
// todo: helptext
|
||||||
int CmdEM410xWatchnSpoof(const char *Cmd)
|
int CmdEM410xWatchnSpoof(const char *Cmd)
|
||||||
{
|
{
|
||||||
CmdEM410xWatch(Cmd);
|
// loops if the captured ID was in XL-format.
|
||||||
PrintAndLog("# Replaying captured ID: %s",global_em410xId);
|
uint8_t ans = 0;
|
||||||
|
do {
|
||||||
|
ans = CmdEM410xWatch(Cmd);
|
||||||
|
if ( ans ) {
|
||||||
|
PrintAndLog("# Replaying captured ID: %llu", g_em410xid);
|
||||||
CmdLFaskSim("");
|
CmdLFaskSim("");
|
||||||
|
}
|
||||||
|
} while ( !ans );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue