Exemplo n.º 1
0
        private static PEInfo GetPEInfo(string fullPath)
        {
            bool isManaged = ContentUtil.IsManaged(fullPath);

            if (!isManaged)
            {
                return(new PEInfo(isManaged));
            }

            bool   isCrossgened   = ContentUtil.IsCrossgened(fullPath);
            string publicKeyToken = ContentUtil.GetPublicKeyToken(fullPath);

            GetTargetFrameworkAndCopyright(fullPath, out string targetFramework, out string copyright);
            return(new PEInfo(isManaged, isCrossgened, copyright, publicKeyToken, targetFramework));
        }
Exemplo n.º 2
0
        private static void GetPEInfo(string fullPath, out bool isManaged, out string publicKeyToken, out string targetFramework, out string copyright)
        {
            isManaged = ContentUtil.IsManaged(fullPath);

            if (!isManaged)
            {
                publicKeyToken  = string.Empty;
                targetFramework = string.Empty;
                copyright       = string.Empty;
                return;
            }

            AssemblyName assemblyName = AssemblyName.GetAssemblyName(fullPath);
            var          pktBytes     = assemblyName.GetPublicKeyToken();

            publicKeyToken = (pktBytes == null || pktBytes.Length == 0) ? string.Empty : string.Join("", pktBytes.Select(b => b.ToString("x2")));
            GetTargetFrameworkAndCopyright(fullPath, out targetFramework, out copyright);
        }
Exemplo n.º 3
0
 internal bool IsManaged() => ContentUtil.IsManaged(FullPath);