]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: Visa2000 demod
authoriceman1001 <iceman@iuse.se>
Wed, 14 Dec 2016 22:23:53 +0000 (23:23 +0100)
committericeman1001 <iceman@iuse.se>
Wed, 14 Dec 2016 22:23:53 +0000 (23:23 +0100)
common/lfdemod.c
common/lfdemod.h

index 5fec933f5d18102f11f94a0f1a0b673d44f63860..11340ef003d0b1255e844b3a45cb9d6e6138337d 100644 (file)
@@ -696,6 +696,19 @@ int VikingDemod_AM(uint8_t *dest, size_t *size) {
        return (int) startIdx;
 }
 
+// by iceman
+// find Visa2000 preamble in already demoded data
+int Visa2kDemod_AM(uint8_t *dest, size_t *size) {
+       if (*size < 96*2) return -1; //make sure buffer has data
+       size_t startIdx = 0;
+       uint8_t preamble[] = {0,1,0,1,0,1,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,1,0};
+       uint8_t errChk = preambleSearch(dest, preamble, sizeof(preamble), size, &startIdx);
+       if (errChk == 0) return -2; //preamble not found
+       if (*size != 96) return -3; //wrong demoded size
+       //return start position
+       return (int) startIdx;
+}
+
 // find presco preamble 0x10D in already demoded data
 int PrescoDemod(uint8_t *dest, size_t *size) {
        //make sure buffer has data
index 60e34732ecc154737f64cb2e4f0e13d943189f76..b4ff453e9af8b6b31af141ed0b5176c827cc2212 100644 (file)
@@ -58,4 +58,5 @@ int VikingDemod_AM(uint8_t *dest, size_t *size);
 int PrescoDemod(uint8_t *dest, size_t *size);
 int NedapDemod(uint8_t *dest, size_t *size);
 int JablotronDemod(uint8_t *dest, size_t *size);
+int Visa2kDemod_AM(uint8_t *dest, size_t *size);
 #endif
Impressum, Datenschutz