-
-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FreeRDP is now built as a dll instead of an executable for better mod…
…ularity and to reduce the risk of false positive detection of wfreerdp.exe by some antiviruses (mostly cloud based) embedded interact.js and simple-keyboard (nodejs modules) into myrtille in order to remove dependencies on external CDNs (ans thus allow myrtille to be used standalone and not subject to external changes)
- Loading branch information
Showing
88 changed files
with
18,276 additions
and
1,339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
|
||
<configSections> | ||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, Log4net"/> | ||
</configSections> | ||
|
||
<log4net> | ||
<root> | ||
<level value="DEBUG"/> | ||
<appender-ref ref="LogFileAppender"/> | ||
</root> | ||
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> | ||
<param name="File" value="..\log\Myrtille.RDP.log"/> | ||
<param name="AppendToFile" value="true"/> | ||
<rollingStyle value="Size"/> | ||
<maxSizeRollBackups value="10"/> | ||
<maximumFileSize value="10MB"/> | ||
<staticLogFileName value="true"/> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<param name="ConversionPattern" value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/> | ||
</layout> | ||
</appender> | ||
</log4net> | ||
|
||
<system.diagnostics> | ||
<trace autoflush="true" indentsize="4"> | ||
<listeners> | ||
<add name="Log4netTraceListener" type="Myrtille.Log.Log4netTraceListener, Myrtille.Common"> | ||
<!-- trace level (Information, Warning or Error) --> | ||
<filter type="Myrtille.Log.Log4netTraceFilter, Myrtille.Common" initializeData="Information"/> | ||
</add> | ||
<!-- disable output window traces --> | ||
<remove name="Default"/> | ||
</listeners> | ||
</trace> | ||
</system.diagnostics> | ||
|
||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | ||
</startup> | ||
|
||
</configuration> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{01E631B8-2A75-4C16-BAE9-E7F0523D89B1}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>Myrtille.RDP</RootNamespace> | ||
<AssemblyName>Myrtille.RDP</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<ApplicationIcon>FreeRDP.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Configuration" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Web" /> | ||
<Reference Include="System.Windows.Forms" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Myrtille.Common\Myrtille.Common.csproj"> | ||
<Project>{37630774-1321-4e6a-8661-4430a8946e9e}</Project> | ||
<Name>Myrtille.Common</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\Myrtille.Services.Contracts\Myrtille.Services.Contracts.csproj"> | ||
<Project>{010e1702-3045-4b13-bfb6-06ffc60b5cbb}</Project> | ||
<Name>Myrtille.Services.Contracts</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="FreeRDP.ico" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<PropertyGroup> | ||
<PostBuildEvent>if exist "$(ProjectDir)FreeRDP\$(ConfigurationName)" copy /y "$(ProjectDir)FreeRDP\$(ConfigurationName)\*.dll" "$(TargetDir)" | ||
</PostBuildEvent> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
using System.Threading; | ||
using System.Windows.Forms; | ||
using log4net.Config; | ||
using Myrtille.Services.Contracts; | ||
|
||
namespace Myrtille.RDP | ||
{ | ||
public class Program | ||
{ | ||
[DllImport("wfreerdp-client.dll")] | ||
private static extern int StartRdpClient(); | ||
|
||
private static int Main(string[] args) | ||
{ | ||
// enable the code below for debug; disable otherwise | ||
//if (Environment.UserInteractive) | ||
//{ | ||
// MessageBox.Show("Attach the .NET debugger to the 'RDP Debug' Myrtille.RDP.exe process now for debug. Click OK when ready...", "RDP Debug"); | ||
//} | ||
//else | ||
//{ | ||
// Thread.Sleep(10000); | ||
//} | ||
|
||
// logger | ||
XmlConfigurator.Configure(); | ||
|
||
string argKeyValueSeparator = ":"; | ||
foreach (string arg in args) | ||
{ | ||
var argParts = arg.Trim().Split(argKeyValueSeparator.ToCharArray(), 2); | ||
parseCommandLineArg(argParts[0].ToLower(), (argParts.Length > 1 ? argParts[1] : "")); | ||
} | ||
|
||
if (!ValidConfig) | ||
{ | ||
return (int)RemoteSessionExitCode.InvalidConfiguration; | ||
} | ||
|
||
int exitCode = (int)RemoteSessionExitCode.Success; | ||
|
||
try | ||
{ | ||
exitCode = StartRdpClient(); | ||
} | ||
catch (Exception e) | ||
{ | ||
if (ConsoleOutput) | ||
{ | ||
Console.WriteLine(e.Message); | ||
} | ||
|
||
Trace.TraceError("RDP error, remote session {0} ({1})", RemoteSessionID, e); | ||
|
||
exitCode = (int)RemoteSessionExitCode.Unknown; | ||
} | ||
|
||
return exitCode; | ||
} | ||
|
||
#region configuration | ||
|
||
private static string RemoteSessionID { get; set; } // Myrtille session ID used for pipe messaging | ||
private static bool LoggingEnabled { get; set; } // Myrtille logging parameter | ||
private static bool ConsoleOutput { get; set; } // Output comms to console window | ||
private static uint Height { get; set; } // Height of RDP session | ||
private static uint Width { get; set; } // Width of RDP session | ||
|
||
/// <summary> | ||
/// Indicate all command line parameters for correct operation have been received. | ||
/// </summary> | ||
private static bool ValidConfig | ||
{ | ||
get | ||
{ | ||
if (string.IsNullOrEmpty(RemoteSessionID)) return false; | ||
if (Height == 0) return false; | ||
if (Width == 0) return false; | ||
return true; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Parse command line arguments | ||
/// </summary> | ||
/// <param name="arg"></param> | ||
/// <param name="value"></param> | ||
private static void parseCommandLineArg(string arg, string value) | ||
{ | ||
switch (arg) | ||
{ | ||
case "/myrtille-sid": | ||
RemoteSessionID = value.Trim(); | ||
break; | ||
case "/myrtille-window": | ||
ConsoleOutput = true; | ||
break; | ||
case "/myrtille-log": | ||
LoggingEnabled = true; | ||
break; | ||
case "/h": | ||
Height = uint.Parse(value); | ||
break; | ||
case "/w": | ||
Width = uint.Parse(value); | ||
break; | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Myrtille.RDP")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Myrtille")] | ||
[assembly: AssemblyCopyright("Copyright © 2014-2021 Cedric Coste")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("01e631b8-2a75-4c16-bae9-e7f0523d89b1")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("2.9.2.0")] | ||
[assembly: AssemblyFileVersion("2.9.2.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="log4net" version="2.0.8" targetFramework="net45" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.