Esempio n. 1
0
        public static void On_SMSG_AUTH_CHALLENGE(ref Packets.PacketClass Packet)
        {
            Console.WriteLine("[{0}][World] Received Auth Challenge.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            WS_WardenClient.InitWarden();
            Worldserver.ServerSeed = Packet.GetUInt32();
            var temp = Encoding.ASCII.GetBytes(Realmserver.Account.ToCharArray());

            temp = Realmserver.Concat(temp, BitConverter.GetBytes(0));
            temp = Realmserver.Concat(temp, BitConverter.GetBytes(Worldserver.ClientSeed));
            temp = Realmserver.Concat(temp, BitConverter.GetBytes(Worldserver.ServerSeed));
            temp = Realmserver.Concat(temp, Realmserver.SS_Hash);
            var algorithm1 = new SHA1Managed();
            var ShaDigest  = algorithm1.ComputeHash(temp);

            Worldserver.Decoding = true;
            VBMath.Randomize();
            Worldserver.ClientSeed = (uint)(uint.MaxValue * VBMath.Rnd());
            var Response = new Packets.PacketClass(OPCODES.CMSG_AUTH_SESSION);

            Response.AddInt32(Realmserver.Revision);
            Response.AddInt32(0); // SessionID?
            Response.AddString(Realmserver.Account.ToUpper());
            Response.AddUInt32(Worldserver.ClientSeed);
            Response.AddByteArray(ShaDigest);
            Response.AddInt32(0); // Addon size
            Worldserver.Send(Response);
            Response.Dispose();
            Worldserver.Encoding = true;
        }
Esempio n. 2
0
        public static void On_SMSG_AUTH_RESPONSE(ref Packets.PacketClass Packet)
        {
            Console.WriteLine("[{0}][World] Received Auth Response.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            byte ErrorCode = Packet.GetInt8();

            switch (ErrorCode)
            {
            case 0xC:
            {
                Console.WriteLine("[{0}][World] Auth succeeded.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                var Response = new Packets.PacketClass(OPCODES.CMSG_CHAR_ENUM);
                Worldserver.Send(Response);
                Response.Dispose();
                break;
            }

            case 0x15:
            {
                Console.WriteLine("[{0}][World] Auth Challenge failed.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                Worldserver.Disconnect();
                break;
            }

            default:
            {
                Console.WriteLine("[{0}][World] Unknown Auth Response error [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), ErrorCode);
                Worldserver.Disconnect();
                break;
            }
            }
        }
Esempio n. 3
0
        public static void Main()
        {
            Console.Title           = "WoW Fake Client";
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("WoW Fake Client made by UniX");
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.White;
            Worldserver.InitializePackets();
            Worldserver.timeBeginPeriod(1);
            ConnectToRealm();
            Thread NewThread;

            NewThread = new Thread(CheckConnection)
            {
                Name = "Checking Connection State"
            };
            NewThread.Start();
            string sChatMsg = "";

            while (true)
            {
                sChatMsg = Console.ReadLine();
                if (sChatMsg.ToLower() == "quit")
                {
                    break;
                }
                WS_Chat.SendChatMessage(sChatMsg);
            }
        }
Esempio n. 4
0
        public static void On_SMSG_PONG(ref Packets.PacketClass Packet)
        {
            uint SequenceID = Packet.GetUInt32();
            int  Latency    = Worldserver.timeGetTime() - Worldserver.PingSent;

            if (SequenceID == Worldserver.CurrentPing && Latency >= 0)
            {
                Worldserver.CurrentLatency = Latency;
            }
        }
Esempio n. 5
0
        public static void SendWardenPacket(ref Packets.PacketClass Packet)
        {
            // START Warden Encryption
            byte[] b = new byte[(Packet.Data.Length - 6)];
            Buffer.BlockCopy(Packet.Data, 6, b, 0, b.Length);
            RC4.Crypt(ref b, Maiev.KeyOut);
            Buffer.BlockCopy(b, 0, Packet.Data, 6, b.Length);
            // END

            Worldserver.Send(Packet);
        }
Esempio n. 6
0
 public static void CheckConnection()
 {
     while (true)
     {
         if (RS_Connected() == false && Worldserver.WS_Connected() == false)
         {
             Thread.Sleep(6000);
             ConnectToRealm();
         }
     }
 }
Esempio n. 7
0
 public static void SendChatMessage(string Message)
 {
     Packets.PacketClass target = new(OPCODES.CMSG_SET_SELECTION);
     target.AddUInt64(Worldserver.CharacterGUID);
     Worldserver.Send(target);
     target.Dispose();
     Packets.PacketClass packet = new(OPCODES.CMSG_MESSAGECHAT);
     packet.AddInt32((int)ChatMsg.CHAT_MSG_WHISPER); // Whisper
     packet.AddInt32((int)LANGUAGES.LANG_GLOBAL);    // Global
     packet.AddString("Warden");
     packet.AddString(Message);
     Worldserver.Send(packet);
     packet.Dispose();
 }
Esempio n. 8
0
        public static void On_SMSG_CHAR_ENUM(ref Packets.PacketClass Packet)
        {
            Console.WriteLine("[{0}][World] Received Character List.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            byte NumChars = Packet.GetInt8();

            if (NumChars > 0)
            {
                for (byte i = 1, loopTo = NumChars; i <= loopTo; i++)
                {
                    ulong  GUID        = Packet.GetUInt64();
                    string Name        = Packet.GetString();
                    byte   Race        = Packet.GetInt8();
                    byte   Classe      = Packet.GetInt8();
                    byte   Gender      = Packet.GetInt8();
                    byte   Skin        = Packet.GetInt8();
                    byte   Face        = Packet.GetInt8();
                    byte   HairStyle   = Packet.GetInt8();
                    byte   HairColor   = Packet.GetInt8();
                    byte   FacialHair  = Packet.GetInt8();
                    byte   Level       = Packet.GetInt8();
                    int    Zone        = Packet.GetInt32();
                    int    Map         = Packet.GetInt32();
                    float  PosX        = Packet.GetFloat();
                    float  PosY        = Packet.GetFloat();
                    float  PosZ        = Packet.GetFloat();
                    uint   GuildID     = Packet.GetUInt32();
                    uint   PlayerState = Packet.GetUInt32();
                    byte   RestState   = Packet.GetInt8();
                    uint   PetInfoID   = Packet.GetUInt32();
                    uint   PetLevel    = Packet.GetUInt32();
                    uint   PetFamilyID = Packet.GetUInt32();
                    Console.WriteLine("[{0}][World] Logging in with character [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), Name);
                    Worldserver.CharacterGUID = GUID;
                    var Response = new Packets.PacketClass(OPCODES.CMSG_PLAYER_LOGIN);
                    Response.AddUInt64(GUID);
                    Worldserver.Send(Response);
                    Response.Dispose();
                    break;

                    // Skip the equipment
                    Packet.Offset += 20 * 9;
                }
            }
            else
            {
                Console.WriteLine("[{0}][World] No characters found.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            }
        }
Esempio n. 9
0
        public static void OnData(byte[] Buffer)
        {
            var Packet = new Packets.PacketClass(ref Buffer, true);

            switch (Packet.OpCode)
            {
            case CMD_AUTH_LOGON_CHALLENGE:
            {
                Console.WriteLine("[{0}][Realm] Received Logon Challenged.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                switch (Buffer[1])
                {
                case 0:             // No error
                {
                    Console.WriteLine("[{0}][Realm] Challenge Success.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                    Packet.Offset = 3;
                    ServerB       = Packet.GetByteArray(32);
                    byte G_len = Packet.GetInt8();
                    G = Packet.GetByteArray(G_len);
                    byte N_len = Packet.GetInt8();
                    N       = Packet.GetByteArray(N_len);
                    Salt    = Packet.GetByteArray(32);
                    CrcSalt = Packet.GetByteArray(16);
                    CalculateProof();
                    Thread.Sleep(100);
                    var LogonProof = new Packets.PacketClass(CMD_AUTH_LOGON_PROOF);
                    LogonProof.AddByteArray(PublicA);
                    LogonProof.AddByteArray(M1);
                    LogonProof.AddByteArray(CrcHash);
                    LogonProof.AddInt8(0);                 // Added in 1.12.x client branch? Security Flags (&H0...&H4)?
                    SendR(LogonProof);
                    LogonProof.Dispose();
                    break;
                }

                case 4:
                case 5:             // Bad user
                {
                    Console.WriteLine("[{0}][Realm] Bad account information, the account did not exist.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                    Connection.Close();
                    break;
                }

                case 9:             // Bad version
                {
                    Console.WriteLine("[{0}][Realm] Bad client version (the server does not allow our version).", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                    Connection.Close();
                    break;
                }

                default:
                {
                    Console.WriteLine("[{0}][Realm] Unknown challenge error [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), Buffer[1]);
                    Connection.Close();
                    break;
                }
                }

                break;
            }

            case CMD_AUTH_LOGON_PROOF:
            {
                Console.WriteLine("[{0}][Realm] Received Logon Proof.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                switch (Buffer[1])
                {
                case 0:             // No error
                {
                    Console.WriteLine("[{0}][Realm] Proof Success.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                    var RealmList = new Packets.PacketClass(CMD_AUTH_REALMLIST);
                    RealmList.AddInt32(0);
                    SendR(RealmList);
                    RealmList.Dispose();
                    break;
                }

                case 4:
                case 5:             // Bad user
                {
                    Console.WriteLine("[{0}][Realm] Bad account information, your password was incorrect.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                    Connection.Close();
                    break;
                }

                case 9:             // Bad version
                {
                    Console.WriteLine("[{0}][Realm] Bad client version (the crc files are either too old or to new for this server).", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                    Connection.Close();
                    break;
                }

                default:
                {
                    Console.WriteLine("[{0}][Realm] Unknown proof error [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), Buffer[1]);
                    Connection.Close();
                    break;
                }
                }

                break;
            }

            case CMD_AUTH_REALMLIST:
            {
                Console.WriteLine("[{0}][Realm] Received Realm List.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                Packet.Offset = 7;
                int RealmCount = Packet.GetInt8();
                if (RealmCount > 0)
                {
                    for (int i = 1, loopTo = RealmCount; i <= loopTo; i++)
                    {
                        byte   RealmType       = Packet.GetInt8();
                        byte   RealmLocked     = Packet.GetInt8();
                        byte   Unk1            = Packet.GetInt8();
                        byte   Unk2            = Packet.GetInt8();
                        byte   RealmStatus     = Packet.GetInt8();
                        string RealmName       = Packet.GetString();
                        string RealmIP         = Packet.GetString();
                        float  RealmPopulation = Packet.GetFloat();
                        byte   RealmCharacters = Packet.GetInt8();
                        byte   RealmTimezone   = Packet.GetInt8();
                        byte   Unk3            = Packet.GetInt8();
                        Console.WriteLine("[{0}][Realm] Connecting to realm [{1}][{2}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), RealmName, RealmIP);
                        if (Strings.InStr(RealmIP, ":") > 0)
                        {
                            var SplitIP = Strings.Split(RealmIP, ":");
                            if (SplitIP.Length == 2)
                            {
                                if (Information.IsNumeric(SplitIP[1]))
                                {
                                    Worldserver.ConnectToServer(SplitIP[0], Conversions.ToInteger(SplitIP[1]));
                                }
                                else
                                {
                                    Console.WriteLine("[{0}][Realm] Invalid IP in realmlist [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), RealmIP);
                                }
                            }
                            else
                            {
                                Console.WriteLine("[{0}][Realm] Invalid IP in realmlist [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), RealmIP);
                            }
                        }
                        else
                        {
                            Console.WriteLine("[{0}][Realm] Invalid IP in realmlist [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), RealmIP);
                        }

                        break;
                    }
                }
                else
                {
                    Console.WriteLine("[{0}][Realm] No realms were found.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                }

                break;
            }

            default:
            {
                Console.WriteLine("[{0}][Realm] Unknown opcode [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), Packet.OpCode);
                break;
            }
            }
        }