DEV IN PROGRESS

Module pychrysalide.arch.instructions

Documentation

This module contains implementations for most basic instructions.

Basic instructions include non executable instructions such as RawInstruction, used for managing raw bytes in a binary content.

Classes

Class RawInstruction

The RawInstruction object handles data which is not (yet?) disassembled as code in a binary.

Raw values pointed by this kind of instruction can be immediate values or strings.

Instances can be created using one of the following constructors:

    RawInstruction(addr, size, value=int)
    RawInstruction(addr, size, content=object, count=int, endian=int)

Where addr is always a location defined by a vmpa object and size is a MemoryDataSize constant defining the size of the read immediate value(s).

In the first case, value is used to build an immediate operand for the instruction.

In the second case, content is a BinContent instance, count states how many items belong to the array and endian is a SourceEndian constant defining the byte order used to read values.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.arch.ArchInstruction
           ╰── pychrysalide.arch.instructions.RawInstruction

Implements:

Attributes

padding

Report if the instruction is seen as padding.

string

Report if the instruction is seen as a string.

Constants

RawInstrFlag

Flags for some instruction properties.

They can be seen as an extension of ArchInstrFlag

16= 0x10
32= 0x20

Class UndefInstruction

UndefInstruction represents all kinds of instructions which are officially not part of a runnable instruction set.

Instances can be created using the following constructor:

    UndefInstruction(behavior)

Where behavior is a ExpectedBehavior constant describing the state of the CPU once the instruction is run.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.arch.ArchInstruction
           ╰── pychrysalide.arch.instructions.UndefInstruction

Implements:

Attributes

behavior

Consequence carried by the undefined instruction.

The result is provided as a ExpectedBehavior constant.

Constants

ExpectedBehavior

List of possible behaviors of undefined instructions.

0= 0
1= 1
2= 2
3= 3