- Check button press when there is NOFIELD, so we can exit also without FIELD
- struct nonces_t is moved to include/mifare.h so client and arm has the same definition
-typedef struct {
- uint32_t cuid;
- uint8_t sector;
- uint8_t keytype;
- uint32_t nonce;
- uint32_t ar;
- uint32_t nr;
- uint32_t nonce2;
- uint32_t ar2;
- uint32_t nr2;
-} nonces_t;
-
/**
*MIFARE 1K simulate.
*
/**
*MIFARE 1K simulate.
*
- if (cardSTATE == MFEMUL_NOFIELD) continue;
+ if (cardSTATE == MFEMUL_NOFIELD) {
+ button_pushed = BUTTON_PRESS();
+ continue;
+ }
//Now, get data
res = EmGetCmd(receivedCmd, &len, receivedCmd_par);
//Now, get data
res = EmGetCmd(receivedCmd, &len, receivedCmd_par);
// MIFARE Darkside hack
//-----------------------------------------------------------------------------
// MIFARE Darkside hack
//-----------------------------------------------------------------------------
#include "mfkey.h"
#include "crapto1/crapto1.h"
#include "mfkey.h"
#include "crapto1/crapto1.h"
#include <stdint.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdbool.h>
-typedef struct {
- uint32_t cuid;
- uint8_t sector;
- uint8_t keytype;
- uint32_t nonce;
- uint32_t ar;
- uint32_t nr;
- uint32_t at;
- uint32_t nonce2;
- uint32_t ar2;
- uint32_t nr2;
- } nonces_t;
-
extern bool mfkey32(nonces_t data, uint64_t *outputkey);
extern bool mfkey32_moebius(nonces_t data, uint64_t *outputkey);
extern int mfkey64(nonces_t data, uint64_t *outputkey);
extern bool mfkey32(nonces_t data, uint64_t *outputkey);
extern bool mfkey32_moebius(nonces_t data, uint64_t *outputkey);
extern int mfkey64(nonces_t data, uint64_t *outputkey);
ISO14A_TOPAZMODE = (1 << 8)
} iso14a_command_t;
ISO14A_TOPAZMODE = (1 << 8)
} iso14a_command_t;
+typedef struct {
+ uint32_t cuid;
+ uint8_t sector;
+ uint8_t keytype;
+ uint32_t nonce;
+ uint32_t ar;
+ uint32_t nr;
+ uint32_t at;
+ uint32_t nonce2;
+ uint32_t ar2;
+ uint32_t nr2;
+} nonces_t;
+