header

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NtSecurityDescriptorHeader

type NtSecurityDescriptorHeader struct {
	Revision    uint8
	Sbz1        uint8
	Control     control.NtSecurityDescriptorControl
	OffsetOwner uint32
	OffsetGroup uint32
	OffsetSacl  uint32
	OffsetDacl  uint32

	// Internal
	RawBytes     []byte
	RawBytesSize uint32
}

NtSecurityDescriptorHeader represents the header of a NT Security Descriptor, which contains information about the security attributes of an object.

Attributes:

  • Revision (uint8): The revision level of the security descriptor.
  • Sbz1 (uint8): Reserved byte, must be zero.
  • Control (uint16): Control flags that define the security descriptor's behavior.
  • OffsetOwner (uint32): Offset (in bytes) to the owner SID in the security descriptor.
  • OffsetGroup (uint32): Offset (in bytes) to the group SID in the security descriptor.
  • OffsetSacl (uint32): Offset (in bytes) to the System Access Control List (SACL).
  • OffsetDacl (uint32): Offset (in bytes) to the Discretionary Access Control List (DACL).

Internal attributes:

  • RawBytes ([]byte): The raw byte data representing the security descriptor header.
  • RawBytesSize (uint32): The size of the raw byte data.

func (*NtSecurityDescriptorHeader) Describe

func (ntsd *NtSecurityDescriptorHeader) Describe(indent int)

Describe prints a detailed description of the NtSecurityDescriptorHeader struct, including its attributes formatted with indentation for clarity.

Parameters:

  • indent (int): The indentation level for formatting the output. Each level increases the indentation depth, allowing for a hierarchical display of the header's components.

func (*NtSecurityDescriptorHeader) Equal

Equal compares two NtSecurityDescriptorHeader instances for equality.

Parameters:

  • other (*NtSecurityDescriptorHeader): The NtSecurityDescriptorHeader to compare with.

Returns:

  • bool: True if the NtSecurityDescriptorHeaders are equal, false otherwise.

func (*NtSecurityDescriptorHeader) GetRevision

func (ntsd *NtSecurityDescriptorHeader) GetRevision() uint8

GetRevision returns the Revision field value.

func (*NtSecurityDescriptorHeader) GetSbz1

func (ntsd *NtSecurityDescriptorHeader) GetSbz1() uint8

GetSbz1 returns the Sbz1 field value.

func (*NtSecurityDescriptorHeader) Marshal

func (ntsdh *NtSecurityDescriptorHeader) Marshal() ([]byte, error)

Marshal serializes the NtSecurityDescriptorHeader struct into a byte slice.

Returns:

  • []byte: The serialized byte slice representing the security descriptor header.

func (*NtSecurityDescriptorHeader) SetRevision

func (ntsd *NtSecurityDescriptorHeader) SetRevision(revision uint8)

SetRevision sets the Revision field value.

func (*NtSecurityDescriptorHeader) SetSbz1

func (ntsd *NtSecurityDescriptorHeader) SetSbz1(sbz1 uint8)

SetSbz1 sets the Sbz1 field value.

func (*NtSecurityDescriptorHeader) Unmarshal

func (ntsd *NtSecurityDescriptorHeader) Unmarshal(marshalledData []byte) (int, error)

Unmarshal populates the NtSecurityDescriptorHeader struct by parsing the provided raw byte slice. It extracts the header information and validates the length of the raw bytes.

Parameters:

  • RawBytes ([]byte): The raw byte data containing the security descriptor header information.

Returns:

  • error: Returns an error if the raw bytes length is insufficient or if parsing fails.

Jump to

Keyboard shortcuts

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