From f39131f5f05745232431ee412b412f4001a7d74c Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 15 Oct 2020 22:57:57 +0200 Subject: [PATCH] forgot to read back after reset --- client/luascripts/lf_em_tearoff_protect.lua | 4 ++++ client/src/cmdlfem4x.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/client/luascripts/lf_em_tearoff_protect.lua b/client/luascripts/lf_em_tearoff_protect.lua index 04cb7d0b5..7ab6f9314 100644 --- a/client/luascripts/lf_em_tearoff_protect.lua +++ b/client/luascripts/lf_em_tearoff_protect.lua @@ -250,6 +250,10 @@ local function main(args) local wordstr14b = ('%08X'):format(word14b) if (wordstr14b == '00000000') then reset(wr_value, password) + word14b, err14b = core.em4x05_read(14, password) + if err14b then + return oops(err14b) + end end if (wordstr14b ~= rd_value) then local word15b, err15b = core.em4x05_read(15, password) diff --git a/client/src/cmdlfem4x.c b/client/src/cmdlfem4x.c index b3d436d91..a69c7894b 100644 --- a/client/src/cmdlfem4x.c +++ b/client/src/cmdlfem4x.c @@ -1915,6 +1915,10 @@ static int CmdEM4x05Unlock(const char *Cmd) { if (word14b == 0) { unlock_reset(use_pwd, pwd, write_value); + res = EM4x05ReadWord_ext(14, pwd, use_pwd, &word14b); + if (res != PM3_SUCCESS) { + continue; + } } if (word14b != search_value) {