X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/595b623bf4d58609d7362e463e1f8e7984031635..05446d5bc3d9263efc6a12026f6cf84bb421735e:/armsrc/lfops.c diff --git a/armsrc/lfops.c b/armsrc/lfops.c index 59bbb8a6..c2057884 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -620,7 +620,7 @@ static void askSimBit(uint8_t c, int *n, uint8_t clock, uint8_t manchester) uint8_t *dest = BigBuf_get_addr(); uint8_t halfClk = clock/2; // c = current bit 1 or 0 - if (manchester){ + if (manchester==1){ memset(dest+(*n), c, halfClk); memset(dest+(*n) + halfClk, c^1, halfClk); } else { @@ -629,26 +629,54 @@ static void askSimBit(uint8_t c, int *n, uint8_t clock, uint8_t manchester) *n += clock; } +static void biphaseSimBit(uint8_t c, int *n, uint8_t clock, uint8_t *phase) +{ + uint8_t *dest = BigBuf_get_addr(); + uint8_t halfClk = clock/2; + if (c){ + memset(dest+(*n), c ^ 1 ^ *phase, halfClk); + memset(dest+(*n) + halfClk, c ^ *phase, halfClk); + } else { + memset(dest+(*n), c ^ *phase, clock); + *phase ^= 1; + } + +} + // args clock, ask/man or askraw, invert, transmission separator void CmdASKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream) { int ledcontrol = 1; int n=0, i=0; uint8_t clk = (arg1 >> 8) & 0xFF; - uint8_t manchester = arg1 & 1; + uint8_t encoding = arg1 & 1; uint8_t separator = arg2 & 1; uint8_t invert = (arg2 >> 8) & 1; + + if (encoding==2){ //biphase + uint8_t phase=0; for (i=0; i=0){ - lo = Em410xDecode(dest, &size, &idx); + errCnt = Em410xDecode(dest, &size, &idx, &hi, &lo); //Dbprintf("DEBUG: EM GOT"); - if (lo>0){ + if (errCnt){ + if (size>64){ + Dbprintf("EM XL TAG ID: %06x%08x%08x - (%05d_%03d_%08d)", + hi, + (uint32_t)(lo>>32), + (uint32_t)lo, + (uint32_t)(lo&0xFFFF), + (uint32_t)((lo>>16LL) & 0xFF), + (uint32_t)(lo & 0xFFFFFF)); + } else { Dbprintf("EM TAG ID: %02x%08x - (%05d_%03d_%08d)", (uint32_t)(lo>>32), (uint32_t)lo, @@ -845,6 +883,7 @@ void CmdEM410xdemod(int findone, int *high, int *low, int ledcontrol) (uint32_t)((lo>>16LL) & 0xFF), (uint32_t)(lo & 0xFFFFFF)); } + } if (findone){ if (ledcontrol) LED_A_OFF(); *high=lo>>32;