|
|
المشاركات 90 |
+التقييم 0.03 |
تاريخ التسجيل May 2019 |
الاقامة بلطيم |
نظام التشغيل windows |
رقم العضوية 135 |












using System;
using ProjectName.Network.Cryptography;
using System.Text;
namespace ProjectName.Network.AuthPackets
{
public class Authentication
{
byte[] Buffer;
public string Username
{
get
{
string x = Encoding.Default.GetString(Buffer, 8, 32);
return x.Replace("\0", "");
}
}
public string Password
{
get
{
byte[] PasswordArray = Encoding.Default.GetBytes(Encoding.Default.GetString(Buffer, 84, 32).Replace("\0", ""));
string x = ProjectName.Network.Cryptography.PasswordDecryption.Decrypt(PasswordArray);
return x.Replace("\0", "");
}
}
public string Server
{
get
{
string x = Encoding.Default.GetString(Buffer, 136, 16);
return x.Replace("\0", "").Replace("0", "");
}
}
public string MacAddress
{
get
{
string x = Encoding.Default.GetString(Buffer, 152, 16);
return x.Replace("\0", "");
}
}
public void Deserialize(byte[] buffer)
{
if (buffer.Length == 312)
{
ushort length = BitConverter.ToUInt16(buffer, 0);
if (length == 312)
{
ushort type = BitConverter.ToUInt16(buffer, 2);
if (type == 1636)
{
Buffer = buffer;
}
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectName.Network.Cryptography
{
using System.Text;
public class PasswordDecryption
{
static byte[] Key = new byte[32] { 90, 45, 12, 17, 35, 66, 44, 1, 02, 41, 59, 32, 36, 2, 234, 1, 10, 2, 79, 73, 202, 31, 99, 75, 7, 34, 16, 35, 101, 226, 99, 152 };
public static string Decrypt(byte[] data)
{
int length = Key.Length;
for (int x = 0; x < data.Length; x++)
{
data[x] ^= Key[x % length];
data[x] ^= Key[(x * 24 % 16) % length];
data[x] ^= Key[(x * 48 % 32) % length];
}
return Encoding.Default.GetString(data);
}
}
}
public static void AuthServer_OnClientReceive(byte[] buffer, int length, ClientWrapper arg3)
{
var player = arg3.Connector as Client.AuthClient;
player.Cryptographer.Decrypt(buffer, length);
player.Queue.Enqueue(buffer, length);
while (player.Queue.CanDequeue())
{
byte[] packet = player.Queue.Dequeue();
ushort len = BitConverter.ToUInt16(packet, 0);
ushort id = BitConverter.ToUInt16(packet, 2);
if (len == 312)
{
player.Info = new ProjectName.Network.AuthPackets.Authentication();
player.Info.Deserialize(packet);
player.Account = new AccountTable(player.Info.Username);
msvcrt.msvcrt.srand(player.PasswordSeed);
Forward Fw = new Forward();
if (player.Account.Password == player.Info.Password && player.Account.exists)
Fw.Type = Forward.ForwardType.Ready;
else
Fw.Type = Forward.ForwardType.InvalidInfo;
if (Fw.Type == Network.AuthPackets.Forward.ForwardType.Ready)
{
Fw.Identifier = player.Account.GenerateKey();
Kernel.AwaitingPool[Fw.Identifier] = player.Account;
Fw.IP = Program.GameIP;
Fw.Port = Program.GamePort;
}
player.Send(Fw);
}
}
}




| الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
| الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
| سيستم اقوي لودر حمايه لودر [XMeGo] | Mahmoud | البرامج والودرات | 247 | 2021-07-10 10:38 AM |
| بخصوص اللودر 6711 ال نزلتو يا رجاله | MeGo | البرامج والودرات | 39 | 2021-02-13 02:46 AM |
| حصريا علي منتدي اكواد اقوي اتوباتش | Hazem | تطوير سيرفرات كونكر | 60 | 2020-12-11 07:32 PM |
| خلي الكينج الاول اقوي من الثاني والثاني اقوي من الثالث وهكذا | Hazem | تطوير سيرفرات كونكر | 6 | 2020-05-26 09:40 AM |
| حمايه من هكر احياء المتجنزر من mego | ElSaher | تطوير سيرفرات كونكر | 0 | 2019-07-26 07:43 PM |