// *) document all the functions
-#include "proxmark3.h"
+#include "../include/proxmark3.h"
#include "util.h"
#include "apps.h"
#include "string.h"
-#include "iso15693tools.h"
-
+#include "../common/iso15693tools.h"
+#include "../common/cmd.h"
+#include "crapto1.h"
+#include "mifareutil.h"
#define arraylen(x) (sizeof(x)/sizeof((x)[0]))
//-----------------------------------------------------------------------------
void AcquireRawAdcSamplesIso15693(void)
{
+ uint8_t *dest = mifare_get_bigbufptr();
+
int c = 0;
- uint8_t *dest = (uint8_t *)BigBuf;
int getNext = 0;
-
int8_t prev = 0;
+ FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
BuildIdentifyRequest();
SetAdcMuxFor(GPIO_MUXSEL_HIPKD);
void RecordRawAdcSamplesIso15693(void)
{
+ uint8_t *dest = mifare_get_bigbufptr();
+
int c = 0;
- uint8_t *dest = (uint8_t *)BigBuf;
int getNext = 0;
-
int8_t prev = 0;
+ FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
// Setup SSC
FpgaSetupSsc();
// Start from off (no field generated)
- FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
- SpinDelay(200);
+ FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
+ SpinDelay(200);
SetAdcMuxFor(GPIO_MUXSEL_HIPKD);
LED_C_OFF();
LED_D_OFF();
+ FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
// Setup SSC
// FpgaSetupSsc();
// Blank arrays
memset(BigBuf + 3660, 0, 300);
+ FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
// Setup SSC
FpgaSetupSsc();
// FIRST WE RUN AN INVENTORY TO GET THE TAG UID
// THIS MEANS WE CAN PRE-BUILD REQUESTS TO SAVE CPU TIME
- uint8_t TagUID[8]; // where we hold the uid for hi15reader
+ uint8_t TagUID[8] = {0, 0, 0, 0, 0, 0, 0, 0}; // where we hold the uid for hi15reader
// BuildIdentifyRequest();
// //TransmitTo15693Tag(ToSend,ToSendMax+3,&tsamples, &wait);
Dbprintf("%d octets read from IDENTIFY request:", answerLen1);
DbdecodeIso15693Answer(answerLen1,answer1);
- Dbhexdump(answerLen1,answer1);
+ Dbhexdump(answerLen1,answer1,true);
// UID is reverse
if (answerLen1>=12)
Dbprintf("%d octets read from SELECT request:", answerLen2);
DbdecodeIso15693Answer(answerLen2,answer2);
- Dbhexdump(answerLen2,answer2);
+ Dbhexdump(answerLen2,answer2,true);
Dbprintf("%d octets read from XXX request:", answerLen3);
DbdecodeIso15693Answer(answerLen3,answer3);
- Dbhexdump(answerLen3,answer3);
+ Dbhexdump(answerLen3,answer3,true);
// read all pages
if (answerLen2>0) {
Dbprintf("READ SINGLE BLOCK %d returned %d octets:",i,answerLen2);
DbdecodeIso15693Answer(answerLen2,answer2);
- Dbhexdump(answerLen2,answer2);
+ Dbhexdump(answerLen2,answer2,true);
if ( *((uint32_t*) answer2) == 0x07160101 ) break; // exit on NoPageErr
}
i++;
// Blank arrays
memset(answer1, 0, 100);
+ FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
// Setup SSC
FpgaSetupSsc();
int recvlen=0;
uint8_t *recvbuf=(uint8_t *)BigBuf;
- UsbCommand n;
+// UsbCommand n;
if (DEBUG) {
Dbprintf("SEND");
- Dbhexdump(datalen,data);
+ Dbhexdump(datalen,data,true);
}
recvlen=SendDataTag(data,datalen,1,speed,(recv?&recvbuf:NULL));
if (recv) {
- n.cmd=/* CMD_ISO_15693_COMMAND_DONE */ CMD_ACK;
- n.arg[0]=recvlen>48?48:recvlen;
- memcpy(n.d.asBytes, recvbuf, 48);
LED_B_ON();
- UsbSendPacket((uint8_t *)&n, sizeof(n));
+ cmd_send(CMD_ACK,recvlen>48?48:recvlen,0,0,recvbuf,48);
LED_B_OFF();
if (DEBUG) {
Dbprintf("RECV");
DbdecodeIso15693Answer(recvlen,recvbuf);
- Dbhexdump(recvlen,recvbuf);
+ Dbhexdump(recvlen,recvbuf,true);
}
}