From f4c724338748598362948c7f76f334d52293061c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=90=E6=AD=AA?= Date: Tue, 6 Oct 2026 04:16:28 +0800 Subject: [PATCH] fix(mifare): reject WUPA mode before GDM wipe Co-Authored-By: OpenAI Codex --- client/src/cmdhfmf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index a0ad2a3dd..7bf3519a3 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -10713,6 +10713,11 @@ static int CmdHF14AGen4_GDM_Wipe(const char *Cmd) { if (wres != PM3_SUCCESS) { return wres; } + if (gw.wakeup_type == MF_WAKE_WUPA) { + PrintAndLogEx(WARNING, "hf mf gdmwipe needs a gen1a/gdm backdoor; WUPA magic auth is insufficient"); + PrintAndLogEx(HINT, "Hint: enable one first: " _YELLOW_("hf mf gdmsetcfg --wakestyle gen1a --wupa -k ")); + return PM3_EFAILED; + } uint8_t wakeup_type = gw.wakeup_type; uint8_t auth_cmd = gw.auth_cmd; memcpy(key, gw.key, sizeof(key));