Module coroner.bstr

Functions for byte string manipulation.

These functions were adapted from nmap's nselib. See http://nmap.org/.

Functions

u8 (b, i) Get an 8-bit integer at a 0-based byte offset in a byte string.
u16 (b, i) Get a 16-bit integer at a 0-based byte offset in a byte string.
u32 (b, i) Get a 32-bit integer at a 0-based byte offset in a byte string.
set_u8 (b, i, num) Set an 8-bit integer at a 0-based byte offset in a byte string (big-endian).
set_u16 (b, i, num) Set a 16-bit integer at a 0-based byte offset in a byte string (big-endian).
set_u32 (b, i, num) Set a 32-bit integer at a 0-based byte offset in a byte string (big-endian).
numtostr8 (num) Get a 1-byte string from a number.
numtostr16 (num) Get a 2-byte string from a number.
numtostr32 (num) Get a 4-byte string from a number.


Functions

u8 (b, i)
Get an 8-bit integer at a 0-based byte offset in a byte string.

Parameters:

  • b string a byte string
  • i integer offset

Returns:

    An 8-bit integer.
u16 (b, i)
Get a 16-bit integer at a 0-based byte offset in a byte string.

Parameters:

  • b string a byte string
  • i integer offset

Returns:

    A 16-bit integer.
u32 (b, i)
Get a 32-bit integer at a 0-based byte offset in a byte string.

Parameters:

  • b string a byte string
  • i integer offset

Returns:

    A 32-bit integer.
set_u8 (b, i, num)
Set an 8-bit integer at a 0-based byte offset in a byte string (big-endian).

Parameters:

  • b string a byte string.
  • i integer offset.
  • num integer integer to store.
set_u16 (b, i, num)
Set a 16-bit integer at a 0-based byte offset in a byte string (big-endian).

Parameters:

  • b A byte string.
  • i Offset.
  • num Integer to store.
set_u32 (b, i, num)
Set a 32-bit integer at a 0-based byte offset in a byte string (big-endian).

Parameters:

  • b A byte string.
  • i Offset.
  • num Integer to store.
numtostr8 (num)
Get a 1-byte string from a number.

Parameters:

  • num integer a number.
numtostr16 (num)
Get a 2-byte string from a number. (big-endian)

Parameters:

  • num integer a number.
numtostr32 (num)
Get a 4-byte string from a number. (big-endian)

Parameters:

  • num integer a number.
generated by LDoc 1.4.3 Last updated 2016-08-15 00:59:34