Merge remote-tracking branch 'origin/develop' into feature/HostAttack_Hoang

This commit is contained in:
VDH
2025-10-16 10:53:41 +07:00
3 changed files with 4 additions and 7 deletions
@@ -379,7 +379,7 @@ namespace CSNetwork
{
currentIsec = _inputSecurity;
}
DecompressArcFourSecurity._logger = _logger;
bool securityApplied =
currentIsec != null && currentIsec.GetType() != typeof(NullSecurity);
Octets dataToProcess; // This will hold the data block we decode from
@@ -12,7 +12,7 @@ namespace CSNetwork.Security
/// </summary>
public class DecompressArcFourSecurity : BaseSecurity
{
private static readonly IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(DecompressArcFourSecurity));
public static IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(DecompressArcFourSecurity));
private ARCFourSecurity _arcFour; // Internal RC4 instance
private byte[] _key;
@@ -79,10 +79,7 @@ namespace CSNetwork.Security
}
catch (Exception ex)
{
//_logger.Log(LogType.Error, $"MPPC Decompression Error after decryption: {ex.Message}. Decrypted Length: {decryptedData.Length}");
string firstBytes = BitConverter.ToString(decryptedData.RawBuffer, 0, Math.Min(decryptedData.Length, 16));
_logger.Log(LogType.Debug, $"Decrypted Data (first {Math.Min(decryptedData.Length, 16)} bytes): {firstBytes}");
_logger.LogException(ex);
_logger.Log(LogType.Info, $"{ex.Message} - {ex.StackTrace}");
throw new InvalidDataException("MPPC decompression failed after decryption.", ex);
}
@@ -149,7 +149,7 @@ namespace CSNetwork.Security
Array.Copy(history, histhead, segment, 0, segment.Length);
output.Insert(output.Size, segment);
if (histptr - histhead == MPPC_HIST_LEN)
if (histptr == MPPC_HIST_LEN)
histptr = 0;
histhead = histptr;