intelmc

package module
v0.0.0-...-e520199 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2020 License: GPL-3.0 Imports: 6 Imported by: 1

README

intelmc

library for parsing intel microcode headers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateChecksum

func CalculateChecksum(data []byte) uint32

func IntelPlatforms

func IntelPlatforms(cpuflags uint8) []uint8

Types

type Date

type Date struct {
	Year  uint16 // 0x08
	Day   uint8  // 0x0A
	Month uint8  // 0x0B
}

type ExtendedHeader

type ExtendedHeader struct {
	ExtendedSignatureCount uint32    // 0x00
	ExtendedChecksum       uint32    // 0x04
	Reserved               [3]uint32 // 0x08
}

type ExtendedHeaderField

type ExtendedHeaderField struct {
	ProcessorSignature uint32 // 0x00
	PlatformIDs        uint32 // 0x04
	Checksum           uint32 // 0x08 replace CPUID, Platform, Checksum at Main Header w/o Extended
}

type ExtraHeader

type ExtraHeader struct {
	ModuleType              uint16    // 0x00 0000 (always)
	ModuleSubType           uint16    // 0x02 0000 (always)
	ModuleSize              uint32    // 0x04 dwords
	Flags                   uint16    // 0x08 0 RSA Signed, 1-31 Reserved
	RSAKeySize              uint16    // 0x0A 1K multiple (2 * 1024 = 2048)
	UpdateRevision          uint32    // 0x0C Signed to signify PRD/PRE
	VCN                     uint32    // 0x10 Version Control Number
	MultiPurpose1           uint32    // 0x14 dwords from Extra, UpdateSize, Empty etc
	Day                     uint8     // 0x18
	Month                   uint8     // 0x19
	Year                    uint16    // 0x1A
	UpdateSize              uint32    // 0x1C dwords from Extra without encrypted padding
	ProcessorSignatureCount uint32    // 0x20 max is 8 (8 * 0x4 = 0x20)
	ProcessorSignature0     uint32    // 0x24
	ProcessorSignature1     uint32    // 0x28
	ProcessorSignature2     uint32    // 0x2C
	ProcessorSignature3     uint32    // 0x30
	ProcessorSignature4     uint32    // 0x34
	ProcessorSignature5     uint32    // 0x38
	ProcessorSignature6     uint32    // 0x3C
	ProcessorSignature7     uint32    // 0x40
	MultiPurpose2           uint32    // 0x44 dwords from Extra + encrypted padding, UpdateSize, Platform, Empty
	SVN                     uint32    // 0x48 Security Version Number
	Reserved                [20]uint8 // 0x4C Reserved (00000000)
	Unknown                 [32]uint8 // 0x60

}

func ParseMicrocodeExtraHeader

func ParseMicrocodeExtraHeader(mcBytes []byte) (*ExtraHeader, error)
type Header struct {
	HeaderVersion      uint32    // 0x00 00000001 (Pattern)
	UpdateRevision     uint32    // 0x04 Signed to signify PRD/PRE
	Year               uint16    // 0x08
	Day                uint8     // 0x0A
	Month              uint8     // 0x0B
	ProcessorSignature uint32    // 0x0C
	Checksum           uint32    // 0x10 OEM validation only
	LoaderRevision     uint32    // 0x14 00000001 (Pattern)
	PlatformIDs        uint8     // 0x18 Supported Platforms
	Reserved0          [3]uint8  // 0x19 00 * 3 (Pattern)
	DataSize           uint32    // 0x1C Extra + Patch
	TotalSize          uint32    // 0x20 Header + Extra + Patch + Extended
	Reserved1          [12]uint8 // 0x24 00 * 12 (Pattern)
}

Taken from MCE.py

func ParseMicrocodeHeader

func ParseMicrocodeHeader(mcBytes []byte) (*Header, error)

type Microcode

type Microcode struct {
	Header             Header
	Date               Date
	CalculatedChecksum uint32
	Platforms          []uint8
	HeaderExtra        *ExtraHeader
	Encryption         *RSAHeader
	HeaderExtended     *ExtendedHeader
	Raw                []byte
}

func ParseMicrocode

func ParseMicrocode(mcBytes []byte) (*Microcode, error)

type RSAHeader

type RSAHeader struct {
	RSAPublicKey []uint8
	RSAExponent  uint32
	RSASignature []uint8
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL