From 121402ca2f2d47b2f389e4e3e6521897e81f2a8b Mon Sep 17 00:00:00 2001 From: firealarmss Date: Wed, 19 Mar 2025 21:22:09 -0500 Subject: [PATCH] offset should be 0 for LDU1 and 101 for LDU2 for ARC4 --- DVMConsole/MainWindow.xaml.cs | 2 +- DVMConsole/P25Crypto.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DVMConsole/MainWindow.xaml.cs b/DVMConsole/MainWindow.xaml.cs index 0c212e4..09ae7ee 100644 --- a/DVMConsole/MainWindow.xaml.cs +++ b/DVMConsole/MainWindow.xaml.cs @@ -1572,7 +1572,7 @@ namespace dvmconsole PeerSystem handler = fneSystemManager.GetFneSystem(system.Name); - if (!channel.IsEnabled) + if (!channel.IsEnabled || channel.Name == PLAYBACKCHNAME) continue; if (cpgChannel.Tgid != e.DstId.ToString()) diff --git a/DVMConsole/P25Crypto.cs b/DVMConsole/P25Crypto.cs index c1b7b1f..f539008 100644 --- a/DVMConsole/P25Crypto.cs +++ b/DVMConsole/P25Crypto.cs @@ -307,8 +307,11 @@ namespace dvmconsole private bool ARC4Process(byte[] imbe, P25DUID duid) { int offset = 256; - if (duid != P25DUID.LDU2) - offset += 101; + + if (duid == P25DUID.LDU1) + offset = 0; + else if (duid == P25DUID.LDU2) + offset = 101; offset += (ksPosition * IMBE_BUF_LEN) + 267 + (ksPosition < 8 ? 0 : 2); ksPosition = (ksPosition + 1) % 9;