#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int out_len;
unsigned char key;
int i;
char packet_data[100];
int in_stream[100] = { 202, 240, 218, 42, 202, 202, 194, 202, 202, 202, 203, 203, 202, 158, 130, 159, 141, 185, 184, 188, 156, 248, 234, 158, 139, 225, 137, 135, 202, 135, 171, 164, 162, 171, 190, 190, 171, 164, 202, 74, 163, 114, 207, 150, 203, 2, 59, 5, 202, 121, 242, 97, 151, 202, 202, 202, 202, 98, 62, 5, 202, 202, 59, 5, 202, 15, 242, 97, 151, 221, 213, 100, 151, 130, 62, 5, 202, 54, 53, 53, 53, 146, 62, 5, 202, 192, 215, 100, 151, 202, 202, 202, 202, 200, 202, 202, 202, 68, 182, 207 };
out_len = 99;
memcpy( packet_data, in_stream, out_len );
key = in_stream[0];
for( i = 0; i < out_len; i++ )
{
packet_data[i] = (in_stream[i]) ^ key;
// Если менять in_stream на packet_data то получаем первый вариант
// Если оставляем то - второй.
//cout<<i;
//cout<<":";
cout<<packet_data[i];
//cout<<"\n";
}
return 0;
}