2023-01-22 01:59:06 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
using System.Windows.Forms;
|
2023-01-22 02:32:57 +01:00
|
|
|
|
using KsDumper11.Driver;
|
2023-01-22 01:59:06 +01:00
|
|
|
|
|
2023-01-22 02:32:57 +01:00
|
|
|
|
namespace KsDumper11
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
2023-10-07 02:53:56 +02:00
|
|
|
|
public class Program
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
|
|
|
|
[STAThread]
|
|
|
|
|
private static void Main()
|
2023-10-07 02:53:56 +02:00
|
|
|
|
{
|
|
|
|
|
KduSelfExtract.DisableDriverBlockList();
|
|
|
|
|
|
|
|
|
|
KduSelfExtract.Extract();
|
|
|
|
|
|
|
|
|
|
|
2023-01-23 05:06:08 +01:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
|
2023-10-07 02:53:56 +02:00
|
|
|
|
bool driverOpen = KsDumperDriverInterface.IsDriverOpen("\\\\.\\KsDumper");
|
|
|
|
|
//Debugger.Break();
|
2023-01-23 05:06:08 +01:00
|
|
|
|
if (!driverOpen)
|
|
|
|
|
{
|
2023-10-07 02:53:56 +02:00
|
|
|
|
if (!File.Exists(KduSelfExtract.AssemblyDirectory + @"\\Providers.json"))
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
2023-10-07 02:53:56 +02:00
|
|
|
|
// Run the selector here to populate the providers and set a default provider.
|
|
|
|
|
Application.Run(new ProviderSelector());
|
|
|
|
|
Application.Run(new Dumper());
|
|
|
|
|
}
|
|
|
|
|
else
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
2023-10-07 02:53:56 +02:00
|
|
|
|
KduWrapper wr = new KduWrapper(KduSelfExtract.AssemblyDirectory + @"\Driver\kdu.exe");
|
|
|
|
|
wr.LoadProviders();
|
|
|
|
|
wr.Start();
|
|
|
|
|
|
|
|
|
|
if (KsDumperDriverInterface.IsDriverOpen("\\\\.\\KsDumper"))
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
2023-10-07 02:53:56 +02:00
|
|
|
|
Application.Run(new Dumper());
|
2023-01-22 01:59:06 +01:00
|
|
|
|
}
|
2023-10-07 02:53:56 +02:00
|
|
|
|
else
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
2023-10-07 02:53:56 +02:00
|
|
|
|
Environment.Exit(0);
|
2023-01-22 01:59:06 +01:00
|
|
|
|
}
|
2023-10-07 02:53:56 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Application.Run(new Dumper());
|
|
|
|
|
}
|
2023-01-22 01:59:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|