Ejemplo n.º 1
0
        public static void HandleLoginSuccessPacket(CoCClient client, IPacket packet)
        {
            var lsPacket = packet as LoginSuccessPacket;

            Console.WriteLine("[*] logged in successfully\n");
            client.LoggedIn = true;
        }
Ejemplo n.º 2
0
 public KeepAliveManager(CoCClient client)
 {
     Delay           = 5;
     Client          = client;
     NextKeepAlive   = DateTime.Now;
     LastKeepAlive   = DateTime.MaxValue;
     KeepAliveThread = new Thread(UpdateKeepAlives);
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 4
0
 public static void RegisterLoginPacketHandlers(CoCClient client)
 {
     client.RegisterDefaultPacketHandler(new LoginFailedPacket(), HandleLoginFailedPacket);
     client.RegisterDefaultPacketHandler(new LoginSuccessPacket(), HandleLoginSuccessPacket);
     client.RegisterDefaultPacketHandler(new UpdateKeyPacket(), HandleUpdateKeyPacket);
 }
Ejemplo n.º 5
0
 public static void HandleUpdateKeyPacket(CoCClient client, IPacket packet)
 {
     Console.WriteLine("[*] updated ciphers with new server key");
 }