mirror of https://github.com/quasar/Quasar.git
Merge pull request #496 from Abdullah2993/dev
Tests added for packet registeration for serialization
This commit is contained in:
commit
97e54f5790
|
@ -46,7 +46,9 @@
|
||||||
</When>
|
</When>
|
||||||
<Otherwise>
|
<Otherwise>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Otherwise>
|
</Otherwise>
|
||||||
</Choose>
|
</Choose>
|
||||||
|
@ -56,6 +58,7 @@
|
||||||
<Compile Include="Core\Compression\SafeQuickLZ.Tests.cs" />
|
<Compile Include="Core\Compression\SafeQuickLZ.Tests.cs" />
|
||||||
<Compile Include="Core\Encryption\AES.Tests.cs" />
|
<Compile Include="Core\Encryption\AES.Tests.cs" />
|
||||||
<Compile Include="Core\Encryption\SHA256.Tests.cs" />
|
<Compile Include="Core\Encryption\SHA256.Tests.cs" />
|
||||||
|
<Compile Include="Core\Packet\Packet.Tests.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Linq;
|
||||||
|
using xClient.Core.Packets;
|
||||||
|
|
||||||
|
namespace xClient.Tests.Core.Packet
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class PacketTest
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void AreAllPacketsRegistered()
|
||||||
|
{
|
||||||
|
var asm = Assembly.Load("Client");
|
||||||
|
var expectedPacketTypes = asm.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IPacket)) && t.GetCustomAttributes(typeof(SerializableAttribute), false).Any()).ToArray();
|
||||||
|
var registeredPackets = PacketRegistery.GetPacketTypes();
|
||||||
|
CollectionAssert.AreEquivalent(expectedPacketTypes, registeredPackets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -143,6 +143,7 @@
|
||||||
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" />
|
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" />
|
||||||
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryValueResponse.cs" />
|
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryValueResponse.cs" />
|
||||||
<Compile Include="Core\Packets\ClientPackets\SetStatusFileManager.cs" />
|
<Compile Include="Core\Packets\ClientPackets\SetStatusFileManager.cs" />
|
||||||
|
<Compile Include="Core\Packets\PacketRegistery.cs" />
|
||||||
<Compile Include="Core\Packets\ServerPackets\DoWebcamStop.cs" />
|
<Compile Include="Core\Packets\ServerPackets\DoWebcamStop.cs" />
|
||||||
<Compile Include="Core\Packets\ServerPackets\DoAskElevate.cs" />
|
<Compile Include="Core\Packets\ServerPackets\DoAskElevate.cs" />
|
||||||
<Compile Include="Core\Packets\ServerPackets\DoChangeRegistryValue.cs" />
|
<Compile Include="Core\Packets\ServerPackets\DoChangeRegistryValue.cs" />
|
||||||
|
|
|
@ -24,86 +24,7 @@ namespace xClient.Core.Networking
|
||||||
{
|
{
|
||||||
this._hosts = hostsManager;
|
this._hosts = hostsManager;
|
||||||
|
|
||||||
base.Serializer = new Serializer(new Type[]
|
base.Serializer = new Serializer(PacketRegistery.GetPacketTypes());
|
||||||
{
|
|
||||||
typeof (Packets.ServerPackets.GetAuthentication),
|
|
||||||
typeof (Packets.ServerPackets.DoClientDisconnect),
|
|
||||||
typeof (Packets.ServerPackets.DoClientReconnect),
|
|
||||||
typeof (Packets.ServerPackets.DoClientUninstall),
|
|
||||||
typeof (Packets.ServerPackets.DoWebcamStop),
|
|
||||||
typeof (Packets.ServerPackets.DoAskElevate),
|
|
||||||
typeof (Packets.ServerPackets.DoDownloadAndExecute),
|
|
||||||
typeof (Packets.ServerPackets.DoUploadAndExecute),
|
|
||||||
typeof (Packets.ServerPackets.GetDesktop),
|
|
||||||
typeof (Packets.ServerPackets.GetProcesses),
|
|
||||||
typeof (Packets.ServerPackets.DoProcessKill),
|
|
||||||
typeof (Packets.ServerPackets.DoProcessStart),
|
|
||||||
typeof (Packets.ServerPackets.GetDrives),
|
|
||||||
typeof (Packets.ServerPackets.GetDirectory),
|
|
||||||
typeof (Packets.ServerPackets.DoDownloadFile),
|
|
||||||
typeof (Packets.ServerPackets.DoMouseEvent),
|
|
||||||
typeof (Packets.ServerPackets.DoKeyboardEvent),
|
|
||||||
typeof (Packets.ServerPackets.GetSystemInfo),
|
|
||||||
typeof (Packets.ServerPackets.DoVisitWebsite),
|
|
||||||
typeof (Packets.ServerPackets.DoShowMessageBox),
|
|
||||||
typeof (Packets.ServerPackets.DoClientUpdate),
|
|
||||||
typeof (Packets.ServerPackets.GetMonitors),
|
|
||||||
typeof (Packets.ServerPackets.GetWebcams),
|
|
||||||
typeof (Packets.ServerPackets.GetWebcam),
|
|
||||||
typeof (Packets.ServerPackets.DoShellExecute),
|
|
||||||
typeof (Packets.ServerPackets.DoPathRename),
|
|
||||||
typeof (Packets.ServerPackets.DoPathDelete),
|
|
||||||
typeof (Packets.ServerPackets.DoShutdownAction),
|
|
||||||
typeof (Packets.ServerPackets.GetStartupItems),
|
|
||||||
typeof (Packets.ServerPackets.DoStartupItemAdd),
|
|
||||||
typeof (Packets.ServerPackets.DoStartupItemRemove),
|
|
||||||
typeof (Packets.ServerPackets.DoDownloadFileCancel),
|
|
||||||
typeof (Packets.ServerPackets.GetKeyloggerLogs),
|
|
||||||
typeof (Packets.ServerPackets.DoUploadFile),
|
|
||||||
typeof (Packets.ServerPackets.GetPasswords),
|
|
||||||
typeof (Packets.ServerPackets.DoLoadRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoCreateRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoDeleteRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoRenameRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoCreateRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.DoDeleteRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.DoRenameRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.DoChangeRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.SetAuthenticationSuccess),
|
|
||||||
typeof (Packets.ServerPackets.GetConnections),
|
|
||||||
typeof (Packets.ServerPackets.DoCloseConnection),
|
|
||||||
typeof (Packets.ClientPackets.GetAuthenticationResponse),
|
|
||||||
typeof (Packets.ClientPackets.SetStatus),
|
|
||||||
typeof (Packets.ClientPackets.SetStatusFileManager),
|
|
||||||
typeof (Packets.ClientPackets.SetUserStatus),
|
|
||||||
typeof (Packets.ClientPackets.GetDesktopResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetProcessesResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDrivesResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDirectoryResponse),
|
|
||||||
typeof (Packets.ClientPackets.DoDownloadFileResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetSystemInfoResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetMonitorsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetWebcamsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetWebcamResponse),
|
|
||||||
typeof (Packets.ClientPackets.DoShellExecuteResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetStartupItemsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetKeyloggerLogsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetPasswordsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetRegistryKeysResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetCreateRegistryKeyResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetCreateRegistryValueResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDeleteRegistryValueResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetRenameRegistryValueResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetChangeRegistryValueResponse),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyConnect),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyConnectResponse),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyData),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyDisconnect),
|
|
||||||
typeof (Packets.ClientPackets.GetConnectionsResponse)
|
|
||||||
|
|
||||||
});
|
|
||||||
base.ClientState += OnClientState;
|
base.ClientState += OnClientState;
|
||||||
base.ClientRead += OnClientRead;
|
base.ClientRead += OnClientRead;
|
||||||
base.ClientFail += OnClientFail;
|
base.ClientFail += OnClientFail;
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace xClient.Core.Packets
|
||||||
|
{
|
||||||
|
public class PacketRegistery
|
||||||
|
{
|
||||||
|
public static Type[] GetPacketTypes()
|
||||||
|
{
|
||||||
|
return new Type[]
|
||||||
|
{
|
||||||
|
typeof (Packets.ServerPackets.GetAuthentication),
|
||||||
|
typeof (Packets.ServerPackets.DoClientDisconnect),
|
||||||
|
typeof (Packets.ServerPackets.DoClientReconnect),
|
||||||
|
typeof (Packets.ServerPackets.DoClientUninstall),
|
||||||
|
typeof (Packets.ServerPackets.DoWebcamStop),
|
||||||
|
typeof (Packets.ServerPackets.DoAskElevate),
|
||||||
|
typeof (Packets.ServerPackets.DoDownloadAndExecute),
|
||||||
|
typeof (Packets.ServerPackets.DoUploadAndExecute),
|
||||||
|
typeof (Packets.ServerPackets.GetDesktop),
|
||||||
|
typeof (Packets.ServerPackets.GetProcesses),
|
||||||
|
typeof (Packets.ServerPackets.DoProcessKill),
|
||||||
|
typeof (Packets.ServerPackets.DoProcessStart),
|
||||||
|
typeof (Packets.ServerPackets.GetDrives),
|
||||||
|
typeof (Packets.ServerPackets.GetDirectory),
|
||||||
|
typeof (Packets.ServerPackets.DoDownloadFile),
|
||||||
|
typeof (Packets.ServerPackets.DoMouseEvent),
|
||||||
|
typeof (Packets.ServerPackets.DoKeyboardEvent),
|
||||||
|
typeof (Packets.ServerPackets.GetSystemInfo),
|
||||||
|
typeof (Packets.ServerPackets.DoVisitWebsite),
|
||||||
|
typeof (Packets.ServerPackets.DoShowMessageBox),
|
||||||
|
typeof (Packets.ServerPackets.DoClientUpdate),
|
||||||
|
typeof (Packets.ServerPackets.GetMonitors),
|
||||||
|
typeof (Packets.ServerPackets.GetWebcams),
|
||||||
|
typeof (Packets.ServerPackets.GetWebcam),
|
||||||
|
typeof (Packets.ServerPackets.DoShellExecute),
|
||||||
|
typeof (Packets.ServerPackets.DoPathRename),
|
||||||
|
typeof (Packets.ServerPackets.DoPathDelete),
|
||||||
|
typeof (Packets.ServerPackets.DoShutdownAction),
|
||||||
|
typeof (Packets.ServerPackets.GetStartupItems),
|
||||||
|
typeof (Packets.ServerPackets.DoStartupItemAdd),
|
||||||
|
typeof (Packets.ServerPackets.DoStartupItemRemove),
|
||||||
|
typeof (Packets.ServerPackets.DoDownloadFileCancel),
|
||||||
|
typeof (Packets.ServerPackets.GetKeyloggerLogs),
|
||||||
|
typeof (Packets.ServerPackets.DoUploadFile),
|
||||||
|
typeof (Packets.ServerPackets.GetPasswords),
|
||||||
|
typeof (Packets.ServerPackets.DoLoadRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoCreateRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoDeleteRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoRenameRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoCreateRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.DoDeleteRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.DoRenameRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.DoChangeRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.SetAuthenticationSuccess),
|
||||||
|
typeof (Packets.ServerPackets.GetConnections),
|
||||||
|
typeof (Packets.ServerPackets.DoCloseConnection),
|
||||||
|
typeof (Packets.ClientPackets.GetAuthenticationResponse),
|
||||||
|
typeof (Packets.ClientPackets.SetStatus),
|
||||||
|
typeof (Packets.ClientPackets.SetStatusFileManager),
|
||||||
|
typeof (Packets.ClientPackets.SetUserStatus),
|
||||||
|
typeof (Packets.ClientPackets.GetDesktopResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetProcessesResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDrivesResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDirectoryResponse),
|
||||||
|
typeof (Packets.ClientPackets.DoDownloadFileResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetSystemInfoResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetMonitorsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetWebcamsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetWebcamResponse),
|
||||||
|
typeof (Packets.ClientPackets.DoShellExecuteResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetStartupItemsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetKeyloggerLogsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetPasswordsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetRegistryKeysResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetCreateRegistryKeyResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetCreateRegistryValueResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDeleteRegistryValueResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetRenameRegistryValueResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetChangeRegistryValueResponse),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyConnect),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyConnectResponse),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyData),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyDisconnect),
|
||||||
|
typeof (Packets.ClientPackets.GetConnectionsResponse)
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Linq;
|
||||||
|
using xServer.Core.Packets;
|
||||||
|
|
||||||
|
namespace xServer.Tests.Core.Packet
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class PacketTests
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void AreAllPacketsRegistered()
|
||||||
|
{
|
||||||
|
var asm = Assembly.Load("Quasar");
|
||||||
|
var expectedPacketTypes = asm.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IPacket)) && t.GetCustomAttributes(typeof(SerializableAttribute), false).Any()).ToArray();
|
||||||
|
var registeredPackets = PacketRegistery.GetPacketTypes();
|
||||||
|
CollectionAssert.AreEquivalent(expectedPacketTypes, registeredPackets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -48,13 +48,16 @@
|
||||||
</When>
|
</When>
|
||||||
<Otherwise>
|
<Otherwise>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Otherwise>
|
</Otherwise>
|
||||||
</Choose>
|
</Choose>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Core\Compression\SafeQuickLZ.Tests.cs" />
|
<Compile Include="Core\Compression\SafeQuickLZ.Tests.cs" />
|
||||||
<Compile Include="Core\Encryption\AES.Tests.cs" />
|
<Compile Include="Core\Encryption\AES.Tests.cs" />
|
||||||
|
<Compile Include="Core\Packet\Packet.Tests.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -63,7 +66,6 @@
|
||||||
<Name>Server</Name>
|
<Name>Server</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
|
||||||
<Choose>
|
<Choose>
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -71,86 +71,7 @@ namespace xServer.Core.Networking
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuasarServer() : base()
|
public QuasarServer() : base()
|
||||||
{
|
{
|
||||||
base.Serializer = new Serializer(new Type[]
|
base.Serializer = new Serializer(PacketRegistery.GetPacketTypes());
|
||||||
{
|
|
||||||
typeof (Packets.ServerPackets.GetAuthentication),
|
|
||||||
typeof (Packets.ServerPackets.DoClientDisconnect),
|
|
||||||
typeof (Packets.ServerPackets.DoClientReconnect),
|
|
||||||
typeof (Packets.ServerPackets.DoClientUninstall),
|
|
||||||
typeof (Packets.ServerPackets.DoWebcamStop),
|
|
||||||
typeof (Packets.ServerPackets.DoAskElevate),
|
|
||||||
typeof (Packets.ServerPackets.DoDownloadAndExecute),
|
|
||||||
typeof (Packets.ServerPackets.DoUploadAndExecute),
|
|
||||||
typeof (Packets.ServerPackets.GetDesktop),
|
|
||||||
typeof (Packets.ServerPackets.GetProcesses),
|
|
||||||
typeof (Packets.ServerPackets.DoProcessKill),
|
|
||||||
typeof (Packets.ServerPackets.DoProcessStart),
|
|
||||||
typeof (Packets.ServerPackets.GetDrives),
|
|
||||||
typeof (Packets.ServerPackets.GetDirectory),
|
|
||||||
typeof (Packets.ServerPackets.DoDownloadFile),
|
|
||||||
typeof (Packets.ServerPackets.DoMouseEvent),
|
|
||||||
typeof (Packets.ServerPackets.DoKeyboardEvent),
|
|
||||||
typeof (Packets.ServerPackets.GetSystemInfo),
|
|
||||||
typeof (Packets.ServerPackets.DoVisitWebsite),
|
|
||||||
typeof (Packets.ServerPackets.DoShowMessageBox),
|
|
||||||
typeof (Packets.ServerPackets.DoClientUpdate),
|
|
||||||
typeof (Packets.ServerPackets.GetMonitors),
|
|
||||||
typeof (Packets.ServerPackets.GetWebcams),
|
|
||||||
typeof (Packets.ServerPackets.GetWebcam),
|
|
||||||
typeof (Packets.ServerPackets.DoShellExecute),
|
|
||||||
typeof (Packets.ServerPackets.DoPathRename),
|
|
||||||
typeof (Packets.ServerPackets.DoPathDelete),
|
|
||||||
typeof (Packets.ServerPackets.DoShutdownAction),
|
|
||||||
typeof (Packets.ServerPackets.GetStartupItems),
|
|
||||||
typeof (Packets.ServerPackets.DoStartupItemAdd),
|
|
||||||
typeof (Packets.ServerPackets.DoStartupItemRemove),
|
|
||||||
typeof (Packets.ServerPackets.DoDownloadFileCancel),
|
|
||||||
typeof (Packets.ServerPackets.GetKeyloggerLogs),
|
|
||||||
typeof (Packets.ServerPackets.DoUploadFile),
|
|
||||||
typeof (Packets.ServerPackets.GetPasswords),
|
|
||||||
typeof (Packets.ServerPackets.DoLoadRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoCreateRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoDeleteRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoRenameRegistryKey),
|
|
||||||
typeof (Packets.ServerPackets.DoCreateRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.DoDeleteRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.DoRenameRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.DoChangeRegistryValue),
|
|
||||||
typeof (Packets.ServerPackets.SetAuthenticationSuccess),
|
|
||||||
typeof (Packets.ServerPackets.GetConnections),
|
|
||||||
typeof (Packets.ServerPackets.DoCloseConnection),
|
|
||||||
typeof (Packets.ClientPackets.GetAuthenticationResponse),
|
|
||||||
typeof (Packets.ClientPackets.SetStatus),
|
|
||||||
typeof (Packets.ClientPackets.SetStatusFileManager),
|
|
||||||
typeof (Packets.ClientPackets.SetUserStatus),
|
|
||||||
typeof (Packets.ClientPackets.GetDesktopResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetProcessesResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDrivesResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDirectoryResponse),
|
|
||||||
typeof (Packets.ClientPackets.DoDownloadFileResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetSystemInfoResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetMonitorsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetWebcamsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetWebcamResponse),
|
|
||||||
typeof (Packets.ClientPackets.DoShellExecuteResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetStartupItemsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetKeyloggerLogsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetPasswordsResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetRegistryKeysResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetCreateRegistryKeyResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetCreateRegistryValueResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetDeleteRegistryValueResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetRenameRegistryValueResponse),
|
|
||||||
typeof (Packets.ClientPackets.GetChangeRegistryValueResponse),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyConnect),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyConnectResponse),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyData),
|
|
||||||
typeof (ReverseProxy.Packets.ReverseProxyDisconnect),
|
|
||||||
typeof (Packets.ClientPackets.GetConnectionsResponse)
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
base.ClientState += OnClientState;
|
base.ClientState += OnClientState;
|
||||||
base.ClientRead += OnClientRead;
|
base.ClientRead += OnClientRead;
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace xServer.Core.Packets
|
||||||
|
{
|
||||||
|
public class PacketRegistery
|
||||||
|
{
|
||||||
|
public static Type[] GetPacketTypes()
|
||||||
|
{
|
||||||
|
return new Type[]
|
||||||
|
{
|
||||||
|
typeof (Packets.ServerPackets.GetAuthentication),
|
||||||
|
typeof (Packets.ServerPackets.DoClientDisconnect),
|
||||||
|
typeof (Packets.ServerPackets.DoClientReconnect),
|
||||||
|
typeof (Packets.ServerPackets.DoClientUninstall),
|
||||||
|
typeof (Packets.ServerPackets.DoWebcamStop),
|
||||||
|
typeof (Packets.ServerPackets.DoAskElevate),
|
||||||
|
typeof (Packets.ServerPackets.DoDownloadAndExecute),
|
||||||
|
typeof (Packets.ServerPackets.DoUploadAndExecute),
|
||||||
|
typeof (Packets.ServerPackets.GetDesktop),
|
||||||
|
typeof (Packets.ServerPackets.GetProcesses),
|
||||||
|
typeof (Packets.ServerPackets.DoProcessKill),
|
||||||
|
typeof (Packets.ServerPackets.DoProcessStart),
|
||||||
|
typeof (Packets.ServerPackets.GetDrives),
|
||||||
|
typeof (Packets.ServerPackets.GetDirectory),
|
||||||
|
typeof (Packets.ServerPackets.DoDownloadFile),
|
||||||
|
typeof (Packets.ServerPackets.DoMouseEvent),
|
||||||
|
typeof (Packets.ServerPackets.DoKeyboardEvent),
|
||||||
|
typeof (Packets.ServerPackets.GetSystemInfo),
|
||||||
|
typeof (Packets.ServerPackets.DoVisitWebsite),
|
||||||
|
typeof (Packets.ServerPackets.DoShowMessageBox),
|
||||||
|
typeof (Packets.ServerPackets.DoClientUpdate),
|
||||||
|
typeof (Packets.ServerPackets.GetMonitors),
|
||||||
|
typeof (Packets.ServerPackets.GetWebcams),
|
||||||
|
typeof (Packets.ServerPackets.GetWebcam),
|
||||||
|
typeof (Packets.ServerPackets.DoShellExecute),
|
||||||
|
typeof (Packets.ServerPackets.DoPathRename),
|
||||||
|
typeof (Packets.ServerPackets.DoPathDelete),
|
||||||
|
typeof (Packets.ServerPackets.DoShutdownAction),
|
||||||
|
typeof (Packets.ServerPackets.GetStartupItems),
|
||||||
|
typeof (Packets.ServerPackets.DoStartupItemAdd),
|
||||||
|
typeof (Packets.ServerPackets.DoStartupItemRemove),
|
||||||
|
typeof (Packets.ServerPackets.DoDownloadFileCancel),
|
||||||
|
typeof (Packets.ServerPackets.GetKeyloggerLogs),
|
||||||
|
typeof (Packets.ServerPackets.DoUploadFile),
|
||||||
|
typeof (Packets.ServerPackets.GetPasswords),
|
||||||
|
typeof (Packets.ServerPackets.DoLoadRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoCreateRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoDeleteRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoRenameRegistryKey),
|
||||||
|
typeof (Packets.ServerPackets.DoCreateRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.DoDeleteRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.DoRenameRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.DoChangeRegistryValue),
|
||||||
|
typeof (Packets.ServerPackets.SetAuthenticationSuccess),
|
||||||
|
typeof (Packets.ServerPackets.GetConnections),
|
||||||
|
typeof (Packets.ServerPackets.DoCloseConnection),
|
||||||
|
typeof (Packets.ClientPackets.GetAuthenticationResponse),
|
||||||
|
typeof (Packets.ClientPackets.SetStatus),
|
||||||
|
typeof (Packets.ClientPackets.SetStatusFileManager),
|
||||||
|
typeof (Packets.ClientPackets.SetUserStatus),
|
||||||
|
typeof (Packets.ClientPackets.GetDesktopResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetProcessesResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDrivesResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDirectoryResponse),
|
||||||
|
typeof (Packets.ClientPackets.DoDownloadFileResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetSystemInfoResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetMonitorsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetWebcamsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetWebcamResponse),
|
||||||
|
typeof (Packets.ClientPackets.DoShellExecuteResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetStartupItemsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetKeyloggerLogsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetPasswordsResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetRegistryKeysResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetCreateRegistryKeyResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetCreateRegistryValueResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetDeleteRegistryValueResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetRenameRegistryValueResponse),
|
||||||
|
typeof (Packets.ClientPackets.GetChangeRegistryValueResponse),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyConnect),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyConnectResponse),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyData),
|
||||||
|
typeof (ReverseProxy.Packets.ReverseProxyDisconnect),
|
||||||
|
typeof (Packets.ClientPackets.GetConnectionsResponse)
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -173,6 +173,7 @@
|
||||||
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" />
|
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" />
|
||||||
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryValueResponse.cs" />
|
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryValueResponse.cs" />
|
||||||
<Compile Include="Core\Packets\ClientPackets\SetStatusFileManager.cs" />
|
<Compile Include="Core\Packets\ClientPackets\SetStatusFileManager.cs" />
|
||||||
|
<Compile Include="Core\Packets\PacketRegistery.cs" />
|
||||||
<Compile Include="Core\Packets\ServerPackets\DoAskElevate.cs" />
|
<Compile Include="Core\Packets\ServerPackets\DoAskElevate.cs" />
|
||||||
<Compile Include="Core\Packets\ServerPackets\DoChangeRegistryValue.cs" />
|
<Compile Include="Core\Packets\ServerPackets\DoChangeRegistryValue.cs" />
|
||||||
<Compile Include="Core\Packets\ServerPackets\DoCloseConnection.cs" />
|
<Compile Include="Core\Packets\ServerPackets\DoCloseConnection.cs" />
|
||||||
|
|
Loading…
Reference in New Issue