]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Started iclass emulator support on device side. Not functional yet
authorMartin Holst Swende <martin@swende.se>
Sat, 14 Feb 2015 20:30:26 +0000 (21:30 +0100)
committerMartin Holst Swende <martin@swende.se>
Sat, 14 Feb 2015 20:30:26 +0000 (21:30 +0100)
armsrc/BigBuf.c
armsrc/BigBuf.h
armsrc/appmain.c

index 0c666bce87992229fecaa2dafaeba508efb6035a..703ade658da348db04f80b2824269a32c738cb55 100644 (file)
@@ -224,3 +224,16 @@ int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwP
 
        return TRUE;
 }
 
        return TRUE;
 }
+// Emulator memory
+uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length){
+       uint8_t* mem = BigBuf_get_EM_addr();
+       if(offset+length < CARD_MEMORY_SIZE)
+       {
+               memcpy(mem+offset, data, length);
+               return 0;
+       }else
+       {
+               Dbprintf("Error, trying to set memory outside of bounds! %d  > %d", (offset+length), CARD_MEMORY_SIZE);
+               return 1;
+       }
+}
index be558979ad4bd719eb1cc2c6548fa049b4cd9160..b44a12630ec52b60cd86b4d0faada7d0de020222 100644 (file)
@@ -34,4 +34,5 @@ void clear_trace();
 void set_tracing(bool enable);
 bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool readerToTag);
 int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwParity, int bReader);
 void set_tracing(bool enable);
 bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool readerToTag);
 int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwParity, int bReader);
+uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length);
 #endif /* __BIGBUF_H */
 #endif /* __BIGBUF_H */
index 43f1df0203151d94c0c6864819e479b9459ef4a3..3da34777e441cea54f7aa1f6bf187b61909a6f55 100644 (file)
@@ -900,6 +900,9 @@ void UsbPacketReceived(uint8_t *packet, int len)
                case CMD_READER_ICLASS_REPLAY:
                    ReaderIClass_Replay(c->arg[0], c->d.asBytes);
                        break;
                case CMD_READER_ICLASS_REPLAY:
                    ReaderIClass_Replay(c->arg[0], c->d.asBytes);
                        break;
+       case CMD_ICLASS_EML_MEMSET:
+                       emlSet(c->d.asBytes,c->arg[0], c->arg[1]);
+                       break;
 #endif
 
                case CMD_SIMULATE_TAG_HF_LISTEN:
 #endif
 
                case CMD_SIMULATE_TAG_HF_LISTEN:
Impressum, Datenschutz