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"); }); }
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(); }
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(); }
public AutoSpoof(BnetPacketParser parser, DInputHook diHook) { this.diHook = diHook; parser.chatMessageHandler.Events[(int)ChatEventID.Whisper].Event += new ChatEventEvent.ChatEventHandler(OnWhisper); }