mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
adapt the leftovers
This commit is contained in:
parent
64ea48e7d0
commit
8bfb915624
2 changed files with 14 additions and 6 deletions
|
@ -61,6 +61,7 @@
|
||||||
#include "commonutil.h"
|
#include "commonutil.h"
|
||||||
#include "crc16.h"
|
#include "crc16.h"
|
||||||
#include "protocols.h"
|
#include "protocols.h"
|
||||||
|
#include "mifareutil.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_LCD
|
#ifdef WITH_LCD
|
||||||
|
@ -1287,7 +1288,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||||
uint8_t data[];
|
uint8_t data[];
|
||||||
} PACKED;
|
} PACKED;
|
||||||
struct p *payload = (struct p *) packet->data.asBytes;
|
struct p *payload = (struct p *) packet->data.asBytes;
|
||||||
EmlSetMemIso15693(payload->count, payload->data, payload->offset);
|
emlSet(payload->data, payload->offset, payload->count);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_HF_ISO15693_SIMULATE: {
|
case CMD_HF_ISO15693_SIMULATE: {
|
||||||
|
@ -1693,7 +1694,14 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||||
uint8_t data[];
|
uint8_t data[];
|
||||||
} PACKED;
|
} PACKED;
|
||||||
struct p *payload = (struct p *) packet->data.asBytes;
|
struct p *payload = (struct p *) packet->data.asBytes;
|
||||||
MifareEMemSet(payload->blockno, payload->blockcnt, payload->blockwidth, payload->data);
|
|
||||||
|
FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
|
||||||
|
|
||||||
|
// backwards compat... default bytewidth
|
||||||
|
if (payload->blockwidth == 0)
|
||||||
|
payload->blockwidth = 16;
|
||||||
|
|
||||||
|
emlSetMem_xt(payload->data, payload->blockno, payload->blockcnt, payload->blockwidth);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_HF_MIFARE_EML_MEMGET: {
|
case CMD_HF_MIFARE_EML_MEMGET: {
|
||||||
|
|
|
@ -947,7 +947,7 @@ int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount) {
|
int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount) {
|
||||||
return mfEmlSetMem_xt(data, blockNum, blocksCount, 16);
|
return mfEmlSetMem_xt(data, blockNum, blocksCount, MFBLOCK_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidth) {
|
int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidth) {
|
||||||
|
@ -961,7 +961,7 @@ int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidt
|
||||||
|
|
||||||
size_t size = ((size_t) blocksCount) * blockBtWidth;
|
size_t size = ((size_t) blocksCount) * blockBtWidth;
|
||||||
if (size > (PM3_CMD_DATA_SIZE - sizeof(struct p))) {
|
if (size > (PM3_CMD_DATA_SIZE - sizeof(struct p))) {
|
||||||
return PM3_ESOFT;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t paylen = sizeof(struct p) + size;
|
size_t paylen = sizeof(struct p) + size;
|
||||||
|
@ -1271,7 +1271,7 @@ int detect_classic_prng(void) {
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommandMIX(CMD_HF_ISO14443A_READER, flags, sizeof(cmd), 0, cmd, sizeof(cmd));
|
SendCommandMIX(CMD_HF_ISO14443A_READER, flags, sizeof(cmd), 0, cmd, sizeof(cmd));
|
||||||
|
|
||||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000) == false) {
|
||||||
PrintAndLogEx(WARNING, "PRNG UID: Reply timeout.");
|
PrintAndLogEx(WARNING, "PRNG UID: Reply timeout.");
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
|
@ -1281,7 +1281,7 @@ int detect_classic_prng(void) {
|
||||||
PrintAndLogEx(ERR, "error: selecting tag failed, can't detect prng\n");
|
PrintAndLogEx(ERR, "error: selecting tag failed, can't detect prng\n");
|
||||||
return PM3_ERFTRANS;
|
return PM3_ERFTRANS;
|
||||||
}
|
}
|
||||||
if (!WaitForResponseTimeout(CMD_ACK, &respA, 2500)) {
|
if (WaitForResponseTimeout(CMD_ACK, &respA, 2500) == false) {
|
||||||
PrintAndLogEx(WARNING, "PRNG data: Reply timeout.");
|
PrintAndLogEx(WARNING, "PRNG data: Reply timeout.");
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue