public Main( RemoteHooking.IContext InContext, string serverName ) { mySendClientQueue = new Queue<Packet>(); mySendClientLock = new object(); mySendServerQueue = new Queue<Packet>(); mySendServerLock = new object(); myRecvFilter = new bool[256]; mySendFilter = new bool[256]; myRecvDelegate = new dSendRecv( ReceiveHook ); mySendDelegate = new dSendRecv( SendHook ); myPID = RemoteHooking.GetCurrentProcessId(); myThreadID = RemoteHooking.GetCurrentThreadId(); myDateStamp = GetDateStamp(); myServerSendBuffer = Marshal.AllocHGlobal( 65536 ); myClientSendBuffer = Marshal.AllocHGlobal( 65536 ); myServerBufferAddress = BitConverter.GetBytes( myServerSendBuffer.ToInt32() ); myClientBufferAddress = BitConverter.GetBytes( myClientSendBuffer.ToInt32() ); myClientInstance = new ClientInstance( serverName, true ); myClientInstance.SendCommand( Command.ClientID, myPID ); myClientInstance.SendPacketEvent += new dSendPacket( myClientInstance_sendPacketEvent ); myClientInstance.PingEvent += new dPing( myClientInstance_pingEvent ); myClientInstance.AddRecvFilterEvent += new dAddRecvFilter( myClientInstance_addRecvFilterEvent ); myClientInstance.AddSendFilterEvent += new dAddSendFilter( myClientInstance_addSendFilterEvent ); myClientInstance.RemoveRecvFilterEvent += new dRemoveRecvFilter( myClientInstance_removeRecvFilterEvent ); myClientInstance.RemoveSendFilterEvent += new dRemoveSendFilter( myClientInstance_removeSendFilterEvent ); myClientInstance.ClearRecvFilterEvent += new dClearRecvFilter( myClientInstance_clearRecvFilterEvent ); myClientInstance.ClearSendFilterEvent += new dClearSendFilter( myClientInstance_clearSendFilterEvent ); }
public Main(RemoteHooking.IContext InContext, string serverName) { mySendClientQueue = new Queue <Packet>(); mySendClientLock = new object(); mySendServerQueue = new Queue <Packet>(); mySendServerLock = new object(); myRecvFilter = new PacketFilter(); mySendFilter = new PacketFilter(); myRecvDelegate = new dSendRecv(ReceiveHook); mySendDelegate = new dSendRecv(SendHook); myPID = RemoteHooking.GetCurrentProcessId(); myThreadID = RemoteHooking.GetCurrentThreadId(); myDateStamp = GetDateStamp(); myServerSendBuffer = Marshal.AllocHGlobal(65536); myClientSendBuffer = Marshal.AllocHGlobal(65536); myServerBufferAddress = BitConverter.GetBytes(myServerSendBuffer.ToInt32()); myClientBufferAddress = BitConverter.GetBytes(myClientSendBuffer.ToInt32()); myClientInstance = new ClientInstance(serverName, true); myClientInstance.SendCommand(Command.ClientID, myPID); myClientInstance.SendPacketEvent += new dSendPacket(myClientInstance_sendPacketEvent); myClientInstance.PingEvent += new dPing(myClientInstance_pingEvent); myClientInstance.AddRecvFilterEvent += new dAddRecvFilter(myClientInstance_addRecvFilterEvent); myClientInstance.AddSendFilterEvent += new dAddSendFilter(myClientInstance_addSendFilterEvent); myClientInstance.RemoveRecvFilterEvent += new dRemoveRecvFilter(myClientInstance_removeRecvFilterEvent); myClientInstance.RemoveSendFilterEvent += new dRemoveSendFilter(myClientInstance_removeSendFilterEvent); myClientInstance.ClearRecvFilterEvent += new dClearRecvFilter(myClientInstance_clearRecvFilterEvent); myClientInstance.ClearSendFilterEvent += new dClearSendFilter(myClientInstance_clearSendFilterEvent); myClientInstance.SendCommand(Command.Message, "ClientHook Main()"); }
public Main(RemoteHooking.IContext InContext, string serverName) { mySocketReady = false; myRecvFilter = new bool[256]; mySendFilter = new bool[256]; mySocket = 0; myRecvDelegate = new dSendRecv(ReceiveHook); mySendDelegate = new dSendRecv(SendHook); mySocketDelegate = new dSocket(SocketHook); myCloseSocketDelegate = new dCloseSocket(SocketCloseHook); myClientSendLock = new object(); myPID = RemoteHooking.GetCurrentProcessId(); myThreadID = RemoteHooking.GetCurrentThreadId(); myDateStamp = GetDateStamp(); if (myDateStamp >= 1183740939) { myNewStylePackets = true; } else { myNewStylePackets = false; } myServerSendBuffer = Marshal.AllocHGlobal(65536); myClientSendBuffer = Marshal.AllocHGlobal(65536); myServerBufferAddress = BitConverter.GetBytes(myServerSendBuffer.ToInt32()); myClientBufferAddress = BitConverter.GetBytes(myClientSendBuffer.ToInt32()); myClientInstance = new ClientInstance(serverName, true); myClientInstance.SendCommand(Command.ClientID, myPID); myClientInstance.SendPacketEvent += new dSendPacket(myClientInstance_sendPacketEvent); myClientInstance.PingEvent += new dPing(myClientInstance_pingEvent); myClientInstance.AddRecvFilterEvent += new dAddRecvFilter(myClientInstance_addRecvFilterEvent); myClientInstance.AddSendFilterEvent += new dAddSendFilter(myClientInstance_addSendFilterEvent); myClientInstance.RemoveRecvFilterEvent += new dRemoveRecvFilter(myClientInstance_removeRecvFilterEvent); myClientInstance.RemoveSendFilterEvent += new dRemoveSendFilter(myClientInstance_removeSendFilterEvent); myClientInstance.ClearRecvFilterEvent += new dClearRecvFilter(myClientInstance_clearRecvFilterEvent); myClientInstance.ClearSendFilterEvent += new dClearSendFilter(myClientInstance_clearSendFilterEvent); BuildDefaultPacketFilters(); }