+int CmdHf14AMfSetMod(const char *Cmd) {\r
+ uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
+ uint8_t mod = 2;\r
+\r
+ char ctmp = param_getchar(Cmd, 0);\r
+ if (ctmp == '0') {\r
+ mod = 0;\r
+ } else if (ctmp == '1') {\r
+ mod = 1;\r
+ }\r
+ int gethexfail = param_gethex(Cmd, 1, key, 12);\r
+ if (mod == 2 || gethexfail) {\r
+ PrintAndLog("Sets the load modulation strength of a MIFARE Classic EV1 card.");\r
+ PrintAndLog("Usage: hf mf setmod <0/1> <block 0 key A>");\r
+ PrintAndLog(" 0 = normal modulation");\r
+ PrintAndLog(" 1 = strong modulation (default)");\r
+ return 1;\r
+ }\r
+\r
+ UsbCommand c = {CMD_MIFARE_SETMOD, {mod, 0, 0}};\r
+ memcpy(c.d.asBytes, key, 6);\r
+ clearCommandBuffer();\r
+ SendCommand(&c);\r
+\r
+ UsbCommand resp;\r
+ if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {\r
+ uint8_t ok = resp.arg[0] & 0xff;\r
+ PrintAndLog("isOk:%02x", ok);\r
+ if (!ok) {\r
+ PrintAndLog("Failed.");\r
+ }\r
+ } else {\r
+ PrintAndLog("Command execute timeout");\r
+ }\r
+ return 0;\r
+}\r
+\r