public static string[] GetExportedMethodsNames(string sPEName)
        {
            uint   nFileHandle;
            uint   nFileMapping;
            IntPtr PEBaseAddr;

            string[] ExportedMethodsNames;

            if (!PEImageHelper.GetPEImage(sPEName, out nFileHandle, out nFileMapping, out PEBaseAddr))
            {
                throw new TisException("Bad PE image");
            }

            try
            {
                IntPtr ImageNTHeadersAddr;
                PEImageHelper._IMAGE_NT_HEADERS ImageNTHeaders;

                if (!PEImageHelper.GetImageNTHeaders(PEBaseAddr, out ImageNTHeadersAddr, out ImageNTHeaders))
                {
                    throw new TisException("Bad PE image");
                }

                GetExportedMethodsNames(PEBaseAddr, ImageNTHeadersAddr, ImageNTHeaders, out ExportedMethodsNames);
            }
            finally
            {
                PEImageHelper.FreePEImage(nFileHandle, nFileMapping, PEBaseAddr);
            }

            return(ExportedMethodsNames);
        }
        internal static PEInvokeType GetPEInvokeType(string sPEName)
        {
            bool   bIsDNAssembly = false;
            bool   bIsWin32DLL   = false;
            uint   nFileHandle;
            uint   nFileMapping;
            IntPtr PEBaseAddr;

            if (!PEImageHelper.GetPEImage(sPEName, out nFileHandle, out nFileMapping, out PEBaseAddr))
            {
                throw new TisException("Bad PE image");
            }

            try
            {
                IntPtr ImageNTHeadersAddr;
                PEImageHelper._IMAGE_NT_HEADERS   ImageNTHeaders;
                PEImageHelper._IMAGE_COR20_HEADER ImageCor20Header;

                if (!PEImageHelper.GetImageNTHeaders(PEBaseAddr, out ImageNTHeadersAddr, out ImageNTHeaders))
                {
                    throw new TisException("Bad PE image");
                }

                bIsDNAssembly = PEImageHelper.GetCor20Header(PEBaseAddr, ImageNTHeadersAddr, ImageNTHeaders, out ImageCor20Header);

                if (bIsDNAssembly)
                {
                    return(PEInvokeType.DNAssembly);
                }

                PEImageHelper._IMAGE_EXPORT_DIRECTORY ImageExportDir;
                bIsWin32DLL = PEImageHelper.GetExportDirectory(PEBaseAddr, ImageNTHeadersAddr, ImageNTHeaders, out ImageExportDir);

                if (bIsWin32DLL)
                {
                    return(PEInvokeType.Win32DLL);
                }
            }
            finally
            {
                PEImageHelper.FreePEImage(nFileHandle, nFileMapping, PEBaseAddr);
            }

            return(PEInvokeType.Unknown);
        }