Hopefully fix dynamic key

This commit is contained in:
Wilco Baan Hofman 2022-01-31 19:32:39 +01:00
parent 5f2a251b68
commit cd7a1d4c75

View file

@ -205,10 +205,11 @@ int main(int argc, char **argv) {
decoded = talloc_memdup(pkt, &buf[8], pkt->len - 6); decoded = talloc_memdup(pkt, &buf[8], pkt->len - 6);
NO_MEM_RETURN(decoded); NO_MEM_RETURN(decoded);
uint8_t key = decoded[0x10];
/* Decode with XOR 0xB6 */ /* Decode with XOR 0xB6 */
for (uint32_t i = 0; i < pkt->len - 6; i++) { for (uint32_t i = 0; i < pkt->len - 6; i++) {
decoded[i] ^= 0xB6; decoded[i] ^= key;
} }
pkt->device = talloc_strndup(pkt, (char *)decoded, 12); pkt->device = talloc_strndup(pkt, (char *)decoded, 12);