From ec5f70caf26a84daa11e3349a2e27f5d886499eb Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 1 May 2019 15:15:48 +0200 Subject: [PATCH] easier to read --- client/cmdhfmf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 792dc95f3..6c82d36a5 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -180,7 +180,7 @@ static int usage_hf14_chk(void) { PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, " hf mf chk 0 A 1234567890ab keys.dic -- target block 0, Key A"); - PrintAndLogEx(NORMAL, " hf mf chk *1 ? t -- target all blocks, all keys, 1K, write to emul"); + PrintAndLogEx(NORMAL, " hf mf chk *1 ? t -- target all blocks, all keys, 1K, write to emulator memory"); PrintAndLogEx(NORMAL, " hf mf chk *1 ? d -- target all blocks, all keys, 1K, write to file"); return 0; } @@ -1728,12 +1728,13 @@ out: if (transferToEml) { uint8_t block[16] = {0x00}; for (i = 0; i < sectorsCnt; ++i) { - mfEmlGetMem(block, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1); + uint8_t blockno = FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1; + mfEmlGetMem(block, blockno, 1); if (e_sector[i].foundKey[0]) num_to_bytes(e_sector[i].Key[0], 6, block); if (e_sector[i].foundKey[1]) num_to_bytes(e_sector[i].Key[1], 6, block + 10); - mfEmlSetMem(block, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1); + mfEmlSetMem(block, blockno, 1); } PrintAndLogEx(SUCCESS, "Found keys have been transferred to the emulator memory"); } @@ -2015,12 +2016,13 @@ out: if (transferToEml) { uint8_t block[16] = {0x00}; for (i = 0; i < SectorsCnt; ++i) { - mfEmlGetMem(block, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1); + uint8_t blockno = FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1; + mfEmlGetMem(block, blockno, 1); if (e_sector[i].foundKey[0]) num_to_bytes(e_sector[i].Key[0], 6, block); if (e_sector[i].foundKey[1]) num_to_bytes(e_sector[i].Key[1], 6, block + 10); - mfEmlSetMem(block, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1); + mfEmlSetMem(block, blockno, 1); } PrintAndLogEx(SUCCESS, "Found keys have been transferred to the emulator memory"); }