dissect.cstruct

Subpackages

Submodules

Re-Exports

BitBuffer

Implements a bit buffer that can read and write bit fields.

cstruct

Main class of cstruct. All types are registered in here.

ctypes(→ type[ctypes.Structure])

Create ctypes structures from cstruct structures.

ctypes_type(→ Any)

Error

Common base class for all non-exit exceptions.

NullPointerDereference

Common base class for all non-exit exceptions.

ParserError

Common base class for all non-exit exceptions.

ResolveError

Common base class for all non-exit exceptions.

Expression

Expression parser for calculations in definitions.

LEB128

Variable-length code compression to store an arbitrarily large integer in a small number of bytes.

Array

Built-in mutable sequence.

BaseType

Base class for cstruct type classes.

Char

Character type for reading and writing bytes.

CharArray

Character array type for reading and writing byte strings.

Enum

Enum type supercharged with cstruct functionality.

Field

Structure field.

Flag

Flag type supercharged with cstruct functionality.

Int

Integer type that can span an arbitrary amount of bytes.

MetaType

Base metaclass for cstruct type classes.

Packed

Packed type for Python struct (un)packing.

Pointer

Pointer to some other type.

Structure

Base class for cstruct structure type classes.

Union

Base class for cstruct union type classes.

Void

Void type.

Wchar

Wide-character type for reading and writing UTF-16 characters.

WcharArray

Wide-character array type for reading and writing UTF-16 strings.

dumpstruct(→ str | None)

Dump a structure or parsed structure instance.

hexdump(→ collections.abc.Iterator[str] | str | None)

Hexdump some data.

p8(→ bytes)

Pack an 8 bit integer.

p16(→ bytes)

Pack a 16 bit integer.

p32(→ bytes)

Pack a 32 bit integer.

p64(→ bytes)

Pack a 64 bit integer.

pack(→ bytes)

Pack an integer value to a given bit size, endianness.

swap(→ int)

Swap the endianness of an integer with a given bit size.

swap16(→ int)

Swap the endianness of a 16 bit integer.

swap32(→ int)

Swap the endianness of a 32 bit integer.

swap64(→ int)

Swap the endianness of a 64 bit integer.

u8(→ int)

Unpack an 8 bit integer.

u16(→ int)

Unpack a 16 bit integer.

u32(→ int)

Unpack a 32 bit integer.

u64(→ int)

Unpack a 64 bit integer.

unpack(→ int)

Unpack an integer value from a given bit size, endianness and sign.