コード例 #1
0
        public static void ReadCommands()
        {
            while (true)
            {
                Thread.Sleep(1);

                Console.WriteLine("AWPS >> ");

                var command = Console.ReadLine();
                var name    = "";

                if (command.ToLower() != "start")
                {
                    if (command.ToLower().StartsWith("start"))
                    {
                        name    = command.Substring(6).Replace(@"""", "");
                        command = "start";
                    }
                }

                switch (command.ToLower())
                {
                case "start":
                    PacketLog.Initialize("PacketDumps", name != "" ? name : "Dump");

                    Console.WriteLine("Starting Arctium WoW Packet Sniffer...");

                    if (!PacketLog.IsRunning)
                    {
                        if (receive == null)
                        {
                            receive = new ReceiveHook();
                        }
                        else
                        {
                            receive.Start();
                        }

                        if (send == null)
                        {
                            send = new SendHook();
                        }
                        else
                        {
                            send.Start();
                        }

                        PacketLog.IsRunning = true;
                    }

                    break;

                case "stop":
                    receive.Remove();
                    send.Remove();

                    PacketLog.IsRunning = false;

                    break;

                default:
                    Console.WriteLine("Command '{0}' not supported!", command);
                    ReadCommands();
                    break;
                }
            }
        }
コード例 #2
0
ファイル: Awps.cs プロジェクト: aceindy/ArctiumTools
        public static void ReadCommands()
        {
            while (true)
            {
                Thread.Sleep(1);

                Console.WriteLine("AWPS >> ");

                var command = Console.ReadLine();
                var name = "";

                if (command.ToLower() != "start")
                    if (command.ToLower().StartsWith("start"))
                    {
                        name = command.Substring(6).Replace(@"""", "");
                        command = "start";
                    }

                switch (command.ToLower())
                {
                    case "start":
                        PacketLog.Initialize("PacketDumps", name != "" ? name : "Dump");

                        Console.WriteLine("Starting Arctium WoW Packet Sniffer...");

                        if (!PacketLog.IsRunning)
                        {
                            if (receive == null)
                                receive = new ReceiveHook();
                            else
                                receive.Start();

                            if (send == null)
                                send = new SendHook();
                            else
                                send.Start();

                            PacketLog.IsRunning = true;
                        }

                        break;
                    case "stop":
                        receive.Remove();
                        send.Remove();

                        PacketLog.IsRunning = false;

                        break;
                    default:
                        Console.WriteLine("Command '{0}' not supported!", command);
                        ReadCommands();
                        break;
                }
            }
        }