X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/873014de8a4be0f68524531cc90fe6c1dfdffded..4ab4336a97a306f97c560f4030f8faa2fd7d3aab:/client/mifarehost.c

diff --git a/client/mifarehost.c b/client/mifarehost.c
index c6f2fe3f..394d2471 100644
--- a/client/mifarehost.c
+++ b/client/mifarehost.c
@@ -10,6 +10,7 @@
 
 #include <stdio.h>
 #include <stdlib.h> 
+#include <string.h>
 #include "mifarehost.h"
 
 
@@ -195,3 +196,23 @@ int mfCheckKeys (uint8_t blockNo, uint8_t keyType, uint8_t keycnt, uint8_t * key
 	*key = bytes_to_num(resp->d.asBytes, 6);
 	return 0;
 }
+
+int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) {
+  UsbCommand c = {CMD_MIFARE_EML_MEMGET, {blockNum, blocksCount, 0}};
+ 
+  SendCommand(&c);
+
+	UsbCommand * resp = WaitForResponseTimeout(CMD_ACK, 1500);
+
+	if (resp == NULL) return 1;
+	memcpy(data, resp->d.asBytes, blocksCount * 16); 
+	return 0;
+}
+
+int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount) {
+  UsbCommand c = {CMD_MIFARE_EML_MEMSET, {blockNum, blocksCount, 0}};
+	memcpy(c.d.asBytes, data, blocksCount * 16); 
+  SendCommand(&c);
+	return 0;
+}
+