mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 12:59:44 -07:00
fix ask/Biphase sim bug
This commit is contained in:
parent
88e85bde41
commit
39611e3d68
1 changed files with 3 additions and 2 deletions
|
@ -642,6 +642,7 @@ static void biphaseSimBit(uint8_t c, int *n, uint8_t clock, uint8_t *phase)
|
||||||
memset(dest+(*n), c ^ *phase, clock);
|
memset(dest+(*n), c ^ *phase, clock);
|
||||||
*phase ^= 1;
|
*phase ^= 1;
|
||||||
}
|
}
|
||||||
|
*n += clock;
|
||||||
}
|
}
|
||||||
|
|
||||||
// args clock, ask/man or askraw, invert, transmission separator
|
// args clock, ask/man or askraw, invert, transmission separator
|
||||||
|
@ -659,7 +660,7 @@ void CmdASKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream)
|
||||||
for (i=0; i<size; i++){
|
for (i=0; i<size; i++){
|
||||||
biphaseSimBit(BitStream[i]^invert, &n, clk, &phase);
|
biphaseSimBit(BitStream[i]^invert, &n, clk, &phase);
|
||||||
}
|
}
|
||||||
if (BitStream[0]==BitStream[size-1]){ //run a second set inverted to keep phase in check
|
if (phase==1) { //run a second set inverted to keep phase in check
|
||||||
for (i=0; i<size; i++){
|
for (i=0; i<size; i++){
|
||||||
biphaseSimBit(BitStream[i]^invert, &n, clk, &phase);
|
biphaseSimBit(BitStream[i]^invert, &n, clk, &phase);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue