- int key = get_key_stream(2, 11); //legic_phase_drift, 11);
- int addr = f->data ^ key; addr = addr >> 1;
- int data = BigBuf[addr];
- int hash = legic4Crc(LEGIC_READ, addr, data, 11) << 8;
- BigBuf[OFFSET_LOG+legic_read_count] = (uint8_t)addr;
- legic_read_count++;
-
- //Dbprintf("Data:%03.3x, key:%03.3x, addr: %03.3x, read_c:%u", f->data, key, addr, read_c);
- legic_prng_forward(legic_reqresp_drift);
-
- frame_send_tag(hash | data, 12);
-
- ResetTimer(timer);
+ uint32_t key = get_key_stream(2, 11); //legic_phase_drift, 11);
+ uint16_t addr = f->data ^ key;
+ addr >>= 1;
+ uint8_t data = cardmem[addr];
+
+ uint32_t crc = legic4Crc(LEGIC_READ, addr, data, 11) << 8;
+
+ //legic_read_count++;
+ //legic_prng_forward(legic_reqresp_drift);
+
+ frame_send_tag(crc | data, 12);
+ //ResetTimer(timer);