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
|
|
|
|
{
|
|
|
|
|
// Token: 0x02000005 RID: 5
|
|
|
|
|
internal static class Program
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x0600004B RID: 75 RVA: 0x000042AF File Offset: 0x000024AF
|
|
|
|
|
[STAThread]
|
|
|
|
|
private static void Main()
|
|
|
|
|
{
|
2023-01-23 05:06:08 +01:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
|
|
|
|
|
bool driverOpen = DriverInterface.IsDriverOpen("\\\\.\\KsDumper");
|
|
|
|
|
if (!driverOpen)
|
|
|
|
|
{
|
|
|
|
|
Application.Run(new SplashForm());
|
|
|
|
|
Application.Run(new Dumper());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Application.Run(new Dumper());
|
|
|
|
|
}
|
2023-01-22 01:59:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x0600004C RID: 76 RVA: 0x000042D0 File Offset: 0x000024D0
|
|
|
|
|
private static void StartDriver()
|
|
|
|
|
{
|
|
|
|
|
string logPath = Environment.CurrentDirectory + "\\driverLoading.log";
|
|
|
|
|
bool flag = !File.Exists(logPath);
|
|
|
|
|
FileStream outputStream;
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
outputStream = File.Create(logPath);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
outputStream = File.OpenWrite(logPath);
|
|
|
|
|
}
|
|
|
|
|
StreamWriter wr = new StreamWriter(outputStream);
|
2023-01-23 05:06:08 +01:00
|
|
|
|
|
|
|
|
|
bool driverOpen = DriverInterface.IsDriverOpen("\\\\.\\KsDumper");
|
2023-01-23 00:31:23 +01:00
|
|
|
|
if (!driverOpen)
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
|
|
|
|
ProcessStartInfo inf = new ProcessStartInfo(Environment.CurrentDirectory + "\\Driver\\kdu.exe", " -prv 1 -map .\\Driver\\KsDumperDriver.sys")
|
|
|
|
|
{
|
|
|
|
|
CreateNoWindow = true,
|
|
|
|
|
UseShellExecute = false,
|
2023-01-23 05:06:08 +01:00
|
|
|
|
//RedirectStandardOutput = true,
|
|
|
|
|
//RedirectStandardError = true
|
2023-01-22 01:59:06 +01:00
|
|
|
|
};
|
|
|
|
|
Process proc = Process.Start(inf);
|
|
|
|
|
proc.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e)
|
|
|
|
|
{
|
2023-01-23 05:06:08 +01:00
|
|
|
|
if (!string.IsNullOrEmpty(e.Data))
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
|
|
|
|
wr.WriteLine(e.Data);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
proc.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e)
|
|
|
|
|
{
|
2023-01-23 05:06:08 +01:00
|
|
|
|
if (!string.IsNullOrEmpty(e.Data))
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
|
|
|
|
wr.WriteLine(e.Data);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
proc.WaitForExit();
|
|
|
|
|
wr.Flush();
|
|
|
|
|
wr.Close();
|
|
|
|
|
outputStream.Close();
|
|
|
|
|
outputStream.Dispose();
|
2023-01-23 05:06:08 +01:00
|
|
|
|
driverOpen = DriverInterface.IsDriverOpen("\\\\.\\KsDumper");
|
|
|
|
|
if (!driverOpen)
|
2023-01-22 01:59:06 +01:00
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("Error! Tried to start driver, and it failed to start!");
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|