示例#1
0
        public bool CheckSMBIOS()
        {
            HasSMBIOS = false;
            //0x000F0000 Start

            //0x000F69E0 VMWare
            //0x000FFF30 VirtualBox

            //0x000FFFFF End
            SMBBIOSAddress = 0x000F0000;
            
            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace( 0, 0 );

            while( SMBBIOSAddress <= 0x000FFFFF )
            {
                //if( Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F534D5F || // "_SM_"  
                //    Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F4D535F ) // "_MS_" indianess 
                if( Memory.Read8Unchecked( SMBBIOSAddress ) == ( byte )0x5F ) // 
                    if( Memory.Read8Unchecked( SMBBIOSAddress + 1 ) == ( byte )0x53 )
                        if( Memory.Read8Unchecked( SMBBIOSAddress + 2 ) == ( byte )0x4D )
                            if( Memory.Read8Unchecked( SMBBIOSAddress + 3 ) == ( byte )0x5F )
                            {

                                Signature = Memory.Read32Unchecked( SMBBIOSAddress );
                                HasSMBIOS = true;
                                break;
                            }

                SMBBIOSAddress++;
            }

            return HasSMBIOS;
        }
示例#2
0
文件: SMBIOS.cs 项目: zer09/Cosmos
        public bool CheckSMBIOS()
        {
            HasSMBIOS = false;
            //0x000F0000 Start

            //0x000F69E0 VMWare
            //0x000FFF30 VirtualBox

            //0x000FFFFF End
            SMBBIOSAddress = 0x000F0000;

            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace(0, 0);

            while (SMBBIOSAddress <= 0x000FFFFF)
            {
                //if( Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F534D5F || // "_SM_"
                //    Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F4D535F ) // "_MS_" indianess
                if (Memory.Read8Unchecked(SMBBIOSAddress) == ( byte )0x5F)    //
                {
                    if (Memory.Read8Unchecked(SMBBIOSAddress + 1) == ( byte )0x53)
                    {
                        if (Memory.Read8Unchecked(SMBBIOSAddress + 2) == ( byte )0x4D)
                        {
                            if (Memory.Read8Unchecked(SMBBIOSAddress + 3) == ( byte )0x5F)
                            {
                                Signature = Memory.Read32Unchecked(SMBBIOSAddress);
                                HasSMBIOS = true;
                                break;
                            }
                        }
                    }
                }

                SMBBIOSAddress++;
            }

            return(HasSMBIOS);
        }
示例#3
0
文件: SMBIOS.cs 项目: zer09/Cosmos
        public bool GetSMBIOS_Data()
        {
            if (HasSMBIOS == false && CheckSMBIOS() == false)
            {
                return(false);
            }

            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace(SMBBIOSAddress, 32);

            SMBIOS_Data = new SMBIOS_Data();

            //4 Byte array
            SMBIOS_Data.AnchorString[0] = Memory.Read8Unchecked(0);
            SMBIOS_Data.AnchorString[1] = Memory.Read8Unchecked(1);
            SMBIOS_Data.AnchorString[2] = Memory.Read8Unchecked(2);
            SMBIOS_Data.AnchorString[3] = Memory.Read8Unchecked(3);

            SMBIOS_Data.EntryPointStructureChecksum = Memory.Read8Unchecked(4);
            SMBIOS_Data.EntryPointLength            = Memory.Read8Unchecked(5);
            SMBIOS_Data.SMBIOSMajorVersion          = Memory.Read8Unchecked(6);
            SMBIOS_Data.SMBIOSMinorVersion          = Memory.Read8Unchecked(7);
            SMBIOS_Data.MaximumStructureSize        = Memory.Read16Unchecked(8);

            SMBIOS_Data.EntryPointRevision = Memory.Read8Unchecked(10);

            //5 Byte array
            SMBIOS_Data.FormattedArea[0] = Memory.Read8Unchecked(11);
            SMBIOS_Data.FormattedArea[1] = Memory.Read8Unchecked(12);
            SMBIOS_Data.FormattedArea[2] = Memory.Read8Unchecked(13);
            SMBIOS_Data.FormattedArea[3] = Memory.Read8Unchecked(14);
            SMBIOS_Data.FormattedArea[4] = Memory.Read8Unchecked(15);

            //5 Byte array
            SMBIOS_Data.IntermediateAnchorString[0] = Memory.Read8Unchecked(16);
            SMBIOS_Data.IntermediateAnchorString[1] = Memory.Read8Unchecked(17);
            SMBIOS_Data.IntermediateAnchorString[2] = Memory.Read8Unchecked(18);
            SMBIOS_Data.IntermediateAnchorString[3] = Memory.Read8Unchecked(19);
            SMBIOS_Data.IntermediateAnchorString[4] = Memory.Read8Unchecked(20);

            SMBIOS_Data.IntermediateChecksum     = Memory.Read8Unchecked(21);
            SMBIOS_Data.StructureTableLength     = Memory.Read16Unchecked(22);
            SMBIOS_Data.StructureTableAddress    = Memory.Read32Unchecked(24);
            SMBIOS_Data.NumberOfSMBIOSStructures = Memory.Read16Unchecked(28);
            SMBIOS_Data.SMBIOSBCDRevision        = Memory.Read8Unchecked(30);

            return(true);
        }
示例#4
0
        public bool GetSMBIOS_Data()
        {
            if( HasSMBIOS == false && CheckSMBIOS() == false )
                return false;

            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace( SMBBIOSAddress, 32 );
            
            SMBIOS_Data = new SMBIOS_Data();
            
            //4 Byte array
            SMBIOS_Data.AnchorString[ 0 ] = Memory.Read8Unchecked( 0 );
            SMBIOS_Data.AnchorString[ 1 ] = Memory.Read8Unchecked( 1 );
            SMBIOS_Data.AnchorString[ 2 ] = Memory.Read8Unchecked( 2 );
            SMBIOS_Data.AnchorString[ 3 ] = Memory.Read8Unchecked( 3 );

            SMBIOS_Data.EntryPointStructureChecksum = Memory.Read8Unchecked( 4 );
            SMBIOS_Data.EntryPointLength = Memory.Read8Unchecked( 5 );
            SMBIOS_Data.SMBIOSMajorVersion = Memory.Read8Unchecked( 6 );
            SMBIOS_Data.SMBIOSMinorVersion = Memory.Read8Unchecked( 7 );
            SMBIOS_Data.MaximumStructureSize = Memory.Read16Unchecked( 8 );

            SMBIOS_Data.EntryPointRevision = Memory.Read8Unchecked( 10 );

            //5 Byte array
            SMBIOS_Data.FormattedArea[ 0 ] = Memory.Read8Unchecked( 11 );
            SMBIOS_Data.FormattedArea[ 1 ] = Memory.Read8Unchecked( 12 );
            SMBIOS_Data.FormattedArea[ 2 ] = Memory.Read8Unchecked( 13 );
            SMBIOS_Data.FormattedArea[ 3 ] = Memory.Read8Unchecked( 14 );
            SMBIOS_Data.FormattedArea[ 4 ] = Memory.Read8Unchecked( 15 );

            //5 Byte array
            SMBIOS_Data.IntermediateAnchorString[ 0 ] = Memory.Read8Unchecked( 16 );
            SMBIOS_Data.IntermediateAnchorString[ 1 ] = Memory.Read8Unchecked( 17 );
            SMBIOS_Data.IntermediateAnchorString[ 2 ] = Memory.Read8Unchecked( 18 );
            SMBIOS_Data.IntermediateAnchorString[ 3 ] = Memory.Read8Unchecked( 19 );
            SMBIOS_Data.IntermediateAnchorString[ 4 ] = Memory.Read8Unchecked( 20 );

            SMBIOS_Data.IntermediateChecksum = Memory.Read8Unchecked( 21 );
            SMBIOS_Data.StructureTableLength = Memory.Read16Unchecked( 22 );
            SMBIOS_Data.StructureTableAddress = Memory.Read32Unchecked( 24 );
            SMBIOS_Data.NumberOfSMBIOSStructures = Memory.Read16Unchecked( 28 );
            SMBIOS_Data.SMBIOSBCDRevision = Memory.Read8Unchecked( 30 );

            return true;
        }