ldsocache

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

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

ldso-cache

reading and writing of glibc /etc/ld.so.cache files

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LDSOCacheEntry

type LDSOCacheEntry struct {
	Flags uint32

	Name string

	OSVersion_Needed uint32
	HWCap_Needed     uint64
}

type LDSOCacheExtensionHeader

type LDSOCacheExtensionHeader struct {
	Magic uint32
	Count uint32
}

type LDSOCacheExtensionSection

type LDSOCacheExtensionSection struct {
	Header LDSOCacheExtensionSectionHeader
	Data   []byte
}

type LDSOCacheExtensionSectionHeader

type LDSOCacheExtensionSectionHeader struct {
	Tag    uint32
	Flags  uint32
	Offset uint32
	Size   uint32
}

type LDSOCacheFile

type LDSOCacheFile struct {
	Header     LDSORawCacheHeader
	Entries    []LDSOCacheEntry
	Extensions []LDSOCacheExtensionSection
}

func LoadCacheFile

func LoadCacheFile(path string) (*LDSOCacheFile, error)

LoadCacheFile attempts to load a cache file from disk. When successful, it returns an LDSOCacheFile pointer which contains all relevant information from the cache file.

func (*LDSOCacheFile) Write

func (cf *LDSOCacheFile) Write(path string) error

Write writes a cache file to disk.

type LDSORawCacheEntry

type LDSORawCacheEntry struct {
	Flags uint32

	// Offsets in string table.
	Key   uint32
	Value uint32

	OSVersion_Needed uint32
	HWCap_Needed     uint64
}

type LDSORawCacheHeader

type LDSORawCacheHeader struct {
	Magic   [17]byte
	Version [3]byte

	NumLibs      uint32
	StrTableSize uint32

	Flags   uint8
	Unused0 [3]byte

	ExtOffset uint32

	Unused1 [3]uint32
}

func (*LDSORawCacheHeader) Write

func (hdr *LDSORawCacheHeader) Write(w io.Writer) error

Write writes a header for a cache file to disk.

Jump to

Keyboard shortcuts

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