Module pychrysalide.arch

Documentation

Python module for Chrysalide.arch

Sub modules

Interfaces

Classes

Interface ProxyFeeder

PyChrysalide proxy feeder

Hierarchy

gobject.GInterface
 ╰── pychrysalide.arch.ProxyFeeder

Interface TargetableOperand

PyChrysalide targetable operand

Hierarchy

gobject.GInterface
 ╰── pychrysalide.arch.TargetableOperand

Methods

get_addr(self, src, format, proc)

Get a target address from an operand.

Class ArchInstruction

PyChrysalide instruction for a given architecture.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchInstruction

Interfaces: pychrysalide.glibext.LineGenerator

Methods

attach_operand(self, op)

Add a new operand to the instruction.

detach_operand(self, target)

Remove an operand from the instruction.

replace_operand(self, old, new)

Replace an old instruction operand by a another one.

Attributes

destinations

Provide the instructions list following the current instruction.

keyword

Give le name of the assembly instruction.

operands

Provide the list of instruction attached operands.

range

Give access to the memory range covered by the current instruction.

sources

Provide the instructions list driving to the current instruction.

uid

Provide the unique identification number given to this kind of instruction.

Constants

ILT_EXEC_FLOW = ILT_EXEC_FLOW

ILT_JUMP = ILT_JUMP

ILT_CASE_JUMP = ILT_CASE_JUMP

ILT_JUMP_IF_TRUE = ILT_JUMP_IF_TRUE

ILT_JUMP_IF_FALSE = ILT_JUMP_IF_FALSE

ILT_LOOP = ILT_LOOP

ILT_CALL = ILT_CALL

ILT_CATCH_EXCEPTION = ILT_CATCH_EXCEPTION

ILT_REF = ILT_REF

ILT_COUNT = ILT_COUNT

Class ArchOperand

PyChrysalide instruction operand.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchOperand

Class ArchProcessor

PyChrysalide processor for a given architecture.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchProcessor

Methods

add_error(self, type, addr, desc)

Extend the list of detected disassembling errors.

disassemble(self, context, content, pos, format)

Disassemble a portion of binary content into one instruction.

find_instr_by_addr(self, addr)

Look for an instruction located at a given address.

get_context(self)

Provide a new disassembly context.

Attributes

endianness

Provide the processor endianness.

errors

List of all detected errors which occurred during the disassembling process.

ins_min_size

Provide the minimal size of one processor instruction.

instrs

Give access to the disassembled instructions run by the current processor.

mem_size

Provide the size of memory addresses for the given architecture.

virtual_space

Tell if the processor provides a virtual address space.

Constants

APE_DISASSEMBLY = APE_DISASSEMBLY

APE_LABEL = APE_LABEL

Class ArchRegister

PyChrysalide register for a given architecture.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchRegister

Attributes

is_base_pointer

Tell if the register is a base pointer or not.

Class ImmOperand

PyChrysalide immediate operand.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchOperand
           ╰── pychrysalide.arch.ImmOperand

Interfaces: pychrysalide.arch.TargetableOperand

Methods

to_string(self, syntax)

Convert the immediate operand to a string.

Attributes

default_display

Definition of the immediate operand default textual representation.

default_padding

Status of default padding with zeros in front of the textual representation.

display

Definition of the immediate operand current textual representation.

padding

Status of padding with zeros in front of the textual representation.

size

Size of the value contained in the operand.

value

Value of the immediate operand.

Constants

IOD_BIN = IOD_BIN

IOD_OCT = IOD_OCT

IOD_DEC = IOD_DEC

IOD_HEX = IOD_HEX

IOD_CHAR = IOD_CHAR

IOD_COUNT = IOD_COUNT

Class InstrIterator

Iterator for Chrysalide instructions loaded in a given processor.

Hierarchy

builtins.object
 ╰── pychrysalide.arch.InstrIterator

Methods

__iter__(self)

Implement iter(self).

__next__(self)

Implement next(self).

restrict(self, range)

Limit the instruction iterator to a memory range.

Class ProcContext

PyChrysalide disassembly context.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ProcContext

Class RawInstruction

PyChrysalide raw instruction for a all architectures.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchInstruction
           ╰── pychrysalide.arch.RawInstruction

Interfaces: pychrysalide.glibext.LineGenerator

Attributes

is_padding

Report if the instruction is seen as padding.

is_string

Report if the instruction is seen as a string.

Class UndefInstruction

PyChrysalide undefined instruction for a all architectures.

Hierarchy

builtins.object
 ╰── gi._gobject.GObject
      ╰── pychrysalide.arch.ArchInstruction
           ╰── pychrysalide.arch.UndefInstruction

Interfaces: pychrysalide.glibext.LineGenerator

Attributes

status

Consequence carried by the undefined instruction.

Constants

BPC_CODE = binportion-code

BPC_DATA = binportion-data

BPC_DATA_RO = binportion-data-ro

BPC_DISASS_ERROR = binportion-disassembly-error

BPC_RAW = binportion-raw

PAC_NONE = PAC_NONE

PAC_READ = PAC_READ

PAC_WRITE = PAC_WRITE

PAC_EXEC = PAC_EXEC

PAC_ALL = PAC_ALL

Class mrange

Python object for mrange_t.

Hierarchy

builtins.object
 ╰── pychrysalide.arch.mrange

Methods

__eq__(self, value)

Return self==value.

__ge__(self, value)

Return self>=value.

__gt__(self, value)

Return self>value.

__le__(self, value)

Return self<=value.

__lt__(self, value)

Return self

__ne__(self, value)

Return self!=value.

__str__(self)

Return str(self).

contains(self, other)

Tell if the current range contains another given range or address.

Attributes

addr

Give access to the start location of the memory range.

end

Provide the final external point of the memory range.

length

Give access to the length of the memory range.

Data

__hash__ = None

Class vmpa

Python object for vmpa_t.

Hierarchy

builtins.object
 ╰── pychrysalide.arch.vmpa

Methods

__add__(self, value)

Return self+value.

__eq__(self, value)

Return self==value.

__ge__(self, value)

Return self>=value.

__gt__(self, value)

Return self>value.

__le__(self, value)

Return self<=value.

__lt__(self, value)

Return self

__ne__(self, value)

Return self!=value.

__radd__(self, value)

Return value+self.

__str__(self)

Return str(self).

Attributes

phys

Give access to the physical offset of the location.

virt

Give access to the virtual address of the location.

Data

__hash__ = None

Constants

VMPA_NO_VIRTUAL = VMPA_NO_VIRTUAL

VMPA_NO_PHYSICAL = VMPA_NO_PHYSICAL