added legic view command, and converted OLD -> NG comms

This commit is contained in:
iceman1001 2022-02-14 09:19:35 +01:00
commit 63bc9b5eb2
7 changed files with 262 additions and 92 deletions

View file

@ -1285,11 +1285,13 @@ static void PacketReceived(PacketCommandNG *packet) {
break;
}
case CMD_HF_LEGIC_WRITER: {
LegicRfWriter(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
legic_packet_t *payload = (legic_packet_t*) packet->data.asBytes;
LegicRfWriter(payload->offset, payload->len, payload->iv, payload->data);
break;
}
case CMD_HF_LEGIC_READER: {
LegicRfReader(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2]);
legic_packet_t *payload = (legic_packet_t*) packet->data.asBytes;
LegicRfReader(payload->offset, payload->len, payload->iv);
break;
}
case CMD_HF_LEGIC_INFO: {
@ -1302,10 +1304,9 @@ static void PacketReceived(PacketCommandNG *packet) {
// involved in dealing with emulator memory. But if it is called later, it might
// destroy the Emulator Memory.
//-----------------------------------------------------------------------------
// arg0 = offset
// arg1 = num of bytes
FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
emlSet(packet->data.asBytes, packet->oldarg[0], packet->oldarg[1]);
legic_packet_t *payload = (legic_packet_t*) packet->data.asBytes;
emlSet(payload->data, payload->offset, payload->len);
break;
}
#endif