Advertisement
Guest User

AHMED

a guest
Apr 19th, 2019
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.13 KB | None | 0 0
  1. اول حاجه هنخش علي Forward.cs
  2. وبعدين هنضيف دهم
  3.  
  4. ==============================
  5. using System;
  6. using System.Text;
  7.  
  8. namespace COServer.Network.AuthPackets
  9. {
  10. public unsafe class Forward : Interfaces.IPacket
  11. {
  12. byte[] Buffer;
  13. public enum ForwardType : byte
  14. {
  15. Ready = 2,
  16. InvalidInfo = 1,
  17. Banned = 25,
  18. WrongAccount = 57
  19. }
  20. public Forward()
  21. {
  22. Buffer = new byte[52];
  23. Writer.WriteUInt16(52, 0, Buffer);
  24. Writer.WriteUInt16(1055, 2, Buffer);
  25. }
  26. public uint Identifier
  27. {
  28. get { return BitConverter.ToUInt32(Buffer, 4); }
  29. set { Writer.WriteUInt32(value, 4, Buffer); }
  30. }
  31. public ForwardType Type
  32. {
  33. get { return (ForwardType)(byte)BitConverter.ToUInt32(Buffer, 8); }
  34. set { Writer.WriteUInt32((byte)value, 8, Buffer); }
  35. }
  36. public ushort Port
  37. {
  38. get { return BitConverter.ToUInt16(Buffer, 12); }
  39. set { Writer.WriteUInt16(value, 12, Buffer); }
  40. }
  41. public string IP
  42. {
  43. get { return Encoding.Default.GetString(Buffer, 20, 16); }
  44. set { Writer.WriteString(value, 20, Buffer); }
  45. }
  46. public byte[] ToArray()
  47. {
  48. return Buffer;
  49. }
  50. public void Deserialize(byte[] buffer)
  51. {
  52.  
  53. }
  54. public void Send(Client.GameState client)
  55. {
  56. client.Send(Buffer);
  57. }
  58. }
  59. }
  60. ===========================================
  61.  
  62. وبعدين هنخش كمان على LoaderEncryption
  63.  
  64. وكمان وبعدين هنضيف دهم
  65.  
  66. ==========================
  67.  
  68. // [ Class Created By IbrahemHossam ]
  69. // [ Copyright @ 2016 - 2017 ]
  70. // [ Jex - Project ]
  71.  
  72. using System;
  73. using System.Collections.Generic;
  74. using System.Linq;
  75. using System.Text;
  76.  
  77. namespace COServer.Network.Cryptography
  78. {
  79. public class LoginCryptData
  80. {
  81. 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 };
  82. public static void Encrypt(byte[] arr)
  83. {
  84.  
  85. int length = LoginKey.Length;
  86. for (int i = 0; i < arr.Length; i++)
  87. {
  88.  
  89. arr[i] ^= LoginKey[i % length];
  90. arr[i] ^= LoginKey[(i + 1) % length];
  91.  
  92. }
  93.  
  94. }
  95. public static void DoLogin(byte[] arr, int size)
  96. {
  97. int length = LoginKey.Length;
  98. for (int i = 0; i < size; i++)
  99. {
  100.  
  101. arr[i] ^= LoginKey[(i + 1) % length];
  102. arr[i] ^= LoginKey[i % length];
  103.  
  104. }
  105. }
  106. }
  107. }
  108.  
  109. ============================
  110.  
  111. وكمان هنخش علي Authentication.cs
  112. بعدين هنحط بدل اللي عندك
  113.  
  114. ================
  115.  
  116. // ☺ Created by David Eid
  117. // ☺ Copyright © 2010 - 2016 TQ Digital
  118. // ☺ Emulator - Project
  119.  
  120. using System;
  121. using System.IO;
  122. using System.Text;
  123. using COServer.Network.Cryptography;
  124.  
  125.  
  126. namespace COServer.Network.AuthPackets
  127. {
  128. public unsafe class Authentication : Interfaces.IPacket
  129. {
  130. public string Password, Username, Server, MacAddress;
  131. public Authentication()
  132. {
  133. }
  134. public byte[] ToArray()
  135. {
  136. throw new NotImplementedException();
  137. }
  138. public void Deserialize(byte[] buffer)
  139. {
  140. if (buffer.Length == 312)
  141. {
  142. ushort length = BitConverter.ToUInt16(buffer, 0);
  143. if (length == 312)
  144. {
  145. ushort type = BitConverter.ToUInt16(buffer, 2);
  146. byte[] temp = new byte[16];
  147. if (type == 1542)
  148. {
  149. MemoryStream MS = new MemoryStream(buffer);
  150. BinaryReader BR = new BinaryReader(MS);
  151. BR.ReadUInt16();
  152. BR.ReadUInt16();
  153. Username = Encoding.Default.GetString(BR.ReadBytes(32));
  154. Username = Username.Replace("\0", "");
  155. BR.ReadBytes(36);
  156. var PasswordArray = BR.ReadBytes(32);
  157. LoaderEncryption.Decrypt(PasswordArray, 32);
  158. Password = Encoding.Default.GetString(PasswordArray);
  159. Password = Password.Replace("\0", "");
  160. BR.ReadBytes(32);
  161. Server = Encoding.Default.GetString(BR.ReadBytes(32));
  162. Server = Server.Replace("\0", "");
  163. BR.Close();
  164. MS.Close();
  165. }
  166. }
  167. }
  168. }
  169. public void Send(Client.GameState client)
  170. {
  171. throw new NotImplementedException();
  172. }
  173. }
  174.  
  175.  
  176. public unsafe class Authentication2 : Interfaces.IPacket
  177. {
  178. public string Password, Username, Server, MacAddress;
  179. public Authentication2()
  180. {
  181. }
  182. public byte[] ToArray()
  183. {
  184. throw new NotImplementedException();
  185. }
  186. public void Deserialize(byte[] buffer)
  187. {
  188. if (buffer.Length == 312)
  189. {
  190. ushort length = BitConverter.ToUInt16(buffer, 0);
  191. if (length == 312)
  192. {
  193. ushort type = BitConverter.ToUInt16(buffer, 2);
  194. byte[] temp = new byte[16];
  195. if (type == 1542)
  196. {
  197. MemoryStream MS = new MemoryStream(buffer);
  198. BinaryReader BR = new BinaryReader(MS);
  199. BR.ReadUInt16();
  200. BR.ReadUInt16();
  201. BR.ReadUInt32();
  202. Username = Encoding.Default.GetString(BR.ReadBytes(64)).Replace("\0", "");
  203. byte[] PasswordArray = BR.ReadBytes(64);
  204. Password = Encoding.Default.GetString(PasswordArray).Replace("\0", "");
  205. Server = Encoding.Default.GetString(BR.ReadBytes(16)).Replace("\0", "");
  206. MacAddress = Encoding.Default.GetString(BR.ReadBytes(12)).Replace("\0", "");
  207. BR.Close();
  208. MS.Close();
  209. }
  210. }
  211. }
  212. }
  213. public void Send(Client.GameState client)
  214. {
  215. throw new NotImplementedException();
  216. }
  217. }
  218. }
  219.  
  220. =======================
  221.  
  222. بعد كده هنخش على Constants.cs
  223.  
  224. GameCryptographyKey = "z1Sf34V7z6AV13uA",
  225.  
  226. بعدين انت هتغير الكود ده اللي عندك
  227.  
  228. وحط ده
  229.  
  230. =========================================
  231.  
  232. وده الباتش بتاع اللودر
  233.  
  234. http://www.mediafire.com/file/4zogl45j5p52pm5/patch.rar/file
  235.  
  236. وكده تمام وان شاء الله كل جديد هانزله هنا
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement