pyecsca.sca.target.binary module

Provides a binary target class which represents a target that is a runnable binary on the host.

class BinaryTarget(binary, debug_output=False, **kwargs)[source]

Bases: SerialTarget

Binary target that is runnable on the host and communicates using the stdin/stdout streams.

process: Optional[Popen] = None[source]
binary: List[str][source]
debug_output: bool[source]
connect()[source]

Connect to the target device.

write(data)[source]

Write the data bytes to the target’s serial input.

Parameters:

data (bytes) – The data to write.

Return type:

None

read(num=0, timeout=0)[source]

Read upto num bytes or until timeout milliseconds from the target’s serial output.

Parameters:
  • num (int) – The number of bytes to read, 0 for all available.

  • timeout (int) – The timeout in milliseconds.

Return type:

bytes

Returns:

The bytes read.

disconnect()[source]

Disconnect from the target device.