projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix hid prox standalone bug
[proxmark3-svn]
/
armsrc
/
appmain.c
diff --git
a/armsrc/appmain.c
b/armsrc/appmain.c
index 530dc39cd04b4fa15603998bb069cb27e2fc9029..791ad4f861bcdb64e5003fdfe17087b66cb47502 100644
(file)
--- a/
armsrc/appmain.c
+++ b/
armsrc/appmain.c
@@
-42,12
+42,6
@@
int ToSendMax;
static int ToSendBit;
struct common_area common_area __attribute__((section(".commonarea")));
static int ToSendBit;
struct common_area common_area __attribute__((section(".commonarea")));
-void BufferClear(void)
-{
- memset(BigBuf,0,sizeof(BigBuf));
- Dbprintf("Buffer cleared (%i bytes)",sizeof(BigBuf));
-}
-
void ToSendReset(void)
{
ToSendMax = -1;
void ToSendReset(void)
{
ToSendMax = -1;
@@
-246,7
+240,10
@@
void MeasureAntennaTuningHf(void)
void SimulateTagHfListen(void)
{
void SimulateTagHfListen(void)
{
- uint8_t *dest = (uint8_t *)BigBuf+FREE_BUFFER_OFFSET;
+ // ToDo: historically this used the free buffer, which was 2744 Bytes long.
+ // There might be a better size to be defined:
+ #define HF_14B_SNOOP_BUFFER_SIZE 2744
+ uint8_t *dest = BigBuf_malloc(HF_14B_SNOOP_BUFFER_SIZE);
uint8_t v = 0;
int i;
int p = 0;
uint8_t v = 0;
int i;
int p = 0;
@@
-281,7
+278,7
@@
void SimulateTagHfListen(void)
p = 0;
i++;
p = 0;
i++;
- if(i >=
FREE
_BUFFER_SIZE) {
+ if(i >=
HF_14B_SNOOP
_BUFFER_SIZE) {
break;
}
}
break;
}
}
@@
-801,9
+798,18
@@
void UsbPacketReceived(uint8_t *packet, int len)
case CMD_MIFAREU_READBL:
MifareUReadBlock(c->arg[0],c->d.asBytes);
break;
case CMD_MIFAREU_READBL:
MifareUReadBlock(c->arg[0],c->d.asBytes);
break;
+ case CMD_MIFAREUC_AUTH1:
+ MifareUC_Auth1(c->arg[0],c->d.asBytes);
+ break;
+ case CMD_MIFAREUC_AUTH2:
+ MifareUC_Auth2(c->arg[0],c->d.asBytes);
+ break;
case CMD_MIFAREU_READCARD:
MifareUReadCard(c->arg[0], c->arg[1], c->d.asBytes);
case CMD_MIFAREU_READCARD:
MifareUReadCard(c->arg[0], c->arg[1], c->d.asBytes);
- break;
+ break;
+ case CMD_MIFAREUC_READCARD:
+ MifareUReadCard(c->arg[0], c->arg[1], c->d.asBytes);
+ break;
case CMD_MIFARE_READSC:
MifareReadSector(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_READSC:
MifareReadSector(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
@@
-858,6
+864,7
@@
void UsbPacketReceived(uint8_t *packet, int len)
case CMD_MIFARE_SNIFFER:
SniffMifare(c->arg[0]);
break;
case CMD_MIFARE_SNIFFER:
SniffMifare(c->arg[0]);
break;
+
#endif
#ifdef WITH_ICLASS
#endif
#ifdef WITH_ICLASS
@@
-881,7
+888,7
@@
void UsbPacketReceived(uint8_t *packet, int len)
break;
case CMD_BUFF_CLEAR:
break;
case CMD_BUFF_CLEAR:
- B
uffer
Clear();
+ B
igBuf_
Clear();
break;
case CMD_MEASURE_ANTENNA_TUNING:
break;
case CMD_MEASURE_ANTENNA_TUNING:
@@
-905,17
+912,18
@@
void UsbPacketReceived(uint8_t *packet, int len)
case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K:
LED_B_ON();
case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K:
LED_B_ON();
+ uint8_t *BigBuf = BigBuf_get_addr();
for(size_t i=0; i<c->arg[1]; i += USB_CMD_DATA_SIZE) {
size_t len = MIN((c->arg[1] - i),USB_CMD_DATA_SIZE);
for(size_t i=0; i<c->arg[1]; i += USB_CMD_DATA_SIZE) {
size_t len = MIN((c->arg[1] - i),USB_CMD_DATA_SIZE);
- cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K,i,len,
0,((byte_t*)BigBuf)
+c->arg[0]+i,len);
+ cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K,i,len,
traceLen,BigBuf
+c->arg[0]+i,len);
}
// Trigger a finish downloading signal with an ACK frame
}
// Trigger a finish downloading signal with an ACK frame
- cmd_send(CMD_ACK,0,0,
0
,0,0);
+ cmd_send(CMD_ACK,0,0,
traceLen
,0,0);
LED_B_OFF();
break;
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
LED_B_OFF();
break;
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
- uint8_t *b =
(uint8_t *)BigBuf
;
+ uint8_t *b =
BigBuf_get_addr()
;
memcpy(b+c->arg[0], c->d.asBytes, USB_CMD_DATA_SIZE);
cmd_send(CMD_ACK,0,0,0,0,0);
break;
memcpy(b+c->arg[0], c->d.asBytes, USB_CMD_DATA_SIZE);
cmd_send(CMD_ACK,0,0,0,0,0);
break;
Impressum
,
Datenschutz