// Created by MeGo
// Copyright © 2018 - 2019 TQ Digital
// XMeGo - Project
// XMeGo - 01285338963 // 01068255178
using System;
using System.IO;
using System.Text;
using XMeGo.Network.Cryptography;
namespace XMeGo.Network.AuthPackets // غير اسم البروجيكت
{
public class Authentication : Interfaces.IPacket
{
public string Username;
public string Password;
public string Server;
public string Mac;
public Authentication()
{
}
public void Deserialize(byte[] buffer)
{
if (buffer.Length == 312)
{
ushort length = BitConverter.ToUInt16(buffer, 0);
if (length == 312)
{
ushort type = BitConverter.ToUInt16(buffer, 2);
byte[] temp = new byte[16];
if (type == 1542)
{
MemoryStream MS = new MemoryStream(buffer);
BinaryReader BR = new BinaryReader(MS);
BR.ReadUInt16();
BR.ReadUInt16();
Username = Encoding.Default.GetString(BR.ReadBytes(32));
Username = Username.Replace("", "");
BR.ReadBytes(37);
byte[] PasswordArray = BR.ReadBytes(32);
Password = Encoding.Default.GetString(PasswordArray);
XMeGoAntiHackLoR.Packets.Cryptography.LoaderEncryption.Decrypt(PasswordArray);
Password = Encoding.Default.GetString(PasswordArray);
Password = Password.Replace("", "");
BR.ReadBytes(31);
Server = Encoding.Default.GetString(BR.ReadBytes(16));
Server = Server.Replace("", "");
Mac = Encoding.Default.GetString(BR.ReadBytes(16));
Mac = Mac.Replace("", "");
BR.Close();
MS.Close();
}
}
}
}
public void Deserialize2(byte[] buffer)
{
if (buffer.Length == 312)
{
ushort length = BitConverter.ToUInt16(buffer, 0);
if (length == 312)
{
ushort type = BitConverter.ToUInt16(buffer, 2);
byte[] temp = new byte[16];
if (type == 1542)
{
MemoryStream MS = new MemoryStream(buffer);
BinaryReader BR = new BinaryReader(MS);
BR.ReadUInt16();
BR.ReadUInt16();
Username = Encoding.Default.GetString(BR.ReadBytes(32));
Username = Username.Replace("", "");
BR.ReadBytes(36);
var PasswordArray = BR.ReadBytes(32);
XMeGoAntiHackLoRx2.Network.Cryptography.LoaderEncryption.Decrypt(PasswordArray, 32);
Password = Encoding.Default.GetString(PasswordArray);
Password = Password.Replace("", "");
BR.ReadBytes(32);
Server = Encoding.Default.GetString(BR.ReadBytes(16));
Server = Server.Replace("", "");
Mac = Encoding.Default.GetString(BR.ReadBytes(16));
Mac = Mac.Replace("", "");
BR.Close();
MS.Close();
}
}
}
}
public byte[] ToArray()
{
throw new NotImplementedException();
}
public void Send(Client.GameState client)
{
throw new NotImplementedException();
}
}
}
// Created by MeGo
// Copyright © 2018 - 2019 TQ Digital
// XMeGo - Project
// XMeGo - 01285338963 // 01068255178
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace XMeGoAntiHackLoR.Packets.Cryptography// متغيرش اسم البروجيكت
{
public class LoaderEncryption
{
private static byte[] Key =
{
4 ,
5 ,
1 ,
3 ,
66 ,
7 ,
77 ,
44 ,
100 ,
228 ,
21 ,
254 ,
234 ,
212 ,
114 ,
141 ,
214 ,
12 ,
55 ,
99 ,
100 ,
7 ,
98 ,
187 ,
190 ,
77 ,
65 ,
55 ,
44 ,
43 ,
21 ,
99
}; // idb
private static byte[] Key2 =
{
6,
4,
1,
7,
2,
33,
77,
66,
65,
44,
21,
254,
43,
212,
90,
44,
214,
12,
56,
99,
67,
7,
87,
99,
0,
77,
43,
11,
44,
22,
21,
99
}; // idb
public static void Encrypt(byte[] arr)
{
int length = Key.Length;
for (int i = 0; i < arr.Length; i++)
{
arr[i] ^= Key[i % length];
arr[i] ^= Key[(i + 1) % length];
}
}
public static void Decrypt(byte[] arr)
{
var len = Encoding.Default.GetString(arr).Replace("", "").Length;
for (int i = 0; i < len; ++i)
{
arr[i] ^= Key2[88 * i & 0x1F];
arr[i] ^= Key[32 * i & 0x1C];
}
}
}
}
namespace XMeGoAntiHackLoRx2.Network.Cryptography//متغيرش اسم البروجيكت
{
public class LoaderEncryption
{
private static byte[] Key = { 12, 12, 215, 10, 20, 11, 60, 193, 11, 96, 53, 157, 71, 37, 150, 225, 86, 224, 178, 184, 230, 147, 79, 194, 160, 0, 99, 239, 218, 134, 179, 13, 247, 155, 237, 245, 165, 245, 128, 144 };
public static void Encrypt(byte[] arr)
{
int length = Key.Length;
for (int i = 0; i < arr.Length; i++)
{
arr[i] ^= Key[i % length];
arr[i] ^= Key[(i + 1) % length];
}
}
public static void Decrypt(byte[] arr, int size)
{
int length = Key.Length;
for (int i = 0; i < size; i++)
{
arr[i] ^= Key[(i + 1) % length];
arr[i] ^= Key[i % length];
}
}
}
}
GameCryptographyKey = "XMeGoAntiHackxxx"]
طيب شويه صور بقي للحمايه دي