microprobe.utils.bin

microprobe.utils.bin definition module

This module implements the required features to interpret instructions in binary codification and translate them into Microprobe internal represenation of instruction, operands, labels and addreses.

The main elements of this module are the following:

  • MicroprobeBinInstructionStream objects to represent a binary stream of codified instructions

  • interpret_bin() function validates the binary codification and translates them into internal Microprobe represenation of instructions and operands.

Functions

interpret_bin(code, target[, fmt, safe, ...])

Return the list of MicroprobeInstructionDefinition objects that results from interpreting the code (a binary stream).

Classes

MicroprobeBinInstructionStream(code, target)

Classes diagram

Inheritance diagram of MicroprobeBinInstructionStream



Functions

interpret_bin(code, target, fmt='hex', safe=None, single=False, little_endian=None, word_length=None)[source]

Return the list of MicroprobeInstructionDefinition objects that results from interpreting the code (a binary stream). The target object is used to validate the existence of the instruction and operands in the target.

Parameters:
  • code (str object) – String to interpret

  • target (Target object) – Target definition

Returns:

A list of instructions, operands, labels, etc. resulting from interpreting the assembly

Return type:

list of MicroprobeInstructionDefinition

Raises:

microprobe.exceptions.MicroprobeBinaryError – if something is wrong during the interpretation