Documentation
¶
Index ¶
- type NtSecurityDescriptorHeader
- func (ntsd *NtSecurityDescriptorHeader) Describe(indent int)
- func (ntsdh *NtSecurityDescriptorHeader) Equal(other *NtSecurityDescriptorHeader) bool
- func (ntsd *NtSecurityDescriptorHeader) GetRevision() uint8
- func (ntsd *NtSecurityDescriptorHeader) GetSbz1() uint8
- func (ntsdh *NtSecurityDescriptorHeader) Marshal() ([]byte, error)
- func (ntsd *NtSecurityDescriptorHeader) SetRevision(revision uint8)
- func (ntsd *NtSecurityDescriptorHeader) SetSbz1(sbz1 uint8)
- func (ntsd *NtSecurityDescriptorHeader) Unmarshal(marshalledData []byte) (int, error)
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 ¶
func (ntsdh *NtSecurityDescriptorHeader) Equal(other *NtSecurityDescriptorHeader) bool
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.