public void SendPacket(byte[] packetData) { IntPtr openProcessHandle = MemoryManager.OpenProcessHandle; int num = InjectHelper.AllocateMemory(openProcessHandle, (int)packetData.Length); MemoryManager.WriteBytes(num, packetData); byte[] bytes = BitConverter.GetBytes(num); if (this._sendPacketOpcodeAddress == 0) { this.LoadSendPacketOpcode(openProcessHandle); } MemoryManager.WriteBytes(this._packetAddressLocation, bytes); MemoryManager.WriteBytes(this._packetSizeAddress, BitConverter.GetBytes((int)packetData.Length)); IntPtr intPtr = InjectHelper.CreateRemoteThread(openProcessHandle, this._sendPacketOpcodeAddress); WinApi.WaitForSingleObject(intPtr, 100); WinApi.CloseHandle(intPtr); InjectHelper.FreeMemory(openProcessHandle, num, (int)packetData.Length); InjectHelper.FreeMemory(openProcessHandle, this._sendPacketOpcodeAddress, (int)this._sendPacketOpcode.Length); }