{
    "//": "Based on Proxmark3 official repo v3.1.0, commit 6116334",
    "//": "You can change this file if the command format of client changes",
    "mifare classic": {
        "nested": {
            "cmd": "hf mf nested <card type> *",
            "card type": {
                "mini": "0",
                "1k": "1",
                "2k": "2",
                "4k": "4"
            },
            "key pattern": "\\|\\s*\\d{3}\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|",
            "key A index": 2,
            "key B index": 4
        },
        "check": {
            "cmd": "hf mf chk *<card type> ?",
            "card type": {
                "mini": "0",
                "1k": "1",
                "2k": "2",
                "4k": "4"
            },
            "key pattern": "\\|\\s*\\d{3}\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|",
            "key A index": 2,
            "key B index": 3
        },
        "info": {
            "cmd": "hf 14a info"
        },
        "sniff": {
            "cmd": "hf mf sniff"
        },
        "sniff 14a": {
            "cmd": "hf 14a snoop"
        },
        "list": {
            "cmd": "hf list mf"
        },
        "dump": {
            "cmd": "hf mf dump"
        },
        "restore": {
            "cmd": "hf mf restore"
        },
        "emulator wipe": {
            "cmd": "hf mf eclr"
        },
        "Magic Card wipe": {
            "cmd": "hf mf cwipe <card type> f",
            "card type": {
                "mini": "0",
                "1k": "1",
                "2k": "2",
                "4k": "4"
            }
        },
        "emulator read block": {
            "cmd": "hf mf eget <block>",
            "data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
        },
        "Magic Card read block": {
            "cmd": "hf mf cgetblk <block>",
            "data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
        },
        "normal read block": {
            "cmd": "hf mf rdbl <block> <key type> <key>",
            "key type": {
                "A": "A",
                "B": "B"
            },
            "data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
        },
        "darkside": {
            "cmd": "hf mf mifare"
        },
        "save sniff": {
            "cmd": "hf list mf -s <filename>"
        },
        "load sniff": {
            "cmd": "hf list mf -l <filename>"
        },
        "hardnested": {
            "cmd": "hf mf hardnested <known key block> <known key type> <known key> <target key block> <target key type>",
            "known key type": {
                "A": "A",
                "B": "B"
            },
            "target key type": {
                "A": "A",
                "B": "B"
            }
        },
        "normal read sector": {
            "cmd": "hf mf rdsc <sector> <key type> <key>",
            "key type": {
                "A": "A",
                "B": "B"
            },
            "data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
        },
        "Magic Card read sector": {
            "cmd": "hf mf cgetsc <sector>",
            "data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
        },
        "//": "When writing a block, if the result is not empty and doesn't contain the failed flag, the function will return true",
        "normal write block": {
            "cmd": "hf mf wrbl <block> <key type> <key> <data>",
            "key type": {
                "A": "A",
                "B": "B"
            },
            "failed flag": [
                "isOk:00"
            ]
        },
        "Magic Card write block": {
            "cmd": "hf mf csetblk <block> <data>",
            "failed flag": [
                "No chinese magic"
            ]
        },
        "emulator write block": {
            "cmd": "hf mf eset <block> <data>"
        },
        "Magic Card lock": {
            "cmd": "hf 14a raw ",
            "sequence": [
                "-pa -b7 40",
                "-pa 43",
                "-pa E0 00 39 F7",
                "-pa E1 00 E1 EE",
                "-pa 85 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 18 47",
                "-a 52"
            ]
        },
        "Magic Card set parameter": {
            "cmd": "hf mf csetuid <uid> <atqa> <sak>"
        }
    },
    "lf": {
        "read": {
            "cmd": "lf read",
            "show cmd": "data plot"
        },
        "sniff": {
            "cmd": "lf snoop",
            "show cmd": "data plot"
        },
        "search": {
            "cmd": "lf search u"
        },
        "tune": {
            "cmd": "hw tune l"
        },
        "get config": {
            "cmd": "hw status",
            "field start": "LF Sampling config:",
            "field end": "USB Speed:",
            "divisor": {
                "flag": "divisor:",
                "pattern": "\\d+"
            },
            "bits per sample": {
                "flag": "bps:",
                "pattern": "\\d+"
            },
            "decimation": {
                "flag": "decimation:",
                "pattern": "\\d+"
            },
            "averaging": {
                "flag": "averaging:",
                "pattern": "\\d+"
            },
            "trigger threshold": {
                "flag": "trigger threshold:",
                "pattern": "\\d+"
            },
            "samples to skip": {
                "flag": "samples to skip:",
                "pattern": "\\d+"
            },
            "//": "execute 'cmd' then find parameters between 'field stard' and 'field end'",
            "//": "for each line, if the line doesn't have any flag, skip",
            "//": "otherwise, delete characters before 'flag' and 'flag' itself, then use 'pattern' to get the parameter",
            "//": "If 'replace' dict exists, replace all keys with respective values before getting parameters"
        },
        "set config": {
            "cmd": "lf config q <divisor> b <bits per sample> d <decimation> a <averaging> t <trigger threshold> s <samples to skip>",
            "divisor cmd": "hw setlfdivisor <divisor>"
        }
    },
    "t55xx":{
        "clone em410x":{
            "read":"lf search",
            "successful read flag":"Valid EM410x ID",
            "pattern":"EM TAG ID\\s*:\\s\\K[0-9a-fA-F]{10}",
            "clone cmd":"lf em 410xwrite <id> <type>",
            "t5555 flag":"0",
            "t55x7 flag":"1"
        }
    }
}