Thanks to the user jareckib for his solution of adding two extra blocks to t5577 in order to clone a more modern Electra tag. Find it under the extra param lf em 410x clone --electra

This commit is contained in:
iceman1001 committed 2024-02-16 21:21:02 +01:00
1 parent 60439dc29b
commit c544d67d2b
8 files changed
+66 -17

No files matched your search

+7 -3
View File
@@ -104,7 +104,7 @@ static void em410x_construct_emul_graph(uint8_t *uid, uint8_t clock, uint8_t gap
AppendGraph(true, clock, 0);
}
//print 64 bit EM410x ID in multiple formats
// print 64 bit EM410x ID in multiple formats
void printEM410x(uint32_t hi, uint64_t id, bool verbose, int type) {
if (!id && !hi) return;
@@ -279,7 +279,7 @@ int AskEm410xDecode(bool verbose, uint32_t *hi, uint64_t *lo) {
size_t idx = 0;
uint8_t bits[512] = {0};
size_t size = sizeof(bits);
if (!getDemodBuff(bits, &size)) {
if (getDemodBuff(bits, &size) == false) {
PrintAndLogEx(DEBUG, "DEBUG: Error - Em410x problem during copy from ASK demod");
return PM3_ESOFT;
}
@@ -330,7 +330,7 @@ static int CmdEM410xWatch(const char *Cmd) {
return lfsim_wait_check(CMD_LF_EM410X_WATCH);
}
//by marshmellow
// by marshmellow
//takes 3 arguments - clock, invert and maxErr as integers
//attempts to demodulate ask while decoding manchester
//prints binary found and saves in graphbuffer for further commands
@@ -671,6 +671,7 @@ static int CmdEM410xClone(const char *Cmd) {
arg_str1(NULL, "id", "<hex>", "EM Tag ID number (5 hex bytes)"),
arg_lit0(NULL, "q5", "optional - specify writing to Q5/T5555 tag"),
arg_lit0(NULL, "em", "optional - specify writing to EM4305/4469 tag"),
arg_lit0(NULL, "electra", "optional - add Electra blocks to tag"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, false);
@@ -682,6 +683,7 @@ static int CmdEM410xClone(const char *Cmd) {
CLIGetHexWithReturn(ctx, 2, uid, &uid_len);
bool q5 = arg_get_lit(ctx, 3);
bool em = arg_get_lit(ctx, 4);
bool add_electra = arg_get_lit(ctx, 5);
CLIParserFree(ctx);
uint64_t id = bytes_to_num(uid, uid_len);
@@ -702,6 +704,7 @@ static int CmdEM410xClone(const char *Cmd) {
struct {
bool Q5;
bool EM;
bool add_electra;
uint8_t clock;
uint32_t high;
uint32_t low;
@@ -709,6 +712,7 @@ static int CmdEM410xClone(const char *Cmd) {
payload.Q5 = q5;
payload.EM = em;
payload.add_electra = add_electra;
payload.clock = clk;
payload.high = (uint32_t)(id >> 32);
payload.low = (uint32_t)id;