diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 44f12364d..55f2c9df0 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1156,6 +1156,7 @@ int CmdHF14AMfNestedHard(const char *Cmd) { uint64_t foundkey = 0; int16_t isOK = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, know_target_key ? trgkey : NULL, nonce_file_read, nonce_file_write, slow, tests, &foundkey); + DropField(); if (isOK) { switch (isOK) { case 1 : PrintAndLog("Error: No response from Proxmark.\n"); break; @@ -1164,7 +1165,6 @@ int CmdHF14AMfNestedHard(const char *Cmd) { } return 2; } - return 0; } diff --git a/client/cmdhfmf.h b/client/cmdhfmf.h index abcfc45d4..1c1df9c26 100644 --- a/client/cmdhfmf.h +++ b/client/cmdhfmf.h @@ -29,7 +29,7 @@ #include "mifarehost.h" #include "util_posix.h" // msclock #include "mifaredefault.h" // mifare default key array - +#include "cmdhf14a.h" // dropfield extern int CmdHFMF(const char *Cmd); diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c index ac19f911c..71caad801 100644 --- a/client/cmdhfmfhard.c +++ b/client/cmdhfmfhard.c @@ -2389,6 +2389,7 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc free_bitarray(all_bitflips_bitarray[EVEN_STATE]); free_sum_bitarrays(); free_part_sum_bitarrays(); + return is_OK; } } diff --git a/client/mifarehost.c b/client/mifarehost.c index 4e0d291e8..ec2e4f544 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -121,7 +121,7 @@ int mfDarkside(uint8_t blockno, uint8_t key_type, uint64_t *key) { } return 0; } -int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key){ +int mfCheckKeys(uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key){ *key = -1; UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType << 8)), clear_trace, keycnt}}; memcpy(c.d.asBytes, keyBlock, 6 * keycnt); diff --git a/client/scripting.c b/client/scripting.c index 68037e4e6..301b9e46e 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -597,7 +597,8 @@ static int l_hardnested(lua_State *L){ uint64_t foundkey = 0; int retval = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, haveTarget ? trgkey : NULL, nonce_file_read, nonce_file_write, slow, tests, &foundkey); - + DropField(); + //Push the retval on the stack lua_pushinteger(L,retval);