mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-06 16:27:22 +08:00
Fix issue with command parity, adding too many bits to command
This commit is contained in:
parent
011b585b0d
commit
e48d343c5c
1 changed files with 8 additions and 2 deletions
|
@ -278,12 +278,18 @@ static void em4x70_send_bit(int bit) {
|
|||
|
||||
|
||||
/**
|
||||
* em4x70_send_command without parity
|
||||
* em4x70_send_command
|
||||
*/
|
||||
static void em4170_send_command(uint8_t command) {
|
||||
int parity = 0;
|
||||
int msb_bit = 0;
|
||||
|
||||
// Non automotive EM4x70 based tags are 3 bits + 1 parity.
|
||||
// So drop the MSB and send a parity bit instead after the command
|
||||
if(command_parity)
|
||||
msb_bit = 1;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = msb_bit; i < 4; i++) {
|
||||
int bit = (command >> (3 - i)) & 1;
|
||||
em4x70_send_bit(bit);
|
||||
parity ^= bit;
|
||||
|
|
Loading…
Reference in a new issue