mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 11:26:11 +00:00
f2ac1ece55
add
165 lines
7.9 KiB
C#
165 lines
7.9 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Microsoft.Exchange.OMA.Unsupported.OmaBrowseInstall.OmaBrowseInstall
|
|
// Assembly: OmaBrowseInstall, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
|
|
// MVID: 1551535E-661F-42F0-81A3-B6A9484A2B9D
|
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Small.l-663b3b2e6b8cbb3371ba997be0422b59723f4a920b855a82c21bc407dd6b0ec4.exe
|
|
|
|
using Microsoft.Win32;
|
|
using System;
|
|
using System.Diagnostics;
|
|
using System.Globalization;
|
|
|
|
namespace Microsoft.Exchange.OMA.Unsupported.OmaBrowseInstall
|
|
{
|
|
internal class OmaBrowseInstall
|
|
{
|
|
[STAThread]
|
|
private static int Main(string[] args)
|
|
{
|
|
bool flag1 = false;
|
|
bool flag2 = false;
|
|
bool flag3 = false;
|
|
bool flag4 = false;
|
|
if (args.Length != 2)
|
|
{
|
|
Console.WriteLine("Usage: OmaBrowseInstall [events | counters] [/create | /delete]");
|
|
return -1;
|
|
}
|
|
if (string.CompareOrdinal("/create", args[0]) == 0 || string.CompareOrdinal("/create", args[1]) == 0)
|
|
flag3 = true;
|
|
if (string.CompareOrdinal("/delete", args[0]) == 0 || string.CompareOrdinal("/delete", args[1]) == 0)
|
|
flag4 = true;
|
|
if (string.CompareOrdinal("events", args[0]) == 0 || string.CompareOrdinal("events", args[1]) == 0)
|
|
flag1 = true;
|
|
if (string.CompareOrdinal("counters", args[0]) == 0 || string.CompareOrdinal("counters", args[1]) == 0)
|
|
flag2 = true;
|
|
string name1 = "software\\Microsoft\\Exchange";
|
|
string name2 = "Server Language";
|
|
try
|
|
{
|
|
ServerStrings.Culture = new CultureInfo((int) Registry.LocalMachine.OpenSubKey(name1).GetValue(name2));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ErrorStrings.ServerLanguageNotFound((object) (name1 + "\\" + name2), (object) ex.Message, (object) ex.StackTrace));
|
|
return -6;
|
|
}
|
|
if (flag4)
|
|
{
|
|
if (flag2)
|
|
{
|
|
try
|
|
{
|
|
if (PerformanceCounterCategory.Exists(ServerStrings.Perf_CategoryName))
|
|
{
|
|
PerformanceCounterCategory.Delete(ServerStrings.Perf_CategoryName);
|
|
Console.WriteLine(ErrorStrings.CounterDeletionSuccessful);
|
|
goto label_39;
|
|
}
|
|
else
|
|
goto label_39;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ErrorStrings.CounterDeletionFailed((object) ex.Message, (object) ex.StackTrace));
|
|
return -2;
|
|
}
|
|
}
|
|
}
|
|
if (flag3)
|
|
{
|
|
if (flag2)
|
|
{
|
|
try
|
|
{
|
|
if (PerformanceCounterCategory.Exists(ServerStrings.Perf_CategoryName))
|
|
PerformanceCounterCategory.Delete(ServerStrings.Perf_CategoryName);
|
|
if (!PerformanceCounterCategory.Exists(ServerStrings.Perf_CategoryName))
|
|
{
|
|
PerformanceCounterCategory.Create(ServerStrings.Perf_CategoryName, ServerStrings.Perf_CategoryHelp, new CounterCreationDataCollection()
|
|
{
|
|
new CounterCreationData(ServerStrings.Perf_BrowseCount, ServerStrings.Perf_BrowseCountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_BrowsesRate, ServerStrings.Perf_BrowsesRateHelp, PerformanceCounterType.RateOfCountsPerSecond32),
|
|
new CounterCreationData(ServerStrings.Perf_CalendarCount, ServerStrings.Perf_CalendarCountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_CalendarRate, ServerStrings.Perf_CalendarRateHelp, PerformanceCounterType.RateOfCountsPerSecond32),
|
|
new CounterCreationData(ServerStrings.Perf_InboxCount, ServerStrings.Perf_InboxCountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_InboxRate, ServerStrings.Perf_InboxRateHelp, PerformanceCounterType.RateOfCountsPerSecond32),
|
|
new CounterCreationData(ServerStrings.Perf_ContactCount, ServerStrings.Perf_ContactCountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_ContactRate, ServerStrings.Perf_ContactRateHelp, PerformanceCounterType.RateOfCountsPerSecond32),
|
|
new CounterCreationData(ServerStrings.Perf_TaskCount, ServerStrings.Perf_TaskCountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_TaskRate, ServerStrings.Perf_TaskRateHelp, PerformanceCounterType.RateOfCountsPerSecond32),
|
|
new CounterCreationData(ServerStrings.Perf_ResponseTimeAverage, ServerStrings.Perf_ResponseTimeAverageHelp, PerformanceCounterType.NumberOfItems32),
|
|
new CounterCreationData(ServerStrings.Perf_InternalResponseTimeAverage, ServerStrings.Perf_InternalResponseTimeAverageHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_ResponseTime, ServerStrings.Perf_ResponseTimeHelp, PerformanceCounterType.NumberOfItems32),
|
|
new CounterCreationData(ServerStrings.Perf_CurrentBrowses, ServerStrings.Perf_CurrentBrowsesHelp, PerformanceCounterType.NumberOfItems32),
|
|
new CounterCreationData(ServerStrings.Perf_MaximumBrowses, ServerStrings.Perf_MaximumBrowsesHelp, PerformanceCounterType.NumberOfItems32),
|
|
new CounterCreationData(ServerStrings.Perf_Status100Count, ServerStrings.Perf_Status100CountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_Status200Count, ServerStrings.Perf_Status200CountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_Status300Count, ServerStrings.Perf_Status300CountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_Status400Count, ServerStrings.Perf_Status400CountHelp, PerformanceCounterType.NumberOfItems64),
|
|
new CounterCreationData(ServerStrings.Perf_Status500Count, ServerStrings.Perf_Status500CountHelp, PerformanceCounterType.NumberOfItems64)
|
|
});
|
|
Console.WriteLine(ErrorStrings.CounterCreationSuccessful);
|
|
goto label_39;
|
|
}
|
|
else
|
|
goto label_39;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ErrorStrings.CounterCreationFailed((object) ex.Message, (object) ex.StackTrace));
|
|
return -3;
|
|
}
|
|
}
|
|
}
|
|
if (flag3)
|
|
{
|
|
if (flag1)
|
|
{
|
|
try
|
|
{
|
|
if (EventLog.SourceExists(ServerStrings.Log_EventSource))
|
|
EventLog.DeleteEventSource(ServerStrings.Log_EventSource);
|
|
EventLog.CreateEventSource(ServerStrings.Log_EventSource, "", ".");
|
|
if (!EventLog.SourceExists("aspnet_wp"))
|
|
EventLog.CreateEventSource("aspnet_wp", "", ".");
|
|
Console.WriteLine(ErrorStrings.EventCreationSuccessful);
|
|
goto label_39;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ErrorStrings.EventCreationFailed((object) ex.Message, (object) ex.StackTrace));
|
|
return -4;
|
|
}
|
|
}
|
|
}
|
|
if (flag4)
|
|
{
|
|
if (flag1)
|
|
{
|
|
try
|
|
{
|
|
if (EventLog.SourceExists(ServerStrings.Log_EventSource))
|
|
{
|
|
EventLog.DeleteEventSource(ServerStrings.Log_EventSource);
|
|
Console.WriteLine(ErrorStrings.EventDeletionSuccessful);
|
|
goto label_39;
|
|
}
|
|
else
|
|
goto label_39;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ErrorStrings.EventDeletionFailed((object) ex.Message, (object) ex.StackTrace));
|
|
return -5;
|
|
}
|
|
}
|
|
}
|
|
Console.WriteLine("Usage: OmaBrowseInstall [events | counters] [/create | /delete]");
|
|
return -1;
|
|
label_39:
|
|
return 0;
|
|
}
|
|
}
|
|
}
|