Цитата:
Сообщение от ManuelDev
Hi,
anyone know how are now encrypted the packets on the latest client (Point Blank Beyonds Limits)?
Thanks in advance.
@Awiion @PROGRAMMATOR
|
I use this to decrypt packet, but it work just sometimes and not everytime.
Код:
static int Key { get; set; }
static int GetKey { get { return 29890; } }
static int GetId { get { return 5404; } }
static void SetShiftSize(int _key) { Key = _key; }
static int GetShiftSize { get { return Key; } }
internal static byte[] Decrypt(byte[] _packet)
{
int id = GetId, key = GetKey, shiftSize = GetShiftSize;
if (shiftSize == 0 || shiftSize == -1)
{
shiftSize = ((id + GetKey) % 7) + 1;
SetShiftSize(shiftSize);
}
byte[] bytes = UntangleBuffer(_packet, shiftSize);
return bytes;
}
internal static byte[] UntangleBuffer(byte[] _buffer, int _shiftsize)
{
int size = _buffer.Length - 1;
byte lastByte = _buffer[size];//ultimo byte
for (int ii = size; ii > 0; ii--)
{
_buffer[ii] = (byte)(_buffer[ii] / 2);
}
_buffer[0] = (byte)(_buffer[0] / 2);
return _buffer;
}