Generation

generate functionWed, 18 Jan 2023

Расчет ключа шифрования штатной сигнализации

int addr_lsb = 0x10; int addr_msb = 0x11; int key_lsb = 0x12; int key_msb = 0x13; int calc_key(int addr) { int key; key = ((addr_lsb & 0x000F) + (addr_lsb & 0x00F0) / 16 + (addr_msb & 0x000F) + (addr_msb & 0x00F0) / 16 + (addr_lsb & 0x00F0) + (addr_msb & 0x00F0)) % 255; key = key ^ 0xA5; return (key); }

Questions about programming?Chat with your personal AI assistant