Beispiel #1
0
        private void LoadLibraryMetadata()
        {
            cachedDllMetadata = new List <DllContext>();
            foreach (string file in Program.GetLibraryFiles())
            {
                if (Path.GetExtension(file).ToLower() != ".dll")
                {
                    continue;
                }

                DllContext libraryToLoad = new DllContext(file, false);
                libraryToLoad.UnloadLibrary();
                cachedDllMetadata.Add(libraryToLoad);
            }
        }
Beispiel #2
0
        private void DiagnosticsDumpReport()
        {
            List <DllContext> libraries = new List <DllContext>();

            foreach (string file in Program.GetLibraryFiles())
            {
                if (Path.GetExtension(file).ToLower() != ".dll")
                {
                    continue;
                }

                DllContext libraryToLoad = new DllContext(file);
                libraryToLoad.UnloadLibrary();
                libraries.Add(libraryToLoad);
            }

            string        divider = "==========================================================";
            StringBuilder sb      = new StringBuilder();

            foreach (DllContext library in libraries)
            {
                sb.AppendLine(divider);
                sb.AppendLine();
                sb.AppendLine(library.FileName);
                sb.AppendLine($"SHA1: {library.SHA1Hash}");
                sb.AppendLine($"ECUName: {library.ECUName}");
                sb.AppendLine($"Comment: {library.Comment}");
                sb.AppendLine($"Comment: {library.Comment}");
                sb.AppendLine($"Exports: [{string.Join(", ", library.DllExports)}]");
                string accessLevels = string.Join(", ", library.AccessLevels.Select(t => $"[Level: {t.Item1}, KeySize: {t.Item2}, SeedSize: {t.Item3}]"));
                sb.AppendLine($"Levels: [{accessLevels}]");
                sb.AppendLine();
            }

            string exportPath = Program.GetStartupPath() + "Report.txt";

            File.WriteAllText(exportPath, sb.ToString());
            MessageBox.Show($"Export OK : Report saved at \r\n{exportPath}", "Diagnostics");
        }