Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- اول حاجه هنخش علي Forward.cs
- وبعدين هنضيف دهم
- ==============================
- using System;
- using System.Text;
- namespace COServer.Network.AuthPackets
- {
- public unsafe class Forward : Interfaces.IPacket
- {
- byte[] Buffer;
- public enum ForwardType : byte
- {
- Ready = 2,
- InvalidInfo = 1,
- Banned = 25,
- WrongAccount = 57
- }
- public Forward()
- {
- Buffer = new byte[52];
- Writer.WriteUInt16(52, 0, Buffer);
- Writer.WriteUInt16(1055, 2, Buffer);
- }
- public uint Identifier
- {
- get { return BitConverter.ToUInt32(Buffer, 4); }
- set { Writer.WriteUInt32(value, 4, Buffer); }
- }
- public ForwardType Type
- {
- get { return (ForwardType)(byte)BitConverter.ToUInt32(Buffer, 8); }
- set { Writer.WriteUInt32((byte)value, 8, Buffer); }
- }
- public ushort Port
- {
- get { return BitConverter.ToUInt16(Buffer, 12); }
- set { Writer.WriteUInt16(value, 12, Buffer); }
- }
- public string IP
- {
- get { return Encoding.Default.GetString(Buffer, 20, 16); }
- set { Writer.WriteString(value, 20, Buffer); }
- }
- public byte[] ToArray()
- {
- return Buffer;
- }
- public void Deserialize(byte[] buffer)
- {
- }
- public void Send(Client.GameState client)
- {
- client.Send(Buffer);
- }
- }
- }
- ===========================================
- وبعدين هنخش كمان على LoaderEncryption
- وكمان وبعدين هنضيف دهم
- ==========================
- // [ Class Created By IbrahemHossam ]
- // [ Copyright @ 2016 - 2017 ]
- // [ Jex - Project ]
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace COServer.Network.Cryptography
- {
- public class LoginCryptData
- {
- private static byte[] LoginKey = { 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 = LoginKey.Length;
- for (int i = 0; i < arr.Length; i++)
- {
- arr[i] ^= LoginKey[i % length];
- arr[i] ^= LoginKey[(i + 1) % length];
- }
- }
- public static void DoLogin(byte[] arr, int size)
- {
- int length = LoginKey.Length;
- for (int i = 0; i < size; i++)
- {
- arr[i] ^= LoginKey[(i + 1) % length];
- arr[i] ^= LoginKey[i % length];
- }
- }
- }
- }
- ============================
- وكمان هنخش علي Authentication.cs
- بعدين هنحط بدل اللي عندك
- ================
- // ☺ Created by David Eid
- // ☺ Copyright © 2010 - 2016 TQ Digital
- // ☺ Emulator - Project
- using System;
- using System.IO;
- using System.Text;
- using COServer.Network.Cryptography;
- namespace COServer.Network.AuthPackets
- {
- public unsafe class Authentication : Interfaces.IPacket
- {
- public string Password, Username, Server, MacAddress;
- public Authentication()
- {
- }
- public byte[] ToArray()
- {
- throw new NotImplementedException();
- }
- 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("\0", "");
- BR.ReadBytes(36);
- var PasswordArray = BR.ReadBytes(32);
- LoaderEncryption.Decrypt(PasswordArray, 32);
- Password = Encoding.Default.GetString(PasswordArray);
- Password = Password.Replace("\0", "");
- BR.ReadBytes(32);
- Server = Encoding.Default.GetString(BR.ReadBytes(32));
- Server = Server.Replace("\0", "");
- BR.Close();
- MS.Close();
- }
- }
- }
- }
- public void Send(Client.GameState client)
- {
- throw new NotImplementedException();
- }
- }
- public unsafe class Authentication2 : Interfaces.IPacket
- {
- public string Password, Username, Server, MacAddress;
- public Authentication2()
- {
- }
- public byte[] ToArray()
- {
- throw new NotImplementedException();
- }
- 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();
- BR.ReadUInt32();
- Username = Encoding.Default.GetString(BR.ReadBytes(64)).Replace("\0", "");
- byte[] PasswordArray = BR.ReadBytes(64);
- Password = Encoding.Default.GetString(PasswordArray).Replace("\0", "");
- Server = Encoding.Default.GetString(BR.ReadBytes(16)).Replace("\0", "");
- MacAddress = Encoding.Default.GetString(BR.ReadBytes(12)).Replace("\0", "");
- BR.Close();
- MS.Close();
- }
- }
- }
- }
- public void Send(Client.GameState client)
- {
- throw new NotImplementedException();
- }
- }
- }
- =======================
- بعد كده هنخش على Constants.cs
- GameCryptographyKey = "z1Sf34V7z6AV13uA",
- بعدين انت هتغير الكود ده اللي عندك
- وحط ده
- =========================================
- وده الباتش بتاع اللودر
- http://www.mediafire.com/file/4zogl45j5p52pm5/patch.rar/file
- وكده تمام وان شاء الله كل جديد هانزله هنا
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement