Exemple #1
0
        public void BitLockerListingTest()
        {
            IBLVMServer server = new IBLVMServer(new SessionControl());

            server.Bind(new IPEndPoint(IPAddress.Any, 47859));
            server.Listen(5);
            server.Start();

            IBLVMClient client = new IBLVMClient();

            client.Connect(new IPEndPoint(AccessIP, 47859));
            while (client.Status != (int)ClientSocketStatus.Connected)
            {
                ;
            }

            client.Login("Test", "Test");
            while (client.Status != (int)ClientSocketStatus.LoggedIn)
            {
                ;
            }

            IBLVMManager manager = new IBLVMManager();

            manager.Conncet(new IPEndPoint(IPAddress.Loopback, 47859));
            client.Dispose();
            server.Dispose();
        }
Exemple #2
0
        public void IVExchangeTest()
        {
            IBLVMServer server = new IBLVMServer(new SessionControl());

            server.Bind(new IPEndPoint(IPAddress.Any, 47860));
            server.Listen(5);
            server.Start();

            IBLVMClient client = new IBLVMClient();

            client.Connect(new IPEndPoint(AccessIP, 47860));
            while (client.Status != (int)ClientSocketStatus.Connected)
            {
                ;
            }

            client.Login("Test", "Test");
            while (client.Status != (int)ClientSocketStatus.LoggedIn)
            {
                ;
            }

            client.ExchangeIV();
            byte[] nextIV = client.CryptoProvider.NextIV;

            while (!nextIV.SequenceEqual(client.CryptoProvider.CryptoStream.IV))
            {
                ;
            }
            client.Dispose();
            server.Dispose();
        }
Exemple #3
0
        public void DeviceListingTest()
        {
            bool        isEndable = false;
            IBLVMServer server    = new IBLVMServer(new SessionControl());

            server.Bind(new IPEndPoint(IPAddress.Any, 40001));
            server.Listen(5);
            server.Start();

            IBLVMClient client = new IBLVMClient();

            client.Connect(new IPEndPoint(AccessIP, 40001));
            while (client.Status != (int)ClientSocketStatus.Connected)
            {
                ;
            }

            client.Login("1234", "1234");
            while (client.Status != (int)ClientSocketStatus.LoggedIn)
            {
                ;
            }


            IBLVMManager manager = new IBLVMManager();

            manager.Conncet(new IPEndPoint(AccessIP, 40001));

            while (manager.Status != (int)ClientSocketStatus.Connected)
            {
                ;
            }
            manager.Login("1234", "1234");

            while (manager.Status != (int)ClientSocketStatus.LoggedIn)
            {
                ;
            }
            manager.OnDevicesReceived += (a) =>
            {
                foreach (var device in a)
                {
                    Console.WriteLine(device.ToString());
                }

                isEndable = true;
            };

            manager.GetDeviceList();

            while (manager.Status != (int)ClientSocketStatus.LoggedIn || !isEndable)
            {
                ;
            }
            server.Dispose();
            manager.Dispose();
        }
Exemple #4
0
        void ConnectClient(IPEndPoint address)
        {
            IBLVMClient client = new IBLVMClient();

            client.Connect(address);
            while (client.Status != (int)ClientSocketStatus.Connected)
            {
                ;
            }

            client.Login("1234", "1234");
            while (client.Status != (int)ClientSocketStatus.LoggedIn)
            {
                ;
            }
        }
Exemple #5
0
        private static void Login(IBLVMClient client)
        {
            Console.WriteLine("Connected!");
            Console.WriteLine("Please login to server.");
            Console.Write("ID :");
            string id = Console.ReadLine();

            Console.Write("Password : ");
            string password = Console.ReadLine();


            client.Login(id, password);
            while (client.Status != (int)ClientSocketStatus.LoggedIn)
            {
                ;
            }
        }
Exemple #6
0
        public void HandshakeTest()
        {
            IBLVMServer server = new IBLVMServer(new SessionControl());

            server.Bind(new IPEndPoint(IPAddress.Any, 47857));
            server.Listen(5);

            server.Start();

            IBLVMClient client = new IBLVMClient();

            client.Connect(new IPEndPoint(AccessIP, 47857));

            while (client.Status != (int)ClientSocketStatus.Connected)
            {
                ;
            }
            client.Dispose();
            server.Dispose();
        }
Exemple #7
0
        static void Main(string[] args)
        {
            while (true)
            {
                try
                {
                    IBLVMClient client = new IBLVMClient();
                    Console.WriteLine("Please enter server address.");
                    client.Connect(new IPEndPoint(IPAddress.Parse(Console.ReadLine()), 54541));
                    while (client.Status != (int)ClientSocketStatus.Connected)
                    {
                        ;
                    }

                    Login(client);
                    Console.WriteLine("Successfully logged in!");
                    client.Receiver.Join();
                }
                catch (Exception)
                {
                    continue;
                }
            }
        }