]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge pull request #555 from Arnie97/master
authorIceman <iceman@iuse.se>
Fri, 26 Jan 2018 18:31:23 +0000 (19:31 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Jan 2018 18:31:23 +0000 (19:31 +0100)
hf mf nested: transfer keys to the correct block in one sector mode.

client/cmdhfmf.c

index d0320148bf1ddec43d511c6787e7a4fe52b6f792..dbb6d092f5f49b2fabf9202b5550847cffd7af98 100644 (file)
@@ -683,9 +683,9 @@ int CmdHF14AMfNested(const char *Cmd)
                        if (transferToEml) {\r
                                uint8_t sectortrailer;\r
                                if (trgBlockNo < 32*4) {        // 4 block sector\r
-                                       sectortrailer = (trgBlockNo & 0x03) + 3;\r
+                                       sectortrailer = (trgBlockNo & ~0x03) + 3;\r
                                } else {                                        // 16 block sector\r
-                                       sectortrailer = (trgBlockNo & 0x0f) + 15;\r
+                                       sectortrailer = (trgBlockNo & ~0x0f) + 15;\r
                                }\r
                                mfEmlGetMem(keyBlock, sectortrailer, 1);\r
 \r
@@ -1685,10 +1685,7 @@ int CmdHF14AMfESet(const char *Cmd)
        }\r
 \r
        //  1 - blocks count\r
-       UsbCommand c = {CMD_MIFARE_EML_MEMSET, {blockNo, 1, 0}};\r
-       memcpy(c.d.asBytes, memBlock, 16);\r
-       SendCommand(&c);\r
-       return 0;\r
+       return mfEmlSetMem(memBlock, blockNo, 1);\r
 }\r
 \r
 \r
Impressum, Datenschutz