polytracker.inputs

A module for modeling taint sources like input files

inputs classes

Input

class polytracker.inputs.Input(uid: int, path: str, size: int, track_start: int = 0, track_end: Optional[int] = None, content: Optional[bytes] = None)

Bases: object

A source of taint

__init__(uid: int, path: str, size: int, track_start: int = 0, track_end: Optional[int] = None, content: Optional[bytes] = None)

Initializes a taint source.

Parameters:
  • uid – A unique ID for the input (unique per trace).

  • path – The path to the input when the trace was run.

  • size – The number of bytes read from the input.

  • track_start – The byte offset of the source where tracing started.

  • track_end – The byte offset of the source where tracing ended. (Defaults to the end of the input.)

  • content – The original bytes of the input.

property content: bytes

The original bytes of the input, if available.

Raises:

ValueError – If the input did not have its content stored to the database (e.g., if the instrumented binary was run with POLYSAVEINPUT=0) and self.path does not exist.

InputProperties

class polytracker.inputs.InputProperties(unused_byte_offsets: List[int], out_of_order_byte_offsets: List[int], file_seeks: List[Tuple[int, int, int]])

Bases: object

__init__(unused_byte_offsets: List[int], out_of_order_byte_offsets: List[int], file_seeks: List[Tuple[int, int, int]])