Skip to content

Commit 49e80b5

Browse files
committed
step 1 in fiddling with mfu restore
1 parent cac4e22 commit 49e80b5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

client/src/cmdhfmfu.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3944,9 +3944,20 @@ static int CmdHF14AMfURestore(const char *Cmd) {
39443944
}
39453945

39463946
PrintAndLogEx(INFO, "special PWD block written 0x%X - %s", MFU_NTAG_SPECIAL_PWD, sprint_hex(data, 4));
3947-
clearCommandBuffer();
3948-
SendCommandMIX(CMD_HF_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PWD, keytype, 0, data, sizeof(data));
39493947

3948+
mful_writeblock_t packet = {
3949+
.block_no = MFU_NTAG_SPECIAL_PWD,
3950+
.keytype = keytype,
3951+
.keylen = 4,
3952+
.use_schann = use_schann,
3953+
};
3954+
memcpy(packet.key, auth_key_ptr, 4); // password to authenticate
3955+
3956+
memcpy(packet.data, data, 4); // new password
3957+
3958+
clearCommandBuffer();
3959+
SendCommandNG(CMD_HF_MIFAREU_WRITEBL, (uint8_t *)&packet, sizeof(packet));
3960+
// SendCommandMIX(CMD_HF_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PWD, keytype, 0, data, sizeof(data));
39503961
wait4response(CMD_HF_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PWD);
39513962

39523963
// copy the new key

0 commit comments

Comments
 (0)