python_pae.number module

This module defines the unsigned number types for our PAE encoding scheme.

class python_pae.number.PAENumberType(value)

Bases: python_pae.abstract.PAEType[int]

Encodes various unsigned integer types. All are encoded in little-endian order.

property constant_length
unpack(packed: bytes)
pack(value: int)
write(value: int, stream: IO) int

Serialise and write a value to a stream, length prefix not included.

Parameters
  • value – The value to write.

  • stream – The stream to write to.

Returns

The number of bytes written.

read(stream: IO, length: int) int

Read a value from a stream, length prefix not included, and decode it.

Parameters
  • stream – The stream to write to.

  • length – The expected length of the content to be read.

Returns

The decoded value.

python_pae.number.PAE_UCHAR = <uint8 (UCHAR)>

Unsigned char, encodes to a single byte.

python_pae.number.PAE_USHORT = <uint16 (USHORT)>

Unsigned short, encodes to two bytes.

python_pae.number.PAE_UINT = <uint32 (UINT)>

Unsigned int, encodes to four bytes.

python_pae.number.PAE_ULLONG = <uint64 (ULLONG)>

Unsigned (long) long, encodes to eight bytes.