forgot to read back after reset

This commit is contained in:
Philippe Teuwen 2020-10-15 22:57:57 +02:00
commit f39131f5f0
2 changed files with 8 additions and 0 deletions

View file

@ -250,6 +250,10 @@ local function main(args)
local wordstr14b = ('%08X'):format(word14b) local wordstr14b = ('%08X'):format(word14b)
if (wordstr14b == '00000000') then if (wordstr14b == '00000000') then
reset(wr_value, password) reset(wr_value, password)
word14b, err14b = core.em4x05_read(14, password)
if err14b then
return oops(err14b)
end
end end
if (wordstr14b ~= rd_value) then if (wordstr14b ~= rd_value) then
local word15b, err15b = core.em4x05_read(15, password) local word15b, err15b = core.em4x05_read(15, password)

View file

@ -1915,6 +1915,10 @@ static int CmdEM4x05Unlock(const char *Cmd) {
if (word14b == 0) { if (word14b == 0) {
unlock_reset(use_pwd, pwd, write_value); unlock_reset(use_pwd, pwd, write_value);
res = EM4x05ReadWord_ext(14, pwd, use_pwd, &word14b);
if (res != PM3_SUCCESS) {
continue;
}
} }
if (word14b != search_value) { if (word14b != search_value) {