예제 #1
0
        public static void RegisterPlugins(BnetPacketParser parser)
        {
            Process wc3p = Process.GetProcessesByName("war3")[0];
            IntPtr wc3 = wc3p.MainWindowHandle;
            DInputHook diHook = new DInputHook(wc3);

            new THRGamesList(parser, diHook);
            new AutoSpoof(parser, diHook);
        }
        public ChatMessagePacketHandler(BnetPacketParser parser)
        {
            parser.Events[(int)BattleNetPacketID.ChatEvent].Event += new PacketEvent.PacketEventHandler(OnPacket);

            for (int i = 0; i < Events.Length; i++)
                Events[i] = new ChatEventEvent();

            //Events[(int)ChatEventID.Info].Event += new ChatEventEvent.ChatEventHandler((object o, PcapCaptureEventArgs e) => { Console.WriteLine("Stuff"); });
        }
예제 #3
0
 public THRGamesList(BnetPacketParser parser, DInputHook diHook)
 {
     parser.chatMessageHandler.Events[(int)ChatEventID.Emote].Event +=
         new ChatEventEvent.ChatEventHandler(OnEmote);
     parser.chatMessageHandler.Events[(int)ChatEventID.Channel].Event +=
         new ChatEventEvent.ChatEventHandler(OnJoin);
     form = new THRGamesListForm();
     Thread formThread = new Thread(new ThreadStart(OpenForm));
     formThread.Start();
 }
예제 #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("SharpPcap Version: {0}", SharpPcap.Version.VersionString);

            PcapDevice device = AskForDevice();

            Console.WriteLine("Selected device description: {0:s}", device.Description);

            BnetPacketParser parser = new BnetPacketParser();

            device.OnPacketArrival += new Pcap.PacketArrivalEvent(parser.OnPacketArrival);

            device.Open();
            device.SetFilter("port 6112");

            RegisterPlugins(parser);

            device.StartCapture();
            Console.ReadLine();
            device.StopCapture();
        }
예제 #5
0
 public AutoSpoof(BnetPacketParser parser, DInputHook diHook)
 {
     this.diHook = diHook;
     parser.chatMessageHandler.Events[(int)ChatEventID.Whisper].Event +=
         new ChatEventEvent.ChatEventHandler(OnWhisper);
 }