miasm
Reverse engineering framework
miasm.core.utils Namespace Reference

Classes

class  BoundedDict
 
class  Disasm_Exception
 
class  keydefaultdict
 

Functions

def get_caller_name (caller_num=0)
 
def whoami ()
 
def printable (string)
 
def force_bytes (value)
 
def force_str (value)
 
def iterbytes (string)
 
def int_to_byte (value)
 
def cmp_elts (elt1, elt2)
 
def decode_hex (value)
 
def encode_hex (value)
 
def size2mask (size)
 
def hexdump (src, length=16)
 

Variables

 upck8 = lambda x: struct.unpack('B', x)[0]
 
 upck16 = lambda x: struct.unpack('H', x)[0]
 
 upck32 = lambda x: struct.unpack('I', x)[0]
 
 upck64 = lambda x: struct.unpack('Q', x)[0]
 
 pck8 = lambda x: struct.pack('B', x)
 
 pck16 = lambda x: struct.pack('H', x)
 
 pck32 = lambda x: struct.pack('I', x)
 
 pck64 = lambda x: struct.pack('Q', x)
 
 upck8le = lambda x: struct.unpack('<B', x)[0]
 
 upck16le = lambda x: struct.unpack('<H', x)[0]
 
 upck32le = lambda x: struct.unpack('<I', x)[0]
 
 upck64le = lambda x: struct.unpack('<Q', x)[0]
 
 pck8le = lambda x: struct.pack('<B', x)
 
 pck16le = lambda x: struct.pack('<H', x)
 
 pck32le = lambda x: struct.pack('<I', x)
 
 pck64le = lambda x: struct.pack('<Q', x)
 
 upck8be = lambda x: struct.unpack('>B', x)[0]
 
 upck16be = lambda x: struct.unpack('>H', x)[0]
 
 upck32be = lambda x: struct.unpack('>I', x)[0]
 
 upck64be = lambda x: struct.unpack('>Q', x)[0]
 
 pck8be = lambda x: struct.pack('>B', x)
 
 pck16be = lambda x: struct.pack('>H', x)
 
 pck32be = lambda x: struct.pack('>I', x)
 
 pck64be = lambda x: struct.pack('>Q', x)
 
int LITTLE_ENDIAN = 1
 
int BIG_ENDIAN = 2
 
dictionary pck
 

Function Documentation

◆ cmp_elts()

def miasm.core.utils.cmp_elts (   elt1,
  elt2 
)
Here is the caller graph for this function:

◆ decode_hex()

def miasm.core.utils.decode_hex (   value)
Here is the caller graph for this function:

◆ encode_hex()

def miasm.core.utils.encode_hex (   value)
Here is the caller graph for this function:

◆ force_bytes()

def miasm.core.utils.force_bytes (   value)
Here is the caller graph for this function:

◆ force_str()

def miasm.core.utils.force_str (   value)
Here is the caller graph for this function:

◆ get_caller_name()

def miasm.core.utils.get_caller_name (   caller_num = 0)
Get the nth caller's name
@caller_num: 0 = the caller of get_caller_name, 1 = next parent, ...
Here is the caller graph for this function:

◆ hexdump()

def miasm.core.utils.hexdump (   src,
  length = 16 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ int_to_byte()

def miasm.core.utils.int_to_byte (   value)
Here is the caller graph for this function:

◆ iterbytes()

def miasm.core.utils.iterbytes (   string)
Here is the caller graph for this function:

◆ printable()

def miasm.core.utils.printable (   string)
Here is the caller graph for this function:

◆ size2mask()

def miasm.core.utils.size2mask (   size)
Return the bit mask of size @size
Here is the caller graph for this function:

◆ whoami()

def miasm.core.utils.whoami ( )
Returns the caller's name
Here is the call graph for this function:

Variable Documentation

◆ BIG_ENDIAN

int miasm.core.utils.BIG_ENDIAN = 2

◆ LITTLE_ENDIAN

int miasm.core.utils.LITTLE_ENDIAN = 1

◆ pck

dictionary miasm.core.utils.pck
Initial value:
1 = {8: pck8,
2  16: pck16,
3  32: pck32,
4  64: pck64}

◆ pck16

miasm.core.utils.pck16 = lambda x: struct.pack('H', x)

◆ pck16be

miasm.core.utils.pck16be = lambda x: struct.pack('>H', x)

◆ pck16le

miasm.core.utils.pck16le = lambda x: struct.pack('<H', x)

◆ pck32

miasm.core.utils.pck32 = lambda x: struct.pack('I', x)

◆ pck32be

miasm.core.utils.pck32be = lambda x: struct.pack('>I', x)

◆ pck32le

miasm.core.utils.pck32le = lambda x: struct.pack('<I', x)

◆ pck64

miasm.core.utils.pck64 = lambda x: struct.pack('Q', x)

◆ pck64be

miasm.core.utils.pck64be = lambda x: struct.pack('>Q', x)

◆ pck64le

miasm.core.utils.pck64le = lambda x: struct.pack('<Q', x)

◆ pck8

miasm.core.utils.pck8 = lambda x: struct.pack('B', x)

◆ pck8be

miasm.core.utils.pck8be = lambda x: struct.pack('>B', x)

◆ pck8le

miasm.core.utils.pck8le = lambda x: struct.pack('<B', x)

◆ upck16

miasm.core.utils.upck16 = lambda x: struct.unpack('H', x)[0]

◆ upck16be

miasm.core.utils.upck16be = lambda x: struct.unpack('>H', x)[0]

◆ upck16le

miasm.core.utils.upck16le = lambda x: struct.unpack('<H', x)[0]

◆ upck32

miasm.core.utils.upck32 = lambda x: struct.unpack('I', x)[0]

◆ upck32be

miasm.core.utils.upck32be = lambda x: struct.unpack('>I', x)[0]

◆ upck32le

miasm.core.utils.upck32le = lambda x: struct.unpack('<I', x)[0]

◆ upck64

miasm.core.utils.upck64 = lambda x: struct.unpack('Q', x)[0]

◆ upck64be

miasm.core.utils.upck64be = lambda x: struct.unpack('>Q', x)[0]

◆ upck64le

miasm.core.utils.upck64le = lambda x: struct.unpack('<Q', x)[0]

◆ upck8

miasm.core.utils.upck8 = lambda x: struct.unpack('B', x)[0]

◆ upck8be

miasm.core.utils.upck8be = lambda x: struct.unpack('>B', x)[0]

◆ upck8le

miasm.core.utils.upck8le = lambda x: struct.unpack('<B', x)[0]