Beispiel #1
0
        public void GetTables()
        {
            int i = 0;

            while (i < m_dwLen)
            {
                SMBIOStable p_oTable = new SMBIOStable();
                p_oTable.m_bTableType = m_pbBIOSData[i];
                p_oTable.m_bFormattedSectionLength = m_pbBIOSData[i + 1];
                p_oTable.m_wHandle = BitConverter.ToInt16(m_pbBIOSData, i + 2);

                int wUnformattedSectionStart = i + p_oTable.m_bFormattedSectionLength;
                p_oTable.p_bFormattedSection = m_pbBIOSData.Skip(i).Take(p_oTable.m_bFormattedSectionLength).ToArray();

                for (int j = i + p_oTable.m_bFormattedSectionLength; ; j++)
                {
                    if ((m_pbBIOSData[j] == 0) && (m_pbBIOSData[j + 1] == 0))
                    {
                        p_oTable.p_bUnformattedSection = m_pbBIOSData.Skip(i + p_oTable.m_bFormattedSectionLength).Take(j - i - p_oTable.m_bFormattedSectionLength).ToArray();
                        i = j + 2;
                        break;
                    }
                }
                if (p_oTable.p_bUnformattedSection.Length > 0)
                {
                    p_oTable.p_sStrings = Encoding.ASCII.GetString(p_oTable.p_bUnformattedSection).Split('\0');
                }
                p_oSMBIOStables.Add(p_oTable);
            }
        }
Beispiel #2
0
 public void ParseTable1(SMBIOStable table)
 {
     switch (table.m_bTableType)
     {
     case 17:
         Console.WriteLine(string.Join(",", table.p_sStrings));
         break;
     }
 }
Beispiel #3
0
 public void ParseTable(SMBIOStable table)
 {
     switch (table.m_bTableType)
     {
     case 17:
         Console.WriteLine(dmi_memory_type(table.p_bFormattedSection[18]));
         break;
     }
 }