chg: strange behavior when running checks with hardnested

This commit is contained in:
iceman1001 2017-12-18 11:29:34 +01:00
parent 154c30d0e5
commit e6f0672015
5 changed files with 6 additions and 4 deletions

View file

@ -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;
}

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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);

View file

@ -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);