Пример #1
0
        public static void HandleLoginSuccessPacket(CoCClient client, IPacket packet)
        {
            var lsPacket = packet as LoginSuccessPacket;

            Console.WriteLine("[*] logged in successfully\n");
            client.LoggedIn = true;
        }
Пример #2
0
 public KeepAliveManager(CoCClient client)
 {
     Delay           = 5;
     Client          = client;
     NextKeepAlive   = DateTime.Now;
     LastKeepAlive   = DateTime.MaxValue;
     KeepAliveThread = new Thread(UpdateKeepAlives);
 }
Пример #3
0
        public static void HandleLoginFailedPacket(CoCClient client, IPacket packet)
        {
            var lfPacket = packet as LoginFailedPacket;

            Console.WriteLine("[-] failed to login, reason: {0}", lfPacket.FailureReason);
            switch (lfPacket.FailureReason)
            {
            case LoginFailedPacket.LoginFailureReason.OutdatedContent:
                if (lfPacket.Fingerprint != null)
                {
                    var fingerprintJson = lfPacket.Fingerprint.ToJson();
                    Console.WriteLine("[-] dumping fingerprint.json");
                    File.WriteAllText("fingerprint.json", fingerprintJson);

                    Console.WriteLine("[-] server expected hash: {0}", lfPacket.Fingerprint.Hash);
                    client.MasterHash = lfPacket.Fingerprint.Hash;
                }
                break;
            }
        }
Пример #4
0
 public static void RegisterLoginPacketHandlers(CoCClient client)
 {
     client.RegisterDefaultPacketHandler(new LoginFailedPacket(), HandleLoginFailedPacket);
     client.RegisterDefaultPacketHandler(new LoginSuccessPacket(), HandleLoginSuccessPacket);
     client.RegisterDefaultPacketHandler(new UpdateKeyPacket(), HandleUpdateKeyPacket);
 }
Пример #5
0
 public static void HandleUpdateKeyPacket(CoCClient client, IPacket packet)
 {
     Console.WriteLine("[*] updated ciphers with new server key");
 }