]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/util.c
Enhanced hf mf chk , add default key,support dic file and so on.
[proxmark3-svn] / client / util.c
index 6825d721d4622d9f383f79a6ac6ebe21984c2fea..ae213e43f55a4521dddafd70393ae6e950119e71 100644 (file)
@@ -14,7 +14,7 @@
 #include <ctype.h>
 #include "util.h"
 
-#ifdef __linux__
+#ifndef WIN32
 #include <termios.h>
 #include <sys/ioctl.h> 
 int ukbhit(void)
@@ -89,6 +89,10 @@ uint64_t bytes_to_num(uint8_t* src, size_t len)
        return num;
 }
 
+//  -------------------------------------------------------------------------
+//  string parameters lib
+//  -------------------------------------------------------------------------
+
 //  -------------------------------------------------------------------------
 //  line     - param line
 //  bg, en   - symbol numbers in param line of beginning an ending parameter
@@ -190,3 +194,15 @@ int param_gethex(const char *line, int paramnum, uint8_t * data, int hexcnt)
 
        return 0;
 }
+
+int param_getstr(const char *line, int paramnum, char * str)
+{
+       int bg, en;
+
+       if (param_getptr(line, &bg, &en, paramnum)) return 0;
+       
+       memcpy(str, line + bg, en - bg + 1);
+       str[en - bg + 1] = 0;
+       
+       return en - bg + 1;
+}
Impressum, Datenschutz