Пример #1
0
        public void MoveItem(byte srcWindow, UInt16 srcSlot, byte dstWindow, UInt16 dstSlot, UInt32 count)
        {
            CItemMovePacket packet = new CItemMovePacket()
            {
                Count             = count,
                DestinationSlot   = dstSlot,
                DestinationWindow = dstWindow,
                SourceSlot        = srcSlot,
                SourceWindow      = srcWindow
            };

            virtualClient.SendPacket(packet);
        }
Пример #2
0
 public override void Received(VirtualClient virtualClient)
 {
     if(virtualClient.IsIngame == false)
     {
         CEnterGamePacket packet = new CEnterGamePacket();
         virtualClient.SendPacket(packet);
         virtualClient.Logger.LogInfo("Entered Game");
         virtualClient.IsIngame = true;
     }
     virtualClient.CharacterManager.GetCharacter().Gold = this.Gold;;
     virtualClient.Logger.LogInfo("Gold: " + Gold);
 }
Пример #3
0
        private void Received_PhaseSentry(VirtualClient virtualClient)
        {
            CSentrySendPacket packet = new CSentrySendPacket()
            {
                Mac        = "00::00::20::00::00::02",
                Guid       = "445cd91f-7ae3-acab-9ffa-51b9dc5bfabb",
                CpuId      = "288BBBFF0F100BA0",
                HddMod     = "SAMSUNGSUPERFASTFUCKYOU",
                HddSer     = "RS032GYJAB6969SHIT0845",
                DeviceName = "DESKTOP"
            };

            virtualClient.SendPacket(packet);
        }
Пример #4
0
        public void AddItemToShop(byte sourceWindow, UInt16 sourceSlot, UInt32 destinationSlot, UInt64 price)
        {
            CShopAddItemPacket packet = new CShopAddItemPacket();

            packet.SourceInventory = sourceWindow;
            packet.SourceSlot      = sourceSlot;
            packet.DestinationSlot = destinationSlot;
            packet.Price           = price;
            virtualClient.SendPacket(packet);
        }
Пример #5
0
        private void Received_PhaseAuth(VirtualClient virtualClient)
        {
            virtualClient.Encryption = true;

            CLogin3Packet packet = new CLogin3Packet()
            {
                Username  = virtualClient.LoginInformation.Username,
                Password  = virtualClient.LoginInformation.Password,
                HWID      = "CSsa/aFvBBQNA+1mkwS41lCvp4VYNBcw4UdoLWRD/1E=",
                Language  = "de",
                Timestamp = virtualClient.ClientVersion,
            };

            Array.Copy(virtualClient.ClientKey, packet.ClientKey, 4);

            virtualClient.SendPacket(packet);
        }
Пример #6
0
        private void Received_PhaseLogin(VirtualClient virtualClient)
        {
            if (virtualClient.LoginInformation.LoginKey.HasValue == false)
            {
                throw new Exception("No Login Key available");
            }
            virtualClient.Encryption = true;
            CLogin2Packet packet = new CLogin2Packet
            {
                Username = virtualClient.LoginInformation.Username,
                LoginKey = virtualClient.LoginInformation.LoginKey.Value
            };

            Array.Copy(virtualClient.ClientKey, packet.ClientKey, 4);
            virtualClient.SendPacket(packet);

            byte[] encryptKey = new byte[16];
            Buffer.BlockCopy(virtualClient.ClientKey, 0, encryptKey, 0, 16);
            byte[] key        = CryptoUtils.GetKey_20050304Myevan();
            byte[] decryptKey = TinyEncryptionAlgorithm.Encrypt(encryptKey, key);
            virtualClient.SetXteaKey(encryptKey, decryptKey);
        }
Пример #7
0
        public override void Received(VirtualClient virtualClient)
        {
            if (virtualClient.ConnectedServerEndPoint != ServerEndPoint.GameServer)
            {
                virtualClient.LoginSuccessResult.Characters.AddRange(this.Characters.Where(x => x.ID != 0).ToList());
                String logtext = "";
                for (int i = 0; i < virtualClient.LoginSuccessResult.Characters.Count; i++)
                {
                    SelectCharacter character = virtualClient.LoginSuccessResult.Characters[i];
                    logtext += i + ") Name: " + character.Name + " Level: " + character.Level + " Race: " + character.Race + "\r\n";
                }

                virtualClient.Logger.LogInfo(logtext);
                virtualClient.OnLoginSuccess();
            }
            else
            {
                CCharacterSelectPacket packet = new CCharacterSelectPacket();
                packet.CharacterIndex = virtualClient.SelectedCharacterIndex;
                virtualClient.SendPacket(packet);
            }
        }
Пример #8
0
        public override void Received(VirtualClient virtualClient)
        {
            CPongPacket packet = new CPongPacket();

            virtualClient.SendPacket(packet);
        }
Пример #9
0
        public override void Received(VirtualClient virtualClient)
        {
            CHandshakePacket packet = new CHandshakePacket();

            packet.Handshake = this.Handshake;
            packet.Timestamp = this.Timestamp + (Delta * 2);
            packet.Delta     = 0;
            //packet.Handshake = this.Handshake;
            //packet.Token = new UInt32[8];
            //packet.Token[0] = this.Token;
            //for (uint i = 1; i < 8; i++)
            //{
            //    packet.Token[i] = packet.Token[i - 1] >> 0x1E;
            //    packet.Token[i] = packet.Token[i - 1] ^ packet.Token[i];
            //    packet.Token[i] = packet.Token[i] * 0x6C078965;
            //    packet.Token[i] = packet.Token[i] + i;
            //}

            //UInt32 x, y, z, w, v;
            //for (uint i = 0; i < 8; i++)
            //{
            //    x = ((packet.Token[i] >> 0x0B) ^ packet.Token[i]);
            //    y = (x & 0xFF3A58AD) << 0x7;
            //    z = x ^ y;
            //    x = ((z & 0xFFFFDF8C) << 0xF) ^ z;
            //    x = (x >> 0x12) ^ x;
            //    packet.Token[i] = x;
            //}

            //UInt32[] valTable = new UInt32[]
            //{
            //    0x93821DFC,
            //    0x879163AC,
            //    0xCA34E2D3,
            //    0x0AFECD69,
            //    this.Token,
            //    0x3CA3D70B
            //};

            //for (uint i = 0; i < 4; i++)
            //{
            //    UInt32 first = packet.Token[i * 2];
            //    UInt32 second = packet.Token[i * 2 + 1];
            //    UInt32 sum = 0;
            //    for (uint j = 0; j < 20; j++)
            //    {
            //        x = second << 0x4;
            //        y = second >> 0x5;
            //        x = x ^ y;
            //        z = sum & 0x4;
            //        x = x + second;
            //        y = valTable[z];
            //        w = sum + y;
            //        sum = sum - 0x648C8967;
            //        x = x ^ w;
            //        first = x + first;
            //        v = (first << 0x4) ^ (first >> 0x5);
            //        y = (sum >> 0xB);
            //        z = first + v;
            //        y = valTable[y & 0x4];
            //        w = sum + y;
            //        w = w ^ z;
            //        w = w + second;
            //        second = w;
            //    }
            //    packet.Token[i * 2] = first;
            //    packet.Token[i * 2 + 1] = second;
            //}
            virtualClient.SendPacket(packet);
        }