auto-decompiled msil via petikvx

add
This commit is contained in:
vxunderground
2022-08-18 06:28:56 -05:00
parent 26192f771b
commit f2ac1ece55
12767 changed files with 1945075 additions and 0 deletions
@@ -0,0 +1,22 @@
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SatelliteContractVersion("2.0.0.0")]
[assembly: AssemblyKeyFile("f:\\RedBits\\tools\\devdiv\\FinalPublicKey.snk")]
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyDefaultAlias("MSBuild.exe")]
[assembly: AssemblyFileVersion("2.0.50727.1433")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyInformationalVersion("2.0.50727.1433")]
[assembly: AssemblyDescription("MSBuild.exe")]
[assembly: AssemblyTitle("MSBuild.exe")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("MSBuild.Unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: AssemblyVersion("2.0.0.0")]
@@ -0,0 +1,48 @@
// Decompiled with JetBrains decompiler
// Type: AssemblyRef
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
internal static class AssemblyRef
{
internal const string EcmaPublicKey = "b77a5c561934e089";
internal const string EcmaPublicKeyToken = "b77a5c561934e089";
internal const string EcmaPublicKeyFull = "00000000000000000400000000000000";
internal const string Mscorlib = "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string SystemData = "System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string SystemDataOracleClient = "System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string System = "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string SystemRuntimeRemoting = "System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string SystemWindowsForms = "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string SystemXml = "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
internal const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
internal const string MicrosoftPublicKeyToken = "b03f5f7f11d50a3a";
internal const string MicrosoftPublicKeyFull = "002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293";
internal const string SystemConfiguration = "System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemConfigurationInstall = "System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemDeployment = "System.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemDesign = "System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemDirectoryServices = "System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemDrawingDesign = "System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemDrawing = "System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemEnterpriseServices = "System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemManagement = "System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemMessaging = "System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemRuntimeSerializationFormattersSoap = "System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemSecurity = "System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemServiceProcess = "System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemWeb = "System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemWebMobile = "System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemWebRegularExpressions = "System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string SystemWebServices = "System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string MicrosoftVisualStudio = "Microsoft.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string MicrosoftVisualStudioWindowsForms = "Microsoft.VisualStudio.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string VJSharpCodeProvider = "VJSharpCodeProvider, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string ASPBrowserCapsPublicKey = "b7bd7678b977bd8f";
internal const string ASPBrowserCapsFactory = "ASP.BrowserCapsFactory, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7bd7678b977bd8f";
internal const string MicrosoftVSDesigner = "Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string MicrosoftVisualStudioWeb = "Microsoft.VisualStudio.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string MicrosoftVSDesignerMobile = "Microsoft.VSDesigner.Mobile, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string MicrosoftJScript = "Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
}
@@ -0,0 +1,60 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.CommandLine.CommandLineSwitchException
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using Microsoft.Build.Shared;
using System;
namespace Microsoft.Build.CommandLine
{
internal sealed class CommandLineSwitchException : Exception
{
private string commandLineArg;
private CommandLineSwitchException()
{
}
private CommandLineSwitchException(string message)
: base(message)
{
}
private CommandLineSwitchException(string message, string commandLineArg)
: this(message)
{
this.commandLineArg = commandLineArg;
}
public override string Message
{
get
{
if (this.commandLineArg == null)
return base.Message;
return base.Message + Environment.NewLine + ResourceUtilities.FormatResourceString("InvalidSwitchIndicator", (object) this.commandLineArg);
}
}
internal string CommandLineArg => this.commandLineArg;
internal static void VerifyThrow(
bool condition,
string messageResourceName,
string commandLineArg)
{
if (condition)
return;
CommandLineSwitchException.Throw(messageResourceName, commandLineArg);
}
internal static void Throw(string messageResourceName, string commandLineArg)
{
string message = AssemblyResources.GetString(messageResourceName);
ErrorUtilities.VerifyThrow(message != null, "The resource string must exist.");
throw new CommandLineSwitchException(message, commandLineArg);
}
}
}
@@ -0,0 +1,393 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.CommandLine.CommandLineSwitches
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using Microsoft.Build.Shared;
using System;
using System.Collections;
namespace Microsoft.Build.CommandLine
{
internal sealed class CommandLineSwitches
{
private static readonly CommandLineSwitches.ParameterlessSwitchInfo[] parameterlessSwitchesMap = new CommandLineSwitches.ParameterlessSwitchInfo[5]
{
new CommandLineSwitches.ParameterlessSwitchInfo(new string[3]
{
"help",
"h",
"?"
}, CommandLineSwitches.ParameterlessSwitch.Help, (string) null),
new CommandLineSwitches.ParameterlessSwitchInfo(new string[2]
{
"version",
"ver"
}, CommandLineSwitches.ParameterlessSwitch.Version, (string) null),
new CommandLineSwitches.ParameterlessSwitchInfo(new string[1]
{
"nologo"
}, CommandLineSwitches.ParameterlessSwitch.NoLogo, (string) null),
new CommandLineSwitches.ParameterlessSwitchInfo(new string[2]
{
"noautoresponse",
"noautorsp"
}, CommandLineSwitches.ParameterlessSwitch.NoAutoResponse, (string) null),
new CommandLineSwitches.ParameterlessSwitchInfo(new string[2]
{
"noconsolelogger",
"noconlog"
}, CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger, (string) null)
};
private static readonly CommandLineSwitches.ParameterizedSwitchInfo[] parameterizedSwitchesMap = new CommandLineSwitches.ParameterizedSwitchInfo[7]
{
new CommandLineSwitches.ParameterizedSwitchInfo(new string[1], CommandLineSwitches.ParameterizedSwitch.Project, "DuplicateProjectSwitchError", false, (string) null, true),
new CommandLineSwitches.ParameterizedSwitchInfo(new string[2]
{
"target",
"t"
}, CommandLineSwitches.ParameterizedSwitch.Target, (string) null, true, "MissingTargetError", true),
new CommandLineSwitches.ParameterizedSwitchInfo(new string[2]
{
"property",
"p"
}, CommandLineSwitches.ParameterizedSwitch.Property, (string) null, true, "MissingPropertyError", true),
new CommandLineSwitches.ParameterizedSwitchInfo(new string[2]
{
"logger",
"l"
}, CommandLineSwitches.ParameterizedSwitch.Logger, (string) null, false, "MissingLoggerError", false),
new CommandLineSwitches.ParameterizedSwitchInfo(new string[2]
{
"verbosity",
"v"
}, CommandLineSwitches.ParameterizedSwitch.Verbosity, (string) null, false, "MissingVerbosityError", true),
new CommandLineSwitches.ParameterizedSwitchInfo(new string[2]
{
"validate",
"val"
}, CommandLineSwitches.ParameterizedSwitch.Validate, (string) null, false, (string) null, true),
new CommandLineSwitches.ParameterizedSwitchInfo(new string[2]
{
"consoleloggerparameters",
"clp"
}, CommandLineSwitches.ParameterizedSwitch.ConsoleLoggerParameters, (string) null, false, (string) null, true)
};
private CommandLineSwitches.DetectedParameterlessSwitch[] parameterlessSwitches;
private CommandLineSwitches.DetectedParameterizedSwitch[] parameterizedSwitches;
private static readonly char[] parameterSeparators = new char[2]
{
',',
';'
};
private static readonly string[] noParameters = new string[0];
private string errorMessage;
private string badCommandLineArg;
private Exception innerException;
private bool isParameterError;
internal static bool IsParameterlessSwitch(
string switchName,
out CommandLineSwitches.ParameterlessSwitch parameterlessSwitch,
out string duplicateSwitchErrorMessage)
{
parameterlessSwitch = CommandLineSwitches.ParameterlessSwitch.Invalid;
duplicateSwitchErrorMessage = (string) null;
foreach (CommandLineSwitches.ParameterlessSwitchInfo parameterlessSwitches in CommandLineSwitches.parameterlessSwitchesMap)
{
foreach (string switchName1 in parameterlessSwitches.switchNames)
{
if (string.Compare(switchName, switchName1, StringComparison.OrdinalIgnoreCase) == 0)
{
parameterlessSwitch = parameterlessSwitches.parameterlessSwitch;
duplicateSwitchErrorMessage = parameterlessSwitches.duplicateSwitchErrorMessage;
break;
}
}
}
return parameterlessSwitch != CommandLineSwitches.ParameterlessSwitch.Invalid;
}
internal static bool IsParameterizedSwitch(
string switchName,
out CommandLineSwitches.ParameterizedSwitch parameterizedSwitch,
out string duplicateSwitchErrorMessage,
out bool multipleParametersAllowed,
out string missingParametersErrorMessage,
out bool unquoteParameters)
{
parameterizedSwitch = CommandLineSwitches.ParameterizedSwitch.Invalid;
duplicateSwitchErrorMessage = (string) null;
multipleParametersAllowed = false;
missingParametersErrorMessage = (string) null;
unquoteParameters = false;
foreach (CommandLineSwitches.ParameterizedSwitchInfo parameterizedSwitches in CommandLineSwitches.parameterizedSwitchesMap)
{
foreach (string switchName1 in parameterizedSwitches.switchNames)
{
if (string.Compare(switchName, switchName1, StringComparison.OrdinalIgnoreCase) == 0)
{
parameterizedSwitch = parameterizedSwitches.parameterizedSwitch;
duplicateSwitchErrorMessage = parameterizedSwitches.duplicateSwitchErrorMessage;
multipleParametersAllowed = parameterizedSwitches.multipleParametersAllowed;
missingParametersErrorMessage = parameterizedSwitches.missingParametersErrorMessage;
unquoteParameters = parameterizedSwitches.unquoteParameters;
break;
}
}
}
return parameterizedSwitch != CommandLineSwitches.ParameterizedSwitch.Invalid;
}
internal CommandLineSwitches()
{
this.parameterlessSwitches = new CommandLineSwitches.DetectedParameterlessSwitch[5];
this.parameterizedSwitches = new CommandLineSwitches.DetectedParameterizedSwitch[7];
}
internal void SetParameterlessSwitch(
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch,
string commandLineArg)
{
this.parameterlessSwitches[(int) parameterlessSwitch].commandLineArg = commandLineArg;
}
internal bool SetParameterizedSwitch(
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch,
string commandLineArg,
string switchParameters,
bool multipleParametersAllowed,
bool unquoteParameters)
{
bool flag = false;
if (this.parameterizedSwitches[(int) parameterizedSwitch].commandLineArg == null)
this.parameterizedSwitches[(int) parameterizedSwitch].parameters = new ArrayList();
this.parameterizedSwitches[(int) parameterizedSwitch].commandLineArg = commandLineArg;
if (multipleParametersAllowed)
{
int emptySplits;
this.parameterizedSwitches[(int) parameterizedSwitch].parameters.AddRange((ICollection) QuotingUtilities.SplitUnquoted(switchParameters, int.MaxValue, false, unquoteParameters, out emptySplits, CommandLineSwitches.parameterSeparators));
flag = emptySplits == 0;
}
else
{
if (unquoteParameters)
switchParameters = QuotingUtilities.Unquote(switchParameters);
if (switchParameters.Length > 0)
{
this.parameterizedSwitches[(int) parameterizedSwitch].parameters.Add((object) switchParameters);
flag = true;
}
}
return flag;
}
internal bool IsParameterlessSwitchSet(
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch)
{
return this.parameterlessSwitches[(int) parameterlessSwitch].commandLineArg != null;
}
internal bool this[
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch]
{
return this.parameterlessSwitches[(int) parameterlessSwitch].commandLineArg != null;
}
internal string GetParameterlessSwitchCommandLineArg(
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch)
{
return this.parameterlessSwitches[(int) parameterlessSwitch].commandLineArg;
}
internal bool IsParameterizedSwitchSet(
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch)
{
return this.parameterizedSwitches[(int) parameterizedSwitch].commandLineArg != null;
}
internal string[] this[
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch]
{
return this.parameterizedSwitches[(int) parameterizedSwitch].commandLineArg == null ? CommandLineSwitches.noParameters : (string[]) this.parameterizedSwitches[(int) parameterizedSwitch].parameters.ToArray(typeof (string));
}
internal string GetParameterizedSwitchCommandLineArg(
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch)
{
return this.parameterizedSwitches[(int) parameterizedSwitch].commandLineArg;
}
internal bool HaveAnySwitchesBeenSet()
{
for (int index = 0; index < 5; ++index)
{
if (this.IsParameterlessSwitchSet((CommandLineSwitches.ParameterlessSwitch) index))
return true;
}
for (int index = 0; index < 7; ++index)
{
if (this.IsParameterizedSwitchSet((CommandLineSwitches.ParameterizedSwitch) index))
return true;
}
return false;
}
internal void SetUnknownSwitchError(string badCommandLineArgValue) => this.SetSwitchError("UnknownSwitchError", badCommandLineArgValue);
internal void SetUnexpectedParametersError(string badCommandLineArgValue) => this.SetSwitchError("UnexpectedParametersError", badCommandLineArgValue);
internal void SetSwitchError(string messageResourceNameValue, string badCommandLineArgValue) => this.SetError(messageResourceNameValue, badCommandLineArgValue, (Exception) null, false);
internal void SetParameterError(string messageResourceNameValue, string badCommandLineArgValue) => this.SetParameterError(messageResourceNameValue, badCommandLineArgValue, (Exception) null);
internal void SetParameterError(
string messageResourceNameValue,
string badCommandLineArgValue,
Exception innerExceptionValue)
{
this.SetError(messageResourceNameValue, badCommandLineArgValue, innerExceptionValue, true);
}
private void SetError(
string messageResourceNameValue,
string badCommandLineArgValue,
Exception innerExceptionValue,
bool isParameterErrorValue)
{
if (this.HaveErrors())
return;
this.errorMessage = messageResourceNameValue;
this.badCommandLineArg = badCommandLineArgValue;
this.innerException = innerExceptionValue;
this.isParameterError = isParameterErrorValue;
}
internal bool HaveErrors() => this.errorMessage != null;
internal void ThrowErrors()
{
if (!this.HaveErrors())
return;
if (this.isParameterError)
InitializationException.Throw(this.errorMessage, this.badCommandLineArg, this.innerException, false);
else
CommandLineSwitchException.Throw(this.errorMessage, this.badCommandLineArg);
}
internal void Append(CommandLineSwitches switchesToAppend)
{
if (!this.HaveErrors() && switchesToAppend.HaveErrors())
{
this.errorMessage = switchesToAppend.errorMessage;
this.badCommandLineArg = switchesToAppend.badCommandLineArg;
this.innerException = switchesToAppend.innerException;
this.isParameterError = switchesToAppend.isParameterError;
}
for (int index = 0; index < 5; ++index)
{
if (switchesToAppend.IsParameterlessSwitchSet((CommandLineSwitches.ParameterlessSwitch) index))
{
if (!this.IsParameterlessSwitchSet((CommandLineSwitches.ParameterlessSwitch) index) || CommandLineSwitches.parameterlessSwitchesMap[index].duplicateSwitchErrorMessage == null)
this.parameterlessSwitches[index].commandLineArg = switchesToAppend.parameterlessSwitches[index].commandLineArg;
else
this.SetSwitchError(CommandLineSwitches.parameterlessSwitchesMap[index].duplicateSwitchErrorMessage, switchesToAppend.GetParameterlessSwitchCommandLineArg((CommandLineSwitches.ParameterlessSwitch) index));
}
}
for (int index = 0; index < 7; ++index)
{
if (switchesToAppend.IsParameterizedSwitchSet((CommandLineSwitches.ParameterizedSwitch) index))
{
if (!this.IsParameterizedSwitchSet((CommandLineSwitches.ParameterizedSwitch) index) || CommandLineSwitches.parameterizedSwitchesMap[index].duplicateSwitchErrorMessage == null)
{
if (this.parameterizedSwitches[index].commandLineArg == null)
this.parameterizedSwitches[index].parameters = new ArrayList();
this.parameterizedSwitches[index].commandLineArg = switchesToAppend.parameterizedSwitches[index].commandLineArg;
this.parameterizedSwitches[index].parameters.AddRange((ICollection) switchesToAppend.parameterizedSwitches[index].parameters);
}
else
this.SetSwitchError(CommandLineSwitches.parameterizedSwitchesMap[index].duplicateSwitchErrorMessage, switchesToAppend.GetParameterizedSwitchCommandLineArg((CommandLineSwitches.ParameterizedSwitch) index));
}
}
}
internal enum ParameterlessSwitch
{
Invalid = -1, // 0xFFFFFFFF
Help = 0,
Version = 1,
NoLogo = 2,
NoAutoResponse = 3,
NoConsoleLogger = 4,
NumberOfParameterlessSwitches = 5,
}
internal enum ParameterizedSwitch
{
Invalid = -1, // 0xFFFFFFFF
Project = 0,
Target = 1,
Property = 2,
Logger = 3,
Verbosity = 4,
Validate = 5,
ConsoleLoggerParameters = 6,
NumberOfParameterizedSwitches = 7,
}
private struct ParameterlessSwitchInfo
{
internal string[] switchNames;
internal string duplicateSwitchErrorMessage;
internal CommandLineSwitches.ParameterlessSwitch parameterlessSwitch;
internal ParameterlessSwitchInfo(
string[] switchNames,
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch,
string duplicateSwitchErrorMessage)
{
this.switchNames = switchNames;
this.duplicateSwitchErrorMessage = duplicateSwitchErrorMessage;
this.parameterlessSwitch = parameterlessSwitch;
}
}
private struct ParameterizedSwitchInfo
{
internal string[] switchNames;
internal string duplicateSwitchErrorMessage;
internal bool multipleParametersAllowed;
internal string missingParametersErrorMessage;
internal bool unquoteParameters;
internal CommandLineSwitches.ParameterizedSwitch parameterizedSwitch;
internal ParameterizedSwitchInfo(
string[] switchNames,
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch,
string duplicateSwitchErrorMessage,
bool multipleParametersAllowed,
string missingParametersErrorMessage,
bool unquoteParameters)
{
this.switchNames = switchNames;
this.duplicateSwitchErrorMessage = duplicateSwitchErrorMessage;
this.multipleParametersAllowed = multipleParametersAllowed;
this.missingParametersErrorMessage = missingParametersErrorMessage;
this.unquoteParameters = unquoteParameters;
this.parameterizedSwitch = parameterizedSwitch;
}
}
private struct DetectedParameterlessSwitch
{
internal string commandLineArg;
}
private struct DetectedParameterizedSwitch
{
internal string commandLineArg;
internal ArrayList parameters;
}
}
}
@@ -0,0 +1,75 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.CommandLine.InitializationException
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using Microsoft.Build.Shared;
using System;
namespace Microsoft.Build.CommandLine
{
internal sealed class InitializationException : Exception
{
private string invalidSwitch;
private InitializationException()
{
}
private InitializationException(string message)
: base(message)
{
}
private InitializationException(string message, string invalidSwitch)
: this(message)
{
this.invalidSwitch = invalidSwitch;
}
public override string Message
{
get
{
if (this.invalidSwitch == null)
return base.Message;
return base.Message + Environment.NewLine + ResourceUtilities.FormatResourceString("InvalidSwitchIndicator", (object) this.invalidSwitch);
}
}
internal static void VerifyThrow(bool condition, string messageResourceName) => InitializationException.VerifyThrow(condition, messageResourceName, (string) null);
internal static void VerifyThrow(
bool condition,
string messageResourceName,
string invalidSwitch)
{
if (condition)
return;
InitializationException.Throw(messageResourceName, invalidSwitch, (Exception) null, false);
}
internal static void Throw(
string messageResourceName,
string invalidSwitch,
Exception e,
bool showStackTrace)
{
string unformatted = AssemblyResources.GetString(messageResourceName);
ErrorUtilities.VerifyThrow(unformatted != null, "The resource string must exist.");
string message;
if (showStackTrace)
message = unformatted + Environment.NewLine + e.ToString();
else
message = ResourceUtilities.FormatString(unformatted, e == null ? (object) string.Empty : (object) e.Message);
InitializationException.Throw(message, invalidSwitch);
}
internal static void Throw(string message, string invalidSwitch)
{
ErrorUtilities.VerifyThrow(message != null, "The string must exist.");
throw new InitializationException(message, invalidSwitch);
}
}
}
@@ -0,0 +1,633 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.CommandLine.MSBuildApp
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Shared;
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Security;
using System.Text;
using System.Threading;
namespace Microsoft.Build.CommandLine
{
public static class MSBuildApp
{
private const string autoResponseFileName = "MSBuild.rsp";
private static readonly string binPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath);
private static ArrayList includedResponseFiles;
internal static bool usingSwitchesFromAutoResponseFile = false;
private static readonly char[] propertyValueSeparator = new char[1]
{
'='
};
private static readonly TypeFilter loggerClassFilter = new TypeFilter(MSBuildApp.IsLoggerClass);
[STAThread]
public static int Main() => MSBuildApp.Execute(Environment.CommandLine) != MSBuildApp.ExitType.Success ? 1 : 0;
public static MSBuildApp.ExitType Execute(string commandLine)
{
ErrorUtilities.VerifyThrowArgumentLength(commandLine, nameof (commandLine));
MSBuildApp.ExitType exitType = MSBuildApp.ExitType.Success;
try
{
MSBuildApp.VerifyThrowSupportedOS();
MSBuildApp.SetConsoleUI();
MSBuildApp.ResetBuildState();
string projectFile = (string) null;
string[] targets = new string[0];
BuildPropertyGroup propertyBag = (BuildPropertyGroup) null;
ILogger[] loggers = new ILogger[0];
bool needToValidateProject = false;
string schemaFile = (string) null;
if (MSBuildApp.ProcessCommandLineSwitches(MSBuildApp.GatherAllSwitches(commandLine), ref projectFile, ref targets, ref propertyBag, ref loggers, ref needToValidateProject, ref schemaFile))
{
if (!MSBuildApp.BuildProject(projectFile, targets, propertyBag, loggers, needToValidateProject, schemaFile))
exitType = MSBuildApp.ExitType.BuildError;
}
}
catch (CommandLineSwitchException ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine();
MSBuildApp.ShowHelpPrompt();
exitType = MSBuildApp.ExitType.SwitchError;
}
catch (InitializationException ex)
{
Console.WriteLine(ex.Message);
exitType = MSBuildApp.ExitType.InitializationError;
}
catch (LoggerException ex)
{
if (ex.ErrorCode != null)
Console.WriteLine(ResourceUtilities.FormatResourceString("LoggerFailurePrefixNoErrorCode", (object) ex.ErrorCode, (object) ex.Message));
else
Console.WriteLine(ResourceUtilities.FormatResourceString("LoggerFailurePrefixWithErrorCode", (object) ex.Message));
if (ex.InnerException != null)
Console.WriteLine(ex.InnerException.Message);
exitType = MSBuildApp.ExitType.LoggerAbort;
}
catch (InternalLoggerException ex)
{
Console.WriteLine("MSBUILD : error " + ex.ErrorCode + ": " + ex.Message);
Console.WriteLine(ex.InnerException.ToString());
exitType = MSBuildApp.ExitType.LoggerFailure;
}
catch
{
Console.WriteLine(AssemblyResources.GetString("FatalError"));
throw;
}
return exitType;
}
private static void ResetBuildState()
{
MSBuildApp.includedResponseFiles = new ArrayList();
MSBuildApp.usingSwitchesFromAutoResponseFile = false;
}
private static bool BuildProject(
string projectFile,
string[] targets,
BuildPropertyGroup propertyBag,
ILogger[] loggers,
bool needToValidateProject,
string schemaFile)
{
bool flag = false;
Engine engine = new Engine(MSBuildApp.binPath);
engine.GlobalProperties = propertyBag;
try
{
foreach (ILogger logger in loggers)
engine.RegisterLogger(logger);
Project newProject = engine.CreateNewProject();
newProject.IsValidated = needToValidateProject;
newProject.SchemaFile = schemaFile;
newProject.Load(projectFile);
flag = engine.BuildProject(newProject, targets);
}
catch (InvalidProjectFileException ex)
{
}
finally
{
engine.UnregisterAllLoggers();
}
return flag;
}
private static void VerifyThrowSupportedOS()
{
if (Environment.OSVersion.Platform != PlatformID.Win32S && Environment.OSVersion.Platform != PlatformID.Win32Windows && Environment.OSVersion.Platform != PlatformID.WinCE && (Environment.OSVersion.Platform != PlatformID.Win32NT || Environment.OSVersion.Version.Major > 4))
return;
InitializationException.VerifyThrow(false, "UnsupportedOS");
}
internal static void SetConsoleUI()
{
Thread currentThread = Thread.CurrentThread;
currentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture();
int codePage = Console.OutputEncoding.CodePage;
if (codePage == 65001 || codePage == currentThread.CurrentUICulture.TextInfo.OEMCodePage || codePage == currentThread.CurrentUICulture.TextInfo.ANSICodePage)
return;
currentThread.CurrentUICulture = new CultureInfo("en-US");
}
private static CommandLineSwitches GatherAllSwitches(string commandLine)
{
ArrayList commandLineArgs = QuotingUtilities.SplitUnquoted(commandLine);
commandLineArgs.RemoveAt(0);
CommandLineSwitches commandLineSwitches = new CommandLineSwitches();
MSBuildApp.GatherCommandLineSwitches(commandLineArgs, commandLineSwitches);
return MSBuildApp.GatherAutoResponseFileSwitches(commandLineSwitches);
}
private static void GatherCommandLineSwitches(
ArrayList commandLineArgs,
CommandLineSwitches commandLineSwitches)
{
foreach (string commandLineArg in commandLineArgs)
{
int doubleQuotesRemoved;
string str = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemoved);
if (str.Length > 0)
{
if (str.StartsWith("@", StringComparison.Ordinal))
{
MSBuildApp.GatherResponseFileSwitch(str, commandLineSwitches);
}
else
{
string switchName;
string switchParameters;
if (!str.StartsWith("-", StringComparison.Ordinal) && !str.StartsWith("/", StringComparison.Ordinal))
{
switchName = (string) null;
switchParameters = ":" + commandLineArg;
}
else
{
int switchParameterIndicator = str.IndexOf(':');
if (switchParameterIndicator == -1)
{
switchName = str.Substring(1);
switchParameters = string.Empty;
}
else
{
switchName = str.Substring(1, switchParameterIndicator - 1);
switchParameters = MSBuildApp.ExtractSwitchParameters(commandLineArg, str, doubleQuotesRemoved, switchName, switchParameterIndicator);
}
}
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch;
string duplicateSwitchErrorMessage;
if (CommandLineSwitches.IsParameterlessSwitch(switchName, out parameterlessSwitch, out duplicateSwitchErrorMessage))
{
MSBuildApp.GatherParameterlessCommandLineSwitch(commandLineSwitches, parameterlessSwitch, switchParameters, duplicateSwitchErrorMessage, str);
}
else
{
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch;
bool multipleParametersAllowed;
string missingParametersErrorMessage;
bool unquoteParameters;
if (CommandLineSwitches.IsParameterizedSwitch(switchName, out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters))
MSBuildApp.GatherParameterizedCommandLineSwitch(commandLineSwitches, parameterizedSwitch, switchParameters, duplicateSwitchErrorMessage, multipleParametersAllowed, missingParametersErrorMessage, unquoteParameters, str);
else
commandLineSwitches.SetUnknownSwitchError(str);
}
}
}
}
}
internal static string ExtractSwitchParameters(
string commandLineArg,
string unquotedCommandLineArg,
int doubleQuotesRemovedFromArg,
string switchName,
int switchParameterIndicator)
{
int num1 = commandLineArg.IndexOf(':');
int doubleQuotesRemoved;
string str = QuotingUtilities.Unquote(commandLineArg.Substring(0, num1), out doubleQuotesRemoved);
ErrorUtilities.VerifyThrow(switchName == str.Substring(1), "The switch name extracted from either the partially or completely unquoted arg should be the same.");
ErrorUtilities.VerifyThrow(doubleQuotesRemovedFromArg >= doubleQuotesRemoved, "The name portion of the switch cannot contain more quoting than the arg itself.");
string switchParameters;
if (doubleQuotesRemoved % 2 == 0)
{
switchParameters = commandLineArg.Substring(num1);
}
else
{
int num2 = commandLineArg.IndexOf('"', num1 + 1);
switchParameters = doubleQuotesRemovedFromArg - doubleQuotesRemoved > 1 || num2 != -1 && num2 != commandLineArg.Length - 1 ? ":\"" + commandLineArg.Substring(num1 + 1) : unquotedCommandLineArg.Substring(switchParameterIndicator);
}
ErrorUtilities.VerifyThrow(switchParameters != null, "We must be able to extract the switch parameters.");
return switchParameters;
}
private static void GatherResponseFileSwitch(
string unquotedCommandLineArg,
CommandLineSwitches commandLineSwitches)
{
try
{
string path = unquotedCommandLineArg.Substring(1);
if (path.Length == 0)
commandLineSwitches.SetSwitchError("MissingResponseFileError", unquotedCommandLineArg);
else if (!File.Exists(path))
{
commandLineSwitches.SetParameterError("ResponseFileNotFoundError", unquotedCommandLineArg);
}
else
{
string fullPath = Path.GetFullPath(path);
bool flag = false;
foreach (string includedResponseFile in MSBuildApp.includedResponseFiles)
{
if (string.Compare(fullPath, includedResponseFile, StringComparison.OrdinalIgnoreCase) == 0)
{
commandLineSwitches.SetParameterError("RepeatedResponseFileError", unquotedCommandLineArg);
flag = true;
break;
}
}
if (flag)
return;
MSBuildApp.includedResponseFiles.Add((object) fullPath);
ArrayList commandLineArgs;
using (StreamReader streamReader = new StreamReader(fullPath, Encoding.Default))
{
commandLineArgs = new ArrayList();
while (streamReader.Peek() != -1)
{
string name = streamReader.ReadLine().TrimStart();
if (!name.StartsWith("#", StringComparison.Ordinal))
commandLineArgs.AddRange((ICollection) QuotingUtilities.SplitUnquoted(Environment.ExpandEnvironmentVariables(name)));
}
}
MSBuildApp.GatherCommandLineSwitches(commandLineArgs, commandLineSwitches);
}
}
catch (NotSupportedException ex)
{
commandLineSwitches.SetParameterError("ReadResponseFileError", unquotedCommandLineArg, (Exception) ex);
}
catch (SecurityException ex)
{
commandLineSwitches.SetParameterError("ReadResponseFileError", unquotedCommandLineArg, (Exception) ex);
}
catch (UnauthorizedAccessException ex)
{
commandLineSwitches.SetParameterError("ReadResponseFileError", unquotedCommandLineArg, (Exception) ex);
}
catch (IOException ex)
{
commandLineSwitches.SetParameterError("ReadResponseFileError", unquotedCommandLineArg, (Exception) ex);
}
}
private static void GatherParameterlessCommandLineSwitch(
CommandLineSwitches commandLineSwitches,
CommandLineSwitches.ParameterlessSwitch parameterlessSwitch,
string switchParameters,
string duplicateSwitchErrorMessage,
string unquotedCommandLineArg)
{
if (switchParameters.Length == 0)
{
if (!commandLineSwitches.IsParameterlessSwitchSet(parameterlessSwitch) || duplicateSwitchErrorMessage == null)
commandLineSwitches.SetParameterlessSwitch(parameterlessSwitch, unquotedCommandLineArg);
else
commandLineSwitches.SetSwitchError(duplicateSwitchErrorMessage, unquotedCommandLineArg);
}
else
commandLineSwitches.SetUnexpectedParametersError(unquotedCommandLineArg);
}
private static void GatherParameterizedCommandLineSwitch(
CommandLineSwitches commandLineSwitches,
CommandLineSwitches.ParameterizedSwitch parameterizedSwitch,
string switchParameters,
string duplicateSwitchErrorMessage,
bool multipleParametersAllowed,
string missingParametersErrorMessage,
bool unquoteParameters,
string unquotedCommandLineArg)
{
if (switchParameters.Length > 1 || missingParametersErrorMessage == null)
{
if (!commandLineSwitches.IsParameterizedSwitchSet(parameterizedSwitch) || duplicateSwitchErrorMessage == null)
{
if (switchParameters.Length > 0)
switchParameters = switchParameters.Substring(1);
if (commandLineSwitches.SetParameterizedSwitch(parameterizedSwitch, unquotedCommandLineArg, switchParameters, multipleParametersAllowed, unquoteParameters) || missingParametersErrorMessage == null)
return;
commandLineSwitches.SetSwitchError(missingParametersErrorMessage, unquotedCommandLineArg);
}
else
commandLineSwitches.SetSwitchError(duplicateSwitchErrorMessage, unquotedCommandLineArg);
}
else
commandLineSwitches.SetSwitchError(missingParametersErrorMessage, unquotedCommandLineArg);
}
private static CommandLineSwitches GatherAutoResponseFileSwitches(
CommandLineSwitches commandLineSwitches)
{
CommandLineSwitches commandLineSwitches1 = commandLineSwitches;
if (!commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoAutoResponse])
{
string path = Path.Combine(MSBuildApp.binPath, "MSBuild.rsp");
if (File.Exists(path))
{
commandLineSwitches1 = new CommandLineSwitches();
MSBuildApp.GatherResponseFileSwitch("@" + path, commandLineSwitches1);
if (commandLineSwitches1[CommandLineSwitches.ParameterlessSwitch.NoAutoResponse])
commandLineSwitches1.SetSwitchError("CannotAutoDisableAutoResponseFile", commandLineSwitches1.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoAutoResponse));
if (commandLineSwitches1.HaveAnySwitchesBeenSet())
MSBuildApp.usingSwitchesFromAutoResponseFile = true;
commandLineSwitches1.Append(commandLineSwitches);
}
}
return commandLineSwitches1;
}
private static bool ProcessCommandLineSwitches(
CommandLineSwitches commandLineSwitches,
ref string projectFile,
ref string[] targets,
ref BuildPropertyGroup propertyBag,
ref ILogger[] loggers,
ref bool needToValidateProject,
ref string schemaFile)
{
bool flag = false;
if (!commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoLogo])
MSBuildApp.DisplayCopyrightMessage();
if (commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Help])
{
MSBuildApp.ShowHelpMessage();
}
else
{
commandLineSwitches.ThrowErrors();
if (commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Version])
{
MSBuildApp.ShowVersion();
}
else
{
projectFile = MSBuildApp.ProcessProjectSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Project]);
targets = MSBuildApp.ProcessTargetSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Target]);
propertyBag = MSBuildApp.ProcessPropertySwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Property]);
LoggerVerbosity verbosity;
loggers = MSBuildApp.ProcessLoggingSwitches(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Logger], commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Verbosity], commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger], commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.ConsoleLoggerParameters], out verbosity);
if (MSBuildApp.usingSwitchesFromAutoResponseFile && LoggerVerbosity.Diagnostic == verbosity)
Console.WriteLine(ResourceUtilities.FormatResourceString("PickedUpSwitchesFromAutoResponse", (object) "MSBuild.rsp"));
needToValidateProject = commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.Validate);
schemaFile = MSBuildApp.ProcessValidateSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Validate]);
flag = true;
}
}
ErrorUtilities.VerifyThrow(!flag || projectFile != null, "We should have a project file if we're going to build.");
return flag;
}
private static string ProcessProjectSwitch(string[] parameters)
{
ErrorUtilities.VerifyThrow(parameters.Length <= 1, "It should not be possible to specify more than 1 project at a time.");
string str;
if (parameters.Length == 0)
{
string[] files1 = Directory.GetFiles(".", "*.*proj");
string[] files2 = Directory.GetFiles(".", "*.sln");
if (files1.Length == 1 && files2.Length == 1)
InitializationException.VerifyThrow(string.Compare(Path.GetFileNameWithoutExtension(files2[0]), Path.GetFileNameWithoutExtension(files1[0]), StringComparison.OrdinalIgnoreCase) == 0, "AmbiguousProjectError");
else if (files2.Length > 1 || files1.Length > 1)
InitializationException.VerifyThrow(false, "AmbiguousProjectError");
else if (files1.Length == 0 && files2.Length == 0)
InitializationException.VerifyThrow(false, "MissingProjectError");
str = files2.Length == 1 ? files2[0] : files1[0];
}
else
{
InitializationException.VerifyThrow(File.Exists(parameters[0]), "ProjectNotFoundError", parameters[0]);
str = parameters[0];
}
return str;
}
private static string[] ProcessTargetSwitch(string[] parameters) => parameters;
internal static BuildPropertyGroup ProcessPropertySwitch(string[] parameters)
{
BuildPropertyGroup buildPropertyGroup = new BuildPropertyGroup();
foreach (string parameter in parameters)
{
string[] strArray = parameter.Split(MSBuildApp.propertyValueSeparator, 2);
CommandLineSwitchException.VerifyThrow(strArray[0].Length > 0 && strArray.Length == 2, "InvalidPropertyError", parameter);
try
{
buildPropertyGroup.SetProperty(strArray[0], strArray[1]);
}
catch (ArgumentException ex)
{
InitializationException.Throw("InvalidPropertyError", parameter, (Exception) ex, false);
}
catch (InvalidOperationException ex)
{
InitializationException.Throw(ex.Message, parameter);
}
}
return buildPropertyGroup;
}
private static ILogger[] ProcessLoggingSwitches(
string[] loggerSwitchParameters,
string[] verbositySwitchParameters,
bool noConsoleLogger,
string[] consoleLoggerParameters,
out LoggerVerbosity verbosity)
{
verbosity = MSBuildApp.ProcessVerbositySwitch(verbositySwitchParameters);
ArrayList arrayList = MSBuildApp.ProcessLoggerSwitch(loggerSwitchParameters, verbosity);
if (!noConsoleLogger)
{
ConsoleLogger consoleLogger = new ConsoleLogger(verbosity);
if (consoleLoggerParameters != null && consoleLoggerParameters.Length > 0)
consoleLogger.Parameters = consoleLoggerParameters[consoleLoggerParameters.Length - 1];
arrayList.Add((object) consoleLogger);
}
return (ILogger[]) arrayList.ToArray(typeof (ILogger));
}
private static LoggerVerbosity ProcessVerbositySwitch(string[] parameters)
{
LoggerVerbosity loggerVerbosity = LoggerVerbosity.Normal;
if (parameters.Length > 0)
{
try
{
loggerVerbosity = (LoggerVerbosity) Enum.Parse(typeof (LoggerVerbosity), parameters[parameters.Length - 1], true);
}
catch (ArgumentException ex)
{
if (string.Compare(parameters[parameters.Length - 1], "q", StringComparison.OrdinalIgnoreCase) == 0)
loggerVerbosity = LoggerVerbosity.Quiet;
else if (string.Compare(parameters[parameters.Length - 1], "m", StringComparison.OrdinalIgnoreCase) == 0)
loggerVerbosity = LoggerVerbosity.Minimal;
else if (string.Compare(parameters[parameters.Length - 1], "n", StringComparison.OrdinalIgnoreCase) == 0)
loggerVerbosity = LoggerVerbosity.Normal;
else if (string.Compare(parameters[parameters.Length - 1], "d", StringComparison.OrdinalIgnoreCase) == 0)
loggerVerbosity = LoggerVerbosity.Detailed;
else if (string.Compare(parameters[parameters.Length - 1], "diag", StringComparison.OrdinalIgnoreCase) == 0)
loggerVerbosity = LoggerVerbosity.Diagnostic;
else
CommandLineSwitchException.Throw("InvalidVerbosityError", parameters[parameters.Length - 1]);
}
}
return loggerVerbosity;
}
private static ArrayList ProcessLoggerSwitch(
string[] parameters,
LoggerVerbosity verbosity)
{
ArrayList arrayList1 = new ArrayList();
foreach (string parameter in parameters)
{
string str = QuotingUtilities.Unquote(parameter);
int emptySplits;
ArrayList arrayList2 = QuotingUtilities.SplitUnquoted(parameter, 2, true, false, out emptySplits, ';');
ErrorUtilities.VerifyThrow(arrayList2.Count >= 1 && arrayList2.Count <= 2, "SplitUnquoted() must return at least one string, and no more than two.");
CommandLineSwitchException.VerifyThrow(((string) arrayList2[0]).Length > 0, "InvalidLoggerError", str);
ArrayList arrayList3 = QuotingUtilities.SplitUnquoted((string) arrayList2[0], 2, true, false, out emptySplits, ',');
ErrorUtilities.VerifyThrow(arrayList3.Count >= 1 && arrayList3.Count <= 2, "SplitUnquoted() must return at least one string, and no more than two.");
string loggerClassName;
string path;
if (arrayList3.Count == 2)
{
loggerClassName = QuotingUtilities.Unquote((string) arrayList3[0]);
path = QuotingUtilities.Unquote((string) arrayList3[1]);
}
else
{
loggerClassName = string.Empty;
path = QuotingUtilities.Unquote((string) arrayList3[0]);
}
CommandLineSwitchException.VerifyThrow(path.Length > 0, "InvalidLoggerError", str);
string assemblyName = (string) null;
string assemblyFile = (string) null;
if (File.Exists(path))
assemblyFile = path;
else
assemblyName = path;
AssemblyLoadInfo loggerAssembly = new AssemblyLoadInfo(assemblyName, assemblyFile);
ILogger logger = MSBuildApp.CreateLogger(loggerClassName, loggerAssembly, str);
try
{
logger.Verbosity = verbosity;
if (arrayList2.Count == 2)
logger.Parameters = QuotingUtilities.Unquote((string) arrayList2[1]);
}
catch (LoggerException ex)
{
throw;
}
catch (Exception ex)
{
InitializationException.Throw("LoggerFatalError", str, ex, true);
}
arrayList1.Add((object) logger);
}
return arrayList1;
}
private static ILogger CreateLogger(
string loggerClassName,
AssemblyLoadInfo loggerAssembly,
string loggerSwitchParameters)
{
ILogger logger = (ILogger) null;
try
{
LoadedType loadedType = new TypeLoader(MSBuildApp.loggerClassFilter).Load(loggerClassName, loggerAssembly);
InitializationException.VerifyThrow(loadedType != null, "LoggerNotFoundError", loggerSwitchParameters);
logger = (ILogger) Activator.CreateInstance(loadedType.Type);
}
catch (IOException ex)
{
InitializationException.Throw("LoggerCreationError", loggerSwitchParameters, (Exception) ex, false);
}
catch (BadImageFormatException ex)
{
InitializationException.Throw("LoggerCreationError", loggerSwitchParameters, (Exception) ex, false);
}
catch (SecurityException ex)
{
InitializationException.Throw("LoggerCreationError", loggerSwitchParameters, (Exception) ex, false);
}
catch (ReflectionTypeLoadException ex)
{
InitializationException.Throw("LoggerCreationError", loggerSwitchParameters, (Exception) ex, false);
}
catch (TargetInvocationException ex)
{
Exception innerException = ex.InnerException;
if (innerException is LoggerException)
throw innerException;
InitializationException.Throw("LoggerFatalError", loggerSwitchParameters, innerException, true);
}
catch (MemberAccessException ex)
{
InitializationException.Throw("LoggerCreationError", loggerSwitchParameters, (Exception) ex, false);
}
return logger;
}
private static bool IsLoggerClass(Type type, object unused) => type.IsClass && !type.IsAbstract && (object) type.GetInterface("ILogger") != null;
private static string ProcessValidateSwitch(string[] parameters)
{
string str = (string) null;
foreach (string parameter in parameters)
{
InitializationException.VerifyThrow(str == null, "MultipleSchemasError", parameter);
InitializationException.VerifyThrow(File.Exists(parameter), "SchemaNotFoundError", parameter);
str = Path.Combine(Directory.GetCurrentDirectory(), parameter);
}
return str;
}
private static void DisplayCopyrightMessage() => Console.WriteLine(ResourceUtilities.FormatResourceString("CopyrightMessage", (object) Engine.Version.ToString(), (object) Environment.Version.ToString()));
private static void ShowHelpMessage() => Console.WriteLine(AssemblyResources.GetString("HelpMessage"));
private static void ShowHelpPrompt() => Console.WriteLine(AssemblyResources.GetString("HelpPrompt"));
private static void ShowVersion() => Console.Write(Engine.Version.ToString());
public enum ExitType
{
Success,
SwitchError,
InitializationError,
BuildError,
LoggerAbort,
LoggerFailure,
}
}
}
@@ -0,0 +1,10 @@
// Decompiled with JetBrains decompiler
// Type: FXAssembly
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
internal static class FXAssembly
{
internal const string Version = "2.0.0.0";
}
@@ -0,0 +1,302 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="UnknownSwitchError" xml:space="preserve">
<value>MSBUILD : error MSB1001: Unknown switch.</value>
</data>
<data name="MissingProjectError" xml:space="preserve">
<value>MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.</value>
</data>
<data name="CopyrightMessage" xml:space="preserve">
<value>Microsoft (R) Build Engine Version {0}
[Microsoft .NET Framework, Version {1}]
Copyright (C) Microsoft Corporation 2005. All rights reserved.
</value>
</data>
<data name="FatalError" xml:space="preserve">
<value>MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.</value>
</data>
<data name="LoggerFatalError" xml:space="preserve">
<value>MSBUILD : error MSB1028: The logger failed unexpectedly.</value>
</data>
<data name="HelpMessage" xml:space="preserve">
<value>Syntax: MSBuild.exe [options] [project file]
Description: Builds the specified targets in the project file. If
a project file is not specified, MSBuild searches the
current working directory for a file that has a file
extension that ends in "proj" and uses that file.
Switches:
/help Display this usage message. (Short form: /? or /h)
/nologo Do not display the startup banner and copyright message.
/version Display version information only. (Short form: /ver)
@&lt;file&gt; Insert command-line settings from a text file. To specify
multiple response files, specify each response file
separately.
/noautoresponse Do not auto-include the MSBuild.rsp file. (Short form:
/noautorsp)
/target:&lt;targets&gt; Build these targets in this project. Use a semicolon or a
comma to separate multiple targets, or specify each
target separately. (Short form: /t)
Example:
/target:Resources;Compile
/property:&lt;n&gt;=&lt;v&gt; Set or override these project-level properties. &lt;n&gt; is
the property name, and &lt;v&gt; is the property value. Use a
semicolon or a comma to separate multiple properties, or
specify each property separately. (Short form: /p)
Example:
/property:WarningLevel=2;OutDir=bin\Debug\
/logger:&lt;logger&gt; Use this logger to log events from MSBuild. To specify
multiple loggers, specify each logger separately.
The &lt;logger&gt; syntax is:
[&lt;logger class&gt;,]&lt;logger assembly&gt;[;&lt;logger parameters&gt;]
The &lt;logger class&gt; syntax is:
[&lt;partial or full namespace&gt;.]&lt;logger class name&gt;
The &lt;logger assembly&gt; syntax is:
{&lt;assembly name&gt;[,&lt;strong name&gt;] | &lt;assembly file&gt;}
The &lt;logger parameters&gt; are optional, and are passed
to the logger exactly as you typed them. (Short form: /l)
Examples:
/logger:XMLLogger,MyLogger,Version=1.0.2,Culture=neutral
/logger:XMLLogger,C:\Loggers\MyLogger.dll;OutputAsHTML
/verbosity:&lt;level&gt; Display this amount of information in the event log.
The available verbosity levels are: q[uiet], m[inimal],
n[ormal], d[etailed], and diag[nostic]. (Short form: /v)
Example:
/verbosity:quiet
/consoleloggerparameters:&lt;parameters&gt;
Parameters to console logger. (Short form: /clp)
The available parameters are:
PerformanceSummary--show time spent in tasks, targets
and projects.
NoSummary--don't show error and warning summary at the
end.
NoItemAndPropertyList--don't show list of items and
properties at the start of each project build.
Example:
/consoleloggerparameters:PerformanceSummary;NoSummary
/noconsolelogger Disable the default console logger and do not log events
to the console. (Short form: /noconlog)
/validate Validate the project against the default schema. (Short
form: /val)
/validate:&lt;schema&gt; Validate the project against the specified schema. (Short
form: /val)
Example:
/validate:MyExtendedBuildSchema.xsd
Examples:
MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release
MSBuild MyApp.csproj /t:Clean /p:Configuration=Debug
</value>
</data>
<data name="ProjectNotFoundError" xml:space="preserve">
<value>MSBUILD : error MSB1009: Project file does not exist.</value>
</data>
<data name="ResponseFileNotFoundError" xml:space="preserve">
<value>MSBUILD : error MSB1022: Response file does not exist.</value>
</data>
<data name="LoggerCreationError" xml:space="preserve">
<value>MSBUILD : error MSB1021: Cannot create an instance of the logger. {0}</value>
</data>
<data name="CannotAutoDisableAutoResponseFile" xml:space="preserve">
<value>MSBUILD : error MSB1027: The /noautoresponse switch cannot be specified in the MSBuild.rsp auto-response file, nor in any response file that is referenced by the auto-response file.</value>
</data>
<data name="RepeatedResponseFileError" xml:space="preserve">
<value>MSBUILD : error MSB1013: The response file was specified twice. A response file can be specified only once.</value>
</data>
<data name="PickedUpSwitchesFromAutoResponse" xml:space="preserve">
<value>Some command line switches were read from the auto-response file "{0}". To disable this file, use the "/noautoresponse" switch.
</value>
</data>
<data name="UnexpectedParametersError" xml:space="preserve">
<value>MSBUILD : error MSB1002: This switch does not take any parameters.</value>
</data>
<data name="MultipleSchemasError" xml:space="preserve">
<value>MSBUILD : error MSB1024: Only one schema can be specified for validation of the project.</value>
</data>
<data name="InvalidVerbosityError" xml:space="preserve">
<value>MSBUILD : error MSB1018: Verbosity level is not valid.</value>
</data>
<data name="MissingVerbosityError" xml:space="preserve">
<value>MSBUILD : error MSB1016: Specify the verbosity level.</value>
</data>
<data name="MissingPropertyError" xml:space="preserve">
<value>MSBUILD : error MSB1005: Specify a property and its value.</value>
</data>
<data name="InvalidPropertyError" xml:space="preserve">
<value>MSBUILD : error MSB1006: Property is not valid.</value>
</data>
<data name="UnsupportedOS" xml:space="preserve">
<value>MSBUILD : error MSB1015: MSBuild does not run on this version of the operating system. It is only supported on Windows 2000, Windows XP, and later versions.</value>
</data>
<data name="LoggerNotFoundError" xml:space="preserve">
<value>MSBUILD : error MSB1020: The logger was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided.</value>
</data>
<data name="ReadResponseFileError" xml:space="preserve">
<value>MSBUILD : error MSB1023: Cannot read the response file. {0}</value>
</data>
<data name="AmbiguousProjectError" xml:space="preserve">
<value>MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.</value>
</data>
<data name="LoggerFailurePrefixWithErrorCode" xml:space="preserve">
<value>MSBUILD : Logger error MSB1029: {0}</value>
</data>
<data name="MissingLoggerError" xml:space="preserve">
<value>MSBUILD : error MSB1007: Specify a logger.</value>
</data>
<data name="DuplicateProjectSwitchError" xml:space="preserve">
<value>MSBUILD : error MSB1008: Only one project can be specified.</value>
</data>
<data name="InvalidLoggerError" xml:space="preserve">
<value>MSBUILD : error MSB1019: Logger switch was not correctly formed.</value>
</data>
<data name="MissingResponseFileError" xml:space="preserve">
<value>MSBUILD : error MSB1012: Specify a response file.</value>
</data>
<data name="HelpPrompt" xml:space="preserve">
<value>For switch syntax, type "MSBuild /help"</value>
</data>
<data name="SchemaNotFoundError" xml:space="preserve">
<value>MSBUILD : error MSB1026: Schema file does not exist.</value>
</data>
<data name="InvalidSwitchIndicator" xml:space="preserve">
<value>Switch: {0}</value>
</data>
<data name="LoggerFailurePrefixNoErrorCode" xml:space="preserve">
<value>MSBUILD: Logger error {0}: {1}</value>
</data>
<data name="MissingTargetError" xml:space="preserve">
<value>MSBUILD : error MSB1004: Specify the name of the target.</value>
</data>
</root>
@@ -0,0 +1,51 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.AssemblyLoadInfo
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
namespace Microsoft.Build.Shared
{
internal sealed class AssemblyLoadInfo
{
private string assemblyName;
private string assemblyFile;
private AssemblyLoadInfo()
{
}
internal AssemblyLoadInfo(string assemblyName, string assemblyFile)
{
ErrorUtilities.VerifyThrow(assemblyName != null && assemblyName.Length > 0 || assemblyFile != null && assemblyFile.Length > 0, "We must have either the assembly name or the assembly file/path.");
ErrorUtilities.VerifyThrow(assemblyName == null || assemblyFile == null, "We must not have both the assembly name and the assembly file/path.");
this.assemblyName = assemblyName;
this.assemblyFile = assemblyFile;
}
internal string AssemblyName => this.assemblyName;
internal string AssemblyFile => this.assemblyFile;
public override string ToString()
{
if (this.assemblyName != null)
{
ErrorUtilities.VerifyThrow(this.assemblyFile == null, "We cannot have both the assembly name and the assembly file/path.");
return this.assemblyName;
}
ErrorUtilities.VerifyThrow(this.assemblyFile != null, "We must have either the assembly name or the assembly file/path.");
return this.assemblyFile;
}
public override int GetHashCode() => this.ToString().GetHashCode();
public override bool Equals(object obj)
{
if (obj == null || !(obj is AssemblyLoadInfo))
return false;
AssemblyLoadInfo assemblyLoadInfo = (AssemblyLoadInfo) obj;
return this.AssemblyName == assemblyLoadInfo.AssemblyName && this.AssemblyFile == assemblyLoadInfo.AssemblyFile;
}
}
}
@@ -0,0 +1,19 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.AssemblyResources
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System.Globalization;
using System.Reflection;
using System.Resources;
namespace Microsoft.Build.Shared
{
internal static class AssemblyResources
{
private static readonly ResourceManager resources = new ResourceManager("MSBuild.Strings", Assembly.GetExecutingAssembly());
internal static string GetString(string name) => AssemblyResources.resources.GetString(name, CultureInfo.CurrentUICulture);
}
}
@@ -0,0 +1,193 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.ErrorUtilities
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System;
namespace Microsoft.Build.Shared
{
internal static class ErrorUtilities
{
private static void ThrowInternalError(
bool showAssert,
string unformattedMessage,
params object[] args)
{
throw new InternalErrorException(ResourceUtilities.FormatString(unformattedMessage, args), showAssert);
}
internal static void VerifyThrowNoAssert(bool condition, string unformattedMessage)
{
if (condition)
return;
ErrorUtilities.ThrowInternalError(false, unformattedMessage, (object[]) null);
}
internal static void VerifyThrow(bool condition, string unformattedMessage)
{
if (condition)
return;
ErrorUtilities.ThrowInternalError(true, unformattedMessage, (object[]) null);
}
internal static void VerifyThrow(bool condition, string unformattedMessage, object arg0)
{
if (condition)
return;
ErrorUtilities.ThrowInternalError(true, unformattedMessage, arg0);
}
internal static void VerifyThrow(
bool condition,
string unformattedMessage,
object arg0,
object arg1)
{
if (condition)
return;
ErrorUtilities.ThrowInternalError(true, unformattedMessage, arg0, arg1);
}
internal static void VerifyThrow(
bool condition,
string unformattedMessage,
object arg0,
object arg1,
object arg2)
{
if (condition)
return;
ErrorUtilities.ThrowInternalError(true, unformattedMessage, arg0, arg1, arg2);
}
internal static void VerifyThrow(
bool condition,
string unformattedMessage,
object arg0,
object arg1,
object arg2,
object arg3)
{
if (condition)
return;
ErrorUtilities.ThrowInternalError(true, unformattedMessage, arg0, arg1, arg2, arg3);
}
private static void ThrowInvalidOperation(string resourceName, params object[] args) => throw new InvalidOperationException(ResourceUtilities.FormatResourceString(resourceName, args));
internal static void VerifyThrowInvalidOperation(bool condition, string resourceName)
{
if (condition)
return;
ErrorUtilities.ThrowInvalidOperation(resourceName, (object[]) null);
}
internal static void VerifyThrowInvalidOperation(
bool condition,
string resourceName,
object arg0)
{
if (condition)
return;
ErrorUtilities.ThrowInvalidOperation(resourceName, arg0);
}
internal static void VerifyThrowInvalidOperation(
bool condition,
string resourceName,
object arg0,
object arg1)
{
if (condition)
return;
ErrorUtilities.ThrowInvalidOperation(resourceName, arg0, arg1);
}
internal static void VerifyThrowInvalidOperation(
bool condition,
string resourceName,
object arg0,
object arg1,
object arg2)
{
if (condition)
return;
ErrorUtilities.ThrowInvalidOperation(resourceName, arg0, arg1, arg2);
}
private static void ThrowArgument(
Exception innerException,
string resourceName,
params object[] args)
{
throw new ArgumentException(ResourceUtilities.FormatResourceString(resourceName, args), innerException);
}
internal static void VerifyThrowArgument(bool condition, string resourceName) => ErrorUtilities.VerifyThrowArgument(condition, (Exception) null, resourceName);
internal static void VerifyThrowArgument(bool condition, string resourceName, object arg0) => ErrorUtilities.VerifyThrowArgument(condition, (Exception) null, resourceName, arg0);
internal static void VerifyThrowArgument(
bool condition,
string resourceName,
object arg0,
object arg1)
{
ErrorUtilities.VerifyThrowArgument(condition, (Exception) null, resourceName, arg0, arg1);
}
internal static void VerifyThrowArgument(
bool condition,
Exception innerException,
string resourceName)
{
if (condition)
return;
ErrorUtilities.ThrowArgument(innerException, resourceName, (object[]) null);
}
internal static void VerifyThrowArgument(
bool condition,
Exception innerException,
string resourceName,
object arg0)
{
if (condition)
return;
ErrorUtilities.ThrowArgument(innerException, resourceName, arg0);
}
internal static void VerifyThrowArgument(
bool condition,
Exception innerException,
string resourceName,
object arg0,
object arg1)
{
if (condition)
return;
ErrorUtilities.ThrowArgument(innerException, resourceName, arg0, arg1);
}
internal static void VerifyThrowArgumentOutOfRange(bool condition, string parameterName)
{
if (!condition)
throw new ArgumentOutOfRangeException(parameterName);
}
internal static void VerifyThrowArgumentLength(string parameter, string parameterName)
{
ErrorUtilities.VerifyThrowArgumentNull((object) parameter, parameterName);
if (parameter.Length == 0)
throw new ArgumentException(ResourceUtilities.FormatResourceString("Shared.ParameterCannotHaveZeroLength", (object) parameterName));
}
internal static void VerifyThrowArgumentNull(object parameter, string parameterName)
{
if (parameter == null)
throw new ArgumentNullException(ResourceUtilities.FormatResourceString("Shared.ParameterCannotBeNull", (object) parameterName), (Exception) null);
}
}
}
@@ -0,0 +1,39 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.InternalErrorException
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System;
namespace Microsoft.Build.Shared
{
internal sealed class InternalErrorException : Exception
{
internal InternalErrorException()
{
}
internal InternalErrorException(string message)
: base("Internal MSBuild Error: " + message)
{
this.ShowAssertDialog(true);
}
internal InternalErrorException(string message, bool showAssert)
: base("Internal MSBuild Error: " + message)
{
this.ShowAssertDialog(showAssert);
}
internal InternalErrorException(string message, Exception innerException)
: base("Internal MSBuild Error: " + message, innerException)
{
}
private void ShowAssertDialog(bool showAssert)
{
int num = showAssert ? 1 : 0;
}
}
}
@@ -0,0 +1,32 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.LoadedType
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System;
namespace Microsoft.Build.Shared
{
internal sealed class LoadedType
{
private Type type;
private AssemblyLoadInfo assembly;
private LoadedType()
{
}
internal LoadedType(Type type, AssemblyLoadInfo assembly)
{
ErrorUtilities.VerifyThrow((object) type != null, "We must have the type.");
ErrorUtilities.VerifyThrow(assembly != null, "We must have the assembly the type was loaded from.");
this.type = type;
this.assembly = assembly;
}
internal Type Type => this.type;
internal AssemblyLoadInfo Assembly => this.assembly;
}
}
@@ -0,0 +1,125 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.QuotingUtilities
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System.Collections;
using System.Text;
namespace Microsoft.Build.Shared
{
internal static class QuotingUtilities
{
private static readonly char[] splitMarker = new char[1];
internal static ArrayList SplitUnquoted(
string input,
int maxSplits,
bool keepEmptySplits,
bool unquote,
out int emptySplits,
params char[] separator)
{
ErrorUtilities.VerifyThrow(maxSplits >= 2, "There is no point calling this method for less than two splits.");
string str1 = new StringBuilder().Append(separator).ToString();
ErrorUtilities.VerifyThrow(str1.IndexOf('"') == -1, "The double-quote character is not supported as a separator.");
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.EnsureCapacity(input.Length);
bool flag = false;
int num1 = 0;
int num2 = 1;
for (int index = 0; index < input.Length && num2 < maxSplits; ++index)
{
switch (input[index])
{
case char.MinValue:
continue;
case '"':
stringBuilder.Append('"');
if (num1 % 2 == 0)
{
if (flag && index < input.Length - 1 && input[index + 1] == '"')
{
stringBuilder.Append('"');
++index;
}
flag = !flag;
}
num1 = 0;
continue;
case '\\':
stringBuilder.Append('\\');
++num1;
continue;
default:
if (!flag && (str1.Length == 0 && char.IsWhiteSpace(input[index]) || str1.IndexOf(input[index]) != -1))
{
stringBuilder.Append(char.MinValue);
if (++num2 == maxSplits)
stringBuilder.Append(input, index + 1, input.Length - (index + 1));
}
else
stringBuilder.Append(input[index]);
num1 = 0;
continue;
}
}
ArrayList arrayList = new ArrayList();
emptySplits = 0;
foreach (string input1 in stringBuilder.ToString().Split(QuotingUtilities.splitMarker, maxSplits))
{
string str2 = unquote ? QuotingUtilities.Unquote(input1) : input1;
if (str2.Length > 0 || keepEmptySplits)
arrayList.Add((object) str2);
else
++emptySplits;
}
return arrayList;
}
internal static ArrayList SplitUnquoted(string input, params char[] separator) => QuotingUtilities.SplitUnquoted(input, int.MaxValue, false, false, out int _, separator);
internal static string Unquote(string input, out int doubleQuotesRemoved)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.EnsureCapacity(input.Length);
bool flag = false;
int repeatCount = 0;
doubleQuotesRemoved = 0;
for (int index = 0; index < input.Length; ++index)
{
switch (input[index])
{
case '"':
stringBuilder.Append('\\', repeatCount / 2);
if (repeatCount % 2 == 0)
{
if (flag && index < input.Length - 1 && input[index + 1] == '"')
{
stringBuilder.Append('"');
++index;
}
flag = !flag;
++doubleQuotesRemoved;
}
else
stringBuilder.Append('"');
repeatCount = 0;
break;
case '\\':
++repeatCount;
break;
default:
stringBuilder.Append('\\', repeatCount);
stringBuilder.Append(input[index]);
repeatCount = 0;
break;
}
}
return stringBuilder.Append('\\', repeatCount).ToString();
}
internal static string Unquote(string input) => QuotingUtilities.Unquote(input, out int _);
}
}
@@ -0,0 +1,57 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.ResourceUtilities
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System;
using System.Globalization;
using System.Text.RegularExpressions;
namespace Microsoft.Build.Shared
{
internal static class ResourceUtilities
{
private static readonly Regex msbuildMessageCodePattern = new Regex("^\\s*(?<CODE>MSB\\d\\d\\d\\d):\\s*(?<MESSAGE>.*)$", RegexOptions.Singleline);
internal static string ExtractMessageCode(
Regex messageCodePattern,
string messageWithCode,
out string code)
{
code = (string) null;
string messageCode = messageWithCode;
if (messageCodePattern == null)
messageCodePattern = ResourceUtilities.msbuildMessageCodePattern;
Match match = messageCodePattern.Match(messageWithCode);
if (match.Success)
{
code = match.Groups["CODE"].Value;
messageCode = match.Groups["MESSAGE"].Value;
}
return messageCode;
}
private static string GetHelpKeyword(string resourceName) => "MSBuild." + resourceName;
internal static string FormatResourceString(
out string code,
out string helpKeyword,
string resourceName,
params object[] args)
{
helpKeyword = ResourceUtilities.GetHelpKeyword(resourceName);
return ResourceUtilities.ExtractMessageCode((Regex) null, ResourceUtilities.FormatString(AssemblyResources.GetString(resourceName), args), out code);
}
internal static string FormatResourceString(string resourceName, params object[] args) => ResourceUtilities.FormatResourceString(out string _, out string _, resourceName, args);
internal static string FormatString(string unformatted, params object[] args)
{
string str = unformatted;
if (args != null && args.Length > 0)
str = string.Format((IFormatProvider) CultureInfo.CurrentCulture, unformatted, args);
return str;
}
}
}
@@ -0,0 +1,117 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Build.Shared.TypeLoader
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace Microsoft.Build.Shared
{
internal class TypeLoader
{
private Dictionary<AssemblyLoadInfo, List<Type>> cacheOfAllDesiredTypesInAnAssembly = new Dictionary<AssemblyLoadInfo, List<Type>>();
private TypeFilter isDesiredType;
internal TypeLoader(TypeFilter isDesiredType)
{
ErrorUtilities.VerifyThrow(isDesiredType != null, "need a type filter");
this.isDesiredType = isDesiredType;
}
internal LoadedType Load(string typeName, AssemblyLoadInfo assembly)
{
Type type1 = (Type) null;
List<Type> typeList = (List<Type>) null;
this.cacheOfAllDesiredTypesInAnAssembly.TryGetValue(assembly, out typeList);
if (assembly.AssemblyName != null && typeName.Length > 0)
{
if (typeList == null)
{
try
{
type1 = Type.GetType(typeName + "," + assembly.AssemblyName, false, true);
}
catch (ArgumentException ex)
{
}
}
}
if ((object) type1 != null)
{
if (!this.isDesiredType(type1, (object) null))
return (LoadedType) null;
}
else
{
if (typeList == null)
{
Assembly assembly1;
try
{
assembly1 = assembly.AssemblyName == null ? Assembly.LoadFrom(assembly.AssemblyFile) : Assembly.Load(assembly.AssemblyName);
}
catch (ArgumentException ex)
{
throw new FileNotFoundException((string) null, assembly.ToString(), (Exception) ex);
}
Type[] exportedTypes = assembly1.GetExportedTypes();
typeList = new List<Type>();
foreach (Type m in exportedTypes)
{
if (this.isDesiredType(m, (object) null))
typeList.Add(m);
}
this.cacheOfAllDesiredTypesInAnAssembly[assembly] = typeList;
}
foreach (Type type2 in typeList)
{
if (typeName.Length == 0 || TypeLoader.IsPartialTypeNameMatch(type2.FullName, typeName))
{
type1 = type2;
break;
}
}
}
return (object) type1 != null ? new LoadedType(type1, assembly) : (LoadedType) null;
}
internal static bool IsPartialTypeNameMatch(string typeName1, string typeName2)
{
bool flag = false;
if (typeName1.Length != typeName2.Length)
{
string str1;
string str2;
if (typeName1.Length > typeName2.Length)
{
str1 = typeName1;
str2 = typeName2;
}
else
{
str1 = typeName2;
str2 = typeName1;
}
if (str1.EndsWith(str2, StringComparison.OrdinalIgnoreCase))
{
int num1 = str1.Length - str2.Length;
if (str1[num1 - 1] == '.' || str1[num1 - 1] == '+')
{
int num2 = 0;
for (int index = num1 - 2; index >= 0 && str1[index] == '\\'; --index)
++num2;
if (num2 % 2 == 0)
flag = true;
}
}
}
else
flag = string.Compare(typeName1, typeName2, StringComparison.OrdinalIgnoreCase) == 0;
return flag;
}
}
}
@@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: ThisAssembly
// Assembly: MSBuild, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: E42BAB90-704E-4C03-B5C0-D4E3A6B884E3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe
internal static class ThisAssembly
{
internal const string Title = "MSBuild.exe";
internal const string Description = "MSBuild.exe";
internal const string DefaultAlias = "MSBuild.exe";
internal const string Copyright = "© Microsoft Corporation. All rights reserved.";
internal const string Version = "2.0.0.0";
internal const string InformationalVersion = "2.0.50727.1433";
internal const int DailyBuildNumber = 50727;
}
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Project was exported from assembly: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.exe-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{85671DEF-2305-4524-8CA7-903D921D84FB}</ProjectGuid>
<OutputType>Exe</OutputType>
<AssemblyName>MSBuild</AssemblyName>
<ApplicationVersion>2.0.0.0</ApplicationVersion>
<RootNamespace>Microsoft.Build</RootNamespace>
</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>
<ItemGroup>
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="FXAssembly.cs" />
<Compile Include="ThisAssembly.cs" />
<Compile Include="AssemblyRef.cs" />
<Compile Include="Shared\AssemblyResources.cs" />
<Compile Include="Shared\AssemblyLoadInfo.cs" />
<Compile Include="Shared\ErrorUtilities.cs" />
<Compile Include="Shared\QuotingUtilities.cs" />
<Compile Include="Shared\InternalErrorException.cs" />
<Compile Include="Shared\LoadedType.cs" />
<Compile Include="Shared\ResourceUtilities.cs" />
<Compile Include="Shared\TypeLoader.cs" />
<Compile Include="CommandLine\CommandLineSwitches.cs" />
<Compile Include="CommandLine\CommandLineSwitchException.cs" />
<Compile Include="CommandLine\InitializationException.cs" />
<Compile Include="CommandLine\MSBuildApp.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MSBuild\Strings.resx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSBuild", "Virus.Win32.Nimnul.c-d5c6463b93131b3c485115414cf5809e01323986e3d4274a4868222cbb54aa43.csproj", "{85671DEF-2305-4524-8CA7-903D921D84FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{85671DEF-2305-4524-8CA7-903D921D84FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85671DEF-2305-4524-8CA7-903D921D84FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85671DEF-2305-4524-8CA7-903D921D84FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85671DEF-2305-4524-8CA7-903D921D84FB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal