miasm
Reverse engineering framework
op_semantics.h File Reference
#include <stdint.h>
Include dependency graph for op_semantics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _MIASM_EXPORT
 
#define _MIASM_IMPORT
 
#define CC_P   1
 
#define parity(a)   parity_table[(a) & 0xFF]
 
#define UDIV(sizeA)
 
#define UMOD(sizeA)
 
#define SDIV(sizeA)
 
#define SMOD(sizeA)
 
#define SHIFT_RIGHT_ARITH(size, value, shift)
 
#define SHIFT_RIGHT_LOGIC(size, value, shift)
 
#define SHIFT_LEFT_LOGIC(size, value, shift)
 

Functions

_MIASM_EXPORT uint16_t bcdadd_16 (uint16_t a, uint16_t b)
 
_MIASM_EXPORT uint16_t bcdadd_cf_16 (uint16_t a, uint16_t b)
 
_MIASM_EXPORT unsigned int my_imul08 (unsigned int a, unsigned int b)
 
_MIASM_EXPORT unsigned int mul_lo_op (unsigned int size, unsigned int a, unsigned int b)
 
_MIASM_EXPORT unsigned int mul_hi_op (unsigned int size, unsigned int a, unsigned int b)
 
_MIASM_EXPORT unsigned int imul_lo_op_08 (char a, char b)
 
_MIASM_EXPORT unsigned int imul_lo_op_16 (short a, short b)
 
_MIASM_EXPORT unsigned int imul_lo_op_32 (int a, int b)
 
_MIASM_EXPORT int imul_hi_op_08 (char a, char b)
 
_MIASM_EXPORT int imul_hi_op_16 (short a, short b)
 
_MIASM_EXPORT int imul_hi_op_32 (int a, int b)
 
_MIASM_EXPORT unsigned int umul16_lo (unsigned short a, unsigned short b)
 
_MIASM_EXPORT unsigned int umul16_hi (unsigned short a, unsigned short b)
 
_MIASM_EXPORT uint64_t rot_left (uint64_t size, uint64_t a, uint64_t b)
 
_MIASM_EXPORT uint64_t rot_right (uint64_t size, uint64_t a, uint64_t b)
 
_MIASM_EXPORT uint64_t cntleadzeros (uint64_t size, uint64_t src)
 
_MIASM_EXPORT unsigned int cnttrailzeros (uint64_t size, uint64_t src)
 
_MIASM_EXPORT uint64_t udiv64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT uint64_t umod64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT int64_t sdiv64 (int64_t a, int64_t b)
 
_MIASM_EXPORT int64_t smod64 (int64_t a, int64_t b)
 
_MIASM_EXPORT uint32_t udiv32 (uint32_t a, uint32_t b)
 
_MIASM_EXPORT uint32_t umod32 (uint32_t a, uint32_t b)
 
_MIASM_EXPORT int32_t sdiv32 (int32_t a, int32_t b)
 
_MIASM_EXPORT int32_t smod32 (int32_t a, int32_t b)
 
_MIASM_EXPORT uint16_t udiv16 (uint16_t a, uint16_t b)
 
_MIASM_EXPORT uint16_t umod16 (uint16_t a, uint16_t b)
 
_MIASM_EXPORT int16_t sdiv16 (int16_t a, int16_t b)
 
_MIASM_EXPORT int16_t smod16 (int16_t a, int16_t b)
 
_MIASM_EXPORT uint8_t udiv8 (uint8_t a, uint8_t b)
 
_MIASM_EXPORT uint8_t umod8 (uint8_t a, uint8_t b)
 
_MIASM_EXPORT int8_t sdiv8 (int8_t a, int8_t b)
 
_MIASM_EXPORT int8_t smod8 (int8_t a, int8_t b)
 
_MIASM_EXPORT unsigned int x86_cpuid (unsigned int a, unsigned int reg_num)
 
_MIASM_EXPORT uint32_t fpu_fadd32 (uint32_t a, uint32_t b)
 
_MIASM_EXPORT uint64_t fpu_fadd64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT uint32_t fpu_fsub32 (uint32_t a, uint32_t b)
 
_MIASM_EXPORT uint64_t fpu_fsub64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT uint32_t fpu_fmul32 (uint32_t a, uint32_t b)
 
_MIASM_EXPORT uint64_t fpu_fmul64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT uint32_t fpu_fdiv32 (uint32_t a, uint32_t b)
 
_MIASM_EXPORT uint64_t fpu_fdiv64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT double fpu_ftan (double a)
 
_MIASM_EXPORT double fpu_frndint (double a)
 
_MIASM_EXPORT double fpu_fsin (double a)
 
_MIASM_EXPORT double fpu_fcos (double a)
 
_MIASM_EXPORT double fpu_fscale (double a, double b)
 
_MIASM_EXPORT double fpu_f2xm1 (double a)
 
_MIASM_EXPORT uint32_t fpu_fsqrt32 (uint32_t a)
 
_MIASM_EXPORT uint64_t fpu_fsqrt64 (uint64_t a)
 
_MIASM_EXPORT uint64_t fpu_fabs64 (uint64_t a)
 
_MIASM_EXPORT uint64_t fpu_fprem64 (uint64_t a, uint64_t b)
 
_MIASM_EXPORT double fpu_fchs (double a)
 
_MIASM_EXPORT double fpu_fyl2x (double a, double b)
 
_MIASM_EXPORT double fpu_fpatan (double a, double b)
 
_MIASM_EXPORT unsigned int fpu_fcom_c0 (double a, double b)
 
_MIASM_EXPORT unsigned int fpu_fcom_c1 (double a, double b)
 
_MIASM_EXPORT unsigned int fpu_fcom_c2 (double a, double b)
 
_MIASM_EXPORT unsigned int fpu_fcom_c3 (double a, double b)
 
_MIASM_EXPORT uint64_t sint_to_fp_64 (int64_t a)
 
_MIASM_EXPORT uint32_t sint_to_fp_32 (int32_t a)
 
_MIASM_EXPORT int32_t fp32_to_sint32 (uint32_t a)
 
_MIASM_EXPORT int64_t fp64_to_sint64 (uint64_t a)
 
_MIASM_EXPORT int32_t fp64_to_sint32 (uint64_t a)
 
_MIASM_EXPORT uint32_t fp64_to_fp32 (uint64_t a)
 
_MIASM_EXPORT uint64_t fp32_to_fp64 (uint32_t a)
 
_MIASM_EXPORT uint32_t fpround_towardszero_fp32 (uint32_t a)
 
_MIASM_EXPORT uint64_t fpround_towardszero_fp64 (uint64_t a)
 

Variables

_MIASM_EXPORT const uint8_t parity_table [256]
 

Macro Definition Documentation

◆ _MIASM_EXPORT

#define _MIASM_EXPORT

◆ _MIASM_IMPORT

#define _MIASM_IMPORT

◆ CC_P

#define CC_P   1

◆ parity

#define parity (   a)    parity_table[(a) & 0xFF]

◆ SDIV

#define SDIV (   sizeA)
Value:
int ## sizeA ## _t sdiv ## sizeA (int ## sizeA ## _t a, int ## sizeA ## _t b) \
{ \
int ## sizeA ## _t r; \
if (b == 0) { \
fprintf(stderr, "Should not happen\n"); \
exit(EXIT_FAILURE); \
} \
r = a/b; \
return r; \
}

◆ SHIFT_LEFT_LOGIC

#define SHIFT_LEFT_LOGIC (   size,
  value,
  shift 
)
Value:
((uint ## size ## _t)((((uint64_t) (shift)) > ((size) - 1))? \
0 : \
(((uint ## size ## _t) (value)) << (shift))))

◆ SHIFT_RIGHT_ARITH

#define SHIFT_RIGHT_ARITH (   size,
  value,
  shift 
)
Value:
((uint ## size ## _t)((((uint64_t) (shift)) > ((size) - 1))? \
(((int ## size ## _t) (value)) < 0 ? -1 : 0) : \
(((int ## size ## _t) (value)) >> (shift))))

◆ SHIFT_RIGHT_LOGIC

#define SHIFT_RIGHT_LOGIC (   size,
  value,
  shift 
)
Value:
((uint ## size ## _t)((((uint64_t) (shift)) > ((size) - 1))? \
0 : \
(((uint ## size ## _t) (value)) >> (shift))))

◆ SMOD

#define SMOD (   sizeA)
Value:
int ## sizeA ## _t smod ## sizeA (int ## sizeA ## _t a, int ## sizeA ## _t b) \
{ \
int ## sizeA ## _t r; \
if (b == 0) { \
fprintf(stderr, "Should not happen\n"); \
exit(EXIT_FAILURE); \
} \
r = a%b; \
return r; \
}

◆ UDIV

#define UDIV (   sizeA)
Value:
uint ## sizeA ## _t udiv ## sizeA (uint ## sizeA ## _t a, uint ## sizeA ## _t b) \
{ \
uint ## sizeA ## _t r; \
if (b == 0) { \
fprintf(stderr, "Should not happen\n"); \
exit(EXIT_FAILURE); \
} \
r = a/b; \
return r; \
}

◆ UMOD

#define UMOD (   sizeA)
Value:
uint ## sizeA ## _t umod ## sizeA (uint ## sizeA ## _t a, uint ## sizeA ## _t b) \
{ \
uint ## sizeA ## _t r; \
if (b == 0) { \
fprintf(stderr, "Should not happen\n"); \
exit(EXIT_FAILURE); \
} \
r = a%b; \
return r; \
}

Function Documentation

◆ bcdadd_16()

_MIASM_EXPORT uint16_t bcdadd_16 ( uint16_t  a,
uint16_t  b 
)
Here is the call graph for this function:

◆ bcdadd_cf_16()

_MIASM_EXPORT uint16_t bcdadd_cf_16 ( uint16_t  a,
uint16_t  b 
)
Here is the call graph for this function:

◆ cntleadzeros()

_MIASM_EXPORT uint64_t cntleadzeros ( uint64_t  size,
uint64_t  src 
)

◆ cnttrailzeros()

_MIASM_EXPORT unsigned int cnttrailzeros ( uint64_t  size,
uint64_t  src 
)

◆ fp32_to_fp64()

_MIASM_EXPORT uint64_t fp32_to_fp64 ( uint32_t  a)

◆ fp32_to_sint32()

_MIASM_EXPORT int32_t fp32_to_sint32 ( uint32_t  a)

◆ fp64_to_fp32()

_MIASM_EXPORT uint32_t fp64_to_fp32 ( uint64_t  a)

◆ fp64_to_sint32()

_MIASM_EXPORT int32_t fp64_to_sint32 ( uint64_t  a)

◆ fp64_to_sint64()

_MIASM_EXPORT int64_t fp64_to_sint64 ( uint64_t  a)

◆ fpround_towardszero_fp32()

_MIASM_EXPORT uint32_t fpround_towardszero_fp32 ( uint32_t  a)

◆ fpround_towardszero_fp64()

_MIASM_EXPORT uint64_t fpround_towardszero_fp64 ( uint64_t  a)

◆ fpu_f2xm1()

_MIASM_EXPORT double fpu_f2xm1 ( double  a)
Here is the call graph for this function:

◆ fpu_fabs64()

_MIASM_EXPORT uint64_t fpu_fabs64 ( uint64_t  a)
Here is the call graph for this function:

◆ fpu_fadd32()

_MIASM_EXPORT uint32_t fpu_fadd32 ( uint32_t  a,
uint32_t  b 
)
Here is the call graph for this function:

◆ fpu_fadd64()

_MIASM_EXPORT uint64_t fpu_fadd64 ( uint64_t  a,
uint64_t  b 
)
Here is the call graph for this function:

◆ fpu_fchs()

_MIASM_EXPORT double fpu_fchs ( double  a)
Here is the call graph for this function:

◆ fpu_fcom_c0()

_MIASM_EXPORT unsigned int fpu_fcom_c0 ( double  a,
double  b 
)

◆ fpu_fcom_c1()

_MIASM_EXPORT unsigned int fpu_fcom_c1 ( double  a,
double  b 
)

◆ fpu_fcom_c2()

_MIASM_EXPORT unsigned int fpu_fcom_c2 ( double  a,
double  b 
)

◆ fpu_fcom_c3()

_MIASM_EXPORT unsigned int fpu_fcom_c3 ( double  a,
double  b 
)

◆ fpu_fcos()

_MIASM_EXPORT double fpu_fcos ( double  a)
Here is the call graph for this function:

◆ fpu_fdiv32()

_MIASM_EXPORT uint32_t fpu_fdiv32 ( uint32_t  a,
uint32_t  b 
)
Here is the call graph for this function:

◆ fpu_fdiv64()

_MIASM_EXPORT uint64_t fpu_fdiv64 ( uint64_t  a,
uint64_t  b 
)
Here is the call graph for this function:

◆ fpu_fmul32()

_MIASM_EXPORT uint32_t fpu_fmul32 ( uint32_t  a,
uint32_t  b 
)
Here is the call graph for this function:

◆ fpu_fmul64()

_MIASM_EXPORT uint64_t fpu_fmul64 ( uint64_t  a,
uint64_t  b 
)
Here is the call graph for this function:

◆ fpu_fpatan()

_MIASM_EXPORT double fpu_fpatan ( double  a,
double  b 
)
Here is the call graph for this function:

◆ fpu_fprem64()

_MIASM_EXPORT uint64_t fpu_fprem64 ( uint64_t  a,
uint64_t  b 
)
Here is the call graph for this function:

◆ fpu_frndint()

_MIASM_EXPORT double fpu_frndint ( double  a)
Here is the call graph for this function:

◆ fpu_fscale()

_MIASM_EXPORT double fpu_fscale ( double  a,
double  b 
)
Here is the call graph for this function:

◆ fpu_fsin()

_MIASM_EXPORT double fpu_fsin ( double  a)
Here is the call graph for this function:

◆ fpu_fsqrt32()

_MIASM_EXPORT uint32_t fpu_fsqrt32 ( uint32_t  a)
Here is the call graph for this function:

◆ fpu_fsqrt64()

_MIASM_EXPORT uint64_t fpu_fsqrt64 ( uint64_t  a)
Here is the call graph for this function:

◆ fpu_fsub32()

_MIASM_EXPORT uint32_t fpu_fsub32 ( uint32_t  a,
uint32_t  b 
)
Here is the call graph for this function:

◆ fpu_fsub64()

_MIASM_EXPORT uint64_t fpu_fsub64 ( uint64_t  a,
uint64_t  b 
)
Here is the call graph for this function:

◆ fpu_ftan()

_MIASM_EXPORT double fpu_ftan ( double  a)
Here is the call graph for this function:

◆ fpu_fyl2x()

_MIASM_EXPORT double fpu_fyl2x ( double  a,
double  b 
)
Here is the call graph for this function:

◆ imul_hi_op_08()

_MIASM_EXPORT int imul_hi_op_08 ( char  a,
char  b 
)

◆ imul_hi_op_16()

_MIASM_EXPORT int imul_hi_op_16 ( short  a,
short  b 
)

◆ imul_hi_op_32()

_MIASM_EXPORT int imul_hi_op_32 ( int  a,
int  b 
)

◆ imul_lo_op_08()

_MIASM_EXPORT unsigned int imul_lo_op_08 ( char  a,
char  b 
)

◆ imul_lo_op_16()

_MIASM_EXPORT unsigned int imul_lo_op_16 ( short  a,
short  b 
)

◆ imul_lo_op_32()

_MIASM_EXPORT unsigned int imul_lo_op_32 ( int  a,
int  b 
)

◆ mul_hi_op()

_MIASM_EXPORT unsigned int mul_hi_op ( unsigned int  size,
unsigned int  a,
unsigned int  b 
)

◆ mul_lo_op()

_MIASM_EXPORT unsigned int mul_lo_op ( unsigned int  size,
unsigned int  a,
unsigned int  b 
)

◆ my_imul08()

_MIASM_EXPORT unsigned int my_imul08 ( unsigned int  a,
unsigned int  b 
)

◆ rot_left()

_MIASM_EXPORT uint64_t rot_left ( uint64_t  size,
uint64_t  a,
uint64_t  b 
)

◆ rot_right()

_MIASM_EXPORT uint64_t rot_right ( uint64_t  size,
uint64_t  a,
uint64_t  b 
)

◆ sdiv16()

_MIASM_EXPORT int16_t sdiv16 ( int16_t  a,
int16_t  b 
)

◆ sdiv32()

_MIASM_EXPORT int32_t sdiv32 ( int32_t  a,
int32_t  b 
)

◆ sdiv64()

_MIASM_EXPORT int64_t sdiv64 ( int64_t  a,
int64_t  b 
)

◆ sdiv8()

_MIASM_EXPORT int8_t sdiv8 ( int8_t  a,
int8_t  b 
)

◆ sint_to_fp_32()

_MIASM_EXPORT uint32_t sint_to_fp_32 ( int32_t  a)

◆ sint_to_fp_64()

_MIASM_EXPORT uint64_t sint_to_fp_64 ( int64_t  a)

◆ smod16()

_MIASM_EXPORT int16_t smod16 ( int16_t  a,
int16_t  b 
)

◆ smod32()

_MIASM_EXPORT int32_t smod32 ( int32_t  a,
int32_t  b 
)

◆ smod64()

_MIASM_EXPORT int64_t smod64 ( int64_t  a,
int64_t  b 
)

◆ smod8()

_MIASM_EXPORT int8_t smod8 ( int8_t  a,
int8_t  b 
)

◆ udiv16()

_MIASM_EXPORT uint16_t udiv16 ( uint16_t  a,
uint16_t  b 
)

◆ udiv32()

_MIASM_EXPORT uint32_t udiv32 ( uint32_t  a,
uint32_t  b 
)

◆ udiv64()

_MIASM_EXPORT uint64_t udiv64 ( uint64_t  a,
uint64_t  b 
)

◆ udiv8()

_MIASM_EXPORT uint8_t udiv8 ( uint8_t  a,
uint8_t  b 
)

◆ umod16()

_MIASM_EXPORT uint16_t umod16 ( uint16_t  a,
uint16_t  b 
)

◆ umod32()

_MIASM_EXPORT uint32_t umod32 ( uint32_t  a,
uint32_t  b 
)

◆ umod64()

_MIASM_EXPORT uint64_t umod64 ( uint64_t  a,
uint64_t  b 
)

◆ umod8()

_MIASM_EXPORT uint8_t umod8 ( uint8_t  a,
uint8_t  b 
)

◆ umul16_hi()

_MIASM_EXPORT unsigned int umul16_hi ( unsigned short  a,
unsigned short  b 
)

◆ umul16_lo()

_MIASM_EXPORT unsigned int umul16_lo ( unsigned short  a,
unsigned short  b 
)

◆ x86_cpuid()

_MIASM_EXPORT unsigned int x86_cpuid ( unsigned int  a,
unsigned int  reg_num 
)

Variable Documentation

◆ parity_table

_MIASM_EXPORT const uint8_t parity_table[256]
extern
miasm.arch.aarch64.arch.shift
shift
Definition: arch.py:1649
export_llvm.value
value
Definition: export_llvm.py:69
miasm.arch.aarch64.sem.udiv
def udiv(arg1, arg2, arg3)
Definition: sem.py:1641
dse_crackme.stderr
stderr
Definition: dse_crackme.py:320
miasm.arch.aarch64.sem.sdiv
def sdiv(arg1, arg2, arg3)
Definition: sem.py:1649
data_flow.r
r
Definition: data_flow.py:18
basic_op.a
a
Definition: basic_op.py:9
shellcode.size
size
Definition: shellcode.py:32
basic_op.b
b
Definition: basic_op.py:10