]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
biphase bug fixes
authormarshmellow42 <marshmellowrf@gmail.com>
Mon, 9 Mar 2015 19:27:20 +0000 (15:27 -0400)
committermarshmellow42 <marshmellowrf@gmail.com>
Mon, 9 Mar 2015 19:27:20 +0000 (15:27 -0400)
armsrc/lfops.c
client/cmddata.c

index a5c4a64dc7dea4e29109ce3afa06db38d054ab1b..468f58302862c1cdf6d9559f988d3176ed41ac47 100644 (file)
@@ -642,6 +642,11 @@ void CmdASKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream)
     for (i=0; i<size; i++){
         askSimBit(BitStream[i]^invert, &n, clk, manchester);
     }
+    if (manchester==0 && BitStream[0]==BitStream[size-1]){ //run a second set inverted (for biphase phase)
+        for (i=0; i<size; i++){
+            askSimBit(BitStream[i]^invert^1, &n, clk, manchester);
+        }    
+    }
     if (separator==1) Dbprintf("sorry but separator option not yet available"); 
 
     Dbprintf("Simulating with clk: %d, invert: %d, manchester: %d, separator: %d, n: %d",clk, invert, manchester, separator, n);
index 0bd8a7a9e8070832ccc57f196783775ecae375e3..e6e4dc0a0f8c4f2cb485433962f35dfe8144baa3 100644 (file)
@@ -520,6 +520,7 @@ int CmdBiphaseDecodeRaw(const char *Cmd)
        PrintAndLog("Biphase Decoded using offset: %d - # errors:%d - data:",offset,errCnt);
        printBitStream(BitStream, size);
        PrintAndLog("\nif bitstream does not look right try offset=1");
+  if (offset == 1) setDemodBuf(DemodBuffer,DemodBufferLen-1,1);  //remove first bit from raw demod
        return 1;
 }
 
@@ -534,7 +535,7 @@ void setBiphaseDemodBuf(uint8_t *BitStream, size_t size)
     return;
   }
   for (size_t idx=0; idx<size; idx++){
-    if(BitStream[idx]){
+    if(!BitStream[idx]){
       rawStream[i++] = curPhase;
       rawStream[i++] = curPhase;
       curPhase ^= 1; 
Impressum, Datenschutz