public override string ToString()
        {
            if (Valid)
            {
                try
                {
                    StringBuilder output = new StringBuilder();

                    output.AppendLine($"HAL build info: {HalBuildVersion?.ToString()}, {HalBuildInfo}");
                    output.AppendLine();
                    output.AppendLine($"Image build @ { ImageBuildDate } { ImageCompilerInfo } v{ ImageCompilerVersion.ToString() }");
                    output.AppendLine();
                    output.AppendLine($"OEM Product codes (vendor, model, SKU): {OEM.ToString()}, {Model.ToString()}, {SKU.ToString()}");
                    output.AppendLine();
                    output.AppendLine("Serial Numbers (module, system):");
                    output.AppendLine("  " + ModuleSerialNumber);
                    output.AppendLine("  " + SystemSerialNumber);
                    output.AppendLine();
                    output.AppendLine($"Solution Build Info: {SolutionBuildVersion?.ToString()}, {SolutionBuildInfo}");

                    output.AppendLine();
                    output.AppendLine("AppDomains:");
                    foreach (IAppDomainInfo adi in AppDomains)
                    {
                        output.AppendLine($"  {adi.Name}, id={adi.ID}");
                    }

                    output.AppendLine();
                    output.AppendLine("Assemblies:");
                    foreach (IAssemblyInfo ai in Assemblies)
                    {
                        output.AppendLine($"  {ai.Name}, {ai.Version}");
                    }

                    output.AppendLine();
                    output.AppendLine("Native Assemblies:");
                    foreach (CLRCapabilities.NativeAssemblyProperties assembly in NativeAssemblies)
                    {
                        output.AppendLine($"  {assembly.Name} v{assembly.Version}, checksum 0x{assembly.Checksum.ToString("X8")}");
                    }

                    return(output.ToString());
                }
                catch { };
            }

            return("DeviceInfo is not valid!");
        }
Ejemplo n.º 2
0
        public override string ToString()
        {
            if (m_fValid)
            {
                try
                {
                    StringBuilder output = new StringBuilder();

                    output.AppendLine(String.Format("HAL build info: {0}, {1}", HalBuildVersion?.ToString(), HalBuildInfo?.TrimEnd('\0')));
                    output.AppendLine(String.Format("OEM Product codes (vendor, model, SKU): {0}, {1}, {2}", OEM.ToString(), Model.ToString(), SKU.ToString()));
                    output.AppendLine("Serial Numbers (module, system):");
                    output.AppendLine("  " + ModuleSerialNumber?.TrimEnd('\0'));
                    output.AppendLine("  " + SystemSerialNumber?.TrimEnd('\0'));
                    output.AppendLine(String.Format("Solution Build Info: {0}, {1}", SolutionBuildVersion?.ToString(), SolutionBuildInfo?.TrimEnd('\0')));

                    output.AppendLine("AppDomains:");
                    foreach (IAppDomainInfo adi in AppDomains)
                    {
                        output.AppendLine(String.Format("  {0}, id={1}", adi.Name, adi.ID));
                    }

                    output.AppendLine("Assemblies:");
                    foreach (IAssemblyInfo ai in Assemblies)
                    {
                        output.AppendLine(String.Format("  {0}, {1}", ai.Name, ai.Version));
                    }

                    return(output.ToString());
                }
                catch { };
            }

            return("DeviceInfo is not valid!");
        }
        public override string ToString()
        {
            if (Valid)
            {
                try
                {
                    StringBuilder output = new StringBuilder();

                    output.AppendLine($"HAL build info: {HalBuildInfo}");
                    output.AppendLine($"  Target:   {TargetName?.ToString()}");
                    output.AppendLine($"  Platform: {Platform?.ToString()}");
                    output.AppendLine();
                    output.AppendLine($"Firmware build Info:");
                    output.AppendLine($"  Date:        {ImageBuildDate ?? "unknown"}");
                    output.AppendLine($"  Type:        {VendorInfo ?? "unknown"}");
                    output.AppendLine($"  CLR Version: {SolutionBuildVersion}");
                    output.AppendLine($"  Compiler:    {ImageCompilerInfo ?? "unknown"} v{ImageCompilerVersion?.ToString()}");
                    output.AppendLine();
                    output.AppendLine($"OEM Product codes (vendor, model, SKU): {OEM.ToString()}, {Model.ToString()}, {SKU.ToString()}");
                    output.AppendLine();
                    output.AppendLine("Serial Numbers (module, system):");
                    output.AppendLine("  " + ModuleSerialNumber);
                    output.AppendLine("  " + SystemSerialNumber);
                    output.AppendLine();
                    output.AppendLine("Target capabilities:");
                    output.AppendLine("  Has nanoBooter: " + (Dbg.HasNanoBooter? "YES" : "NO"));
                    if (Dbg.TargetInfo != null &&
                        Dbg.HasNanoBooter)
                    {
                        output.AppendLine($"  nanoBooter: v{Dbg.TargetInfo.BooterVersion}");
                    }
                    output.AppendLine("  IFU capable: " + (Dbg.IsIFUCapable ? "YES" : "NO"));
                    output.AppendLine("  Has proprietary bootloader: " + (Dbg.HasProprietaryBooter ? "YES" : "NO"));

                    output.AppendLine();
                    output.AppendLine("AppDomains:");
                    foreach (IAppDomainInfo adi in AppDomains)
                    {
                        output.AppendLine($"  {adi.Name}, id={adi.ID}");
                    }

                    output.AppendLine();
                    output.AppendLine("Assemblies:");
                    foreach (IAssemblyInfo ai in Assemblies)
                    {
                        output.AppendLine($"  {ai.Name}, {ai.Version}");
                    }

                    output.AppendLine();
                    output.AppendLine("Native Assemblies:");
                    foreach (CLRCapabilities.NativeAssemblyProperties assembly in NativeAssemblies)
                    {
                        output.AppendLine($"  {assembly.Name} v{assembly.Version}, checksum 0x{assembly.Checksum.ToString("X8")}");
                    }

                    return(output.ToString());
                }
                catch
                {
                    // catch everything, doesn't matter
                }
            }

            return("DeviceInfo is not valid!");
        }