miasm
Reverse engineering framework
vm_mngr_py.h
Go to the documentation of this file.
1 #ifndef VM_MNGR_PY_H
2 #define VM_MNGR_PY_H
3 
4 #ifdef _WIN32
5 #define SIGALRM 0
6 #endif
7 
8 typedef struct {
9  PyObject_HEAD
10  PyObject *vmmngr;
12 } VmMngr;
13 
14 #endif// VM_MNGR_PY_H
15 
16 bn_t PyLong_to_bn(PyObject* py_long);
17 PyObject* bn_to_PyLong(bn_t bn);
EXCEPT_UNK_EIP
#define EXCEPT_UNK_EIP
Definition: vm_mngr.h:181
get_memory_write
PyObject * get_memory_write(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:457
bn.h
test_types.p
p
Definition: test_types.py:465
bignum_rshift
bn_t bignum_rshift(bn_t a, int nbits)
Definition: bn.c:416
PyGetInt_uint16_t
#define PyGetInt_uint16_t(item, value)
Definition: compat_py23.h:193
vm_read_mem
int vm_read_mem(vm_mngr_t *vm_mngr, uint64_t addr, char **buffer_ptr, size_t size)
Definition: vm_mngr.c:514
get_memory_page_from_address
struct memory_page_node * get_memory_page_from_address(vm_mngr_t *vm_mngr, uint64_t ad, int raise_exception)
Definition: vm_mngr.c:139
vm_mngr.h
MOD_DEF
#define MOD_DEF(ob, name, doc, methods)
Definition: compat_py23.h:218
reset_code_bloc_pool
void reset_code_bloc_pool(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:776
PyGetInt_uint32_t
#define PyGetInt_uint32_t(item, value)
Definition: compat_py23.h:194
vm_set_exception
PyObject * vm_set_exception(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:538
dump_code_bloc_pool
void dump_code_bloc_pool(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:724
bn
Definition: bn.h:97
vm_get_u16
PyObject * vm_get_u16(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:295
vm_reset_code_bloc_pool
PyObject * vm_reset_code_bloc_pool(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:713
vm_get_u64
PyObject * vm_get_u64(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:350
vm_set_u64
PyObject * vm_set_u64(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:457
vm_reset_memory_access
PyObject * vm_reset_memory_access(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:592
code_bloc_node
Definition: vm_mngr.h:145
vm_remove_memory_breakpoint
PyObject * vm_remove_memory_breakpoint(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:519
add_memory_breakpoint
void add_memory_breakpoint(vm_mngr_t *vm_mngr, uint64_t ad, uint64_t size, unsigned int access)
Definition: vm_mngr.c:954
bignum_or
bn_t bignum_or(bn_t a, bn_t b)
Definition: bn.c:531
RET_MODULE
#define RET_MODULE
Definition: compat_py23.h:221
reset_memory_page_pool
void reset_memory_page_pool(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:761
modint.i
i
Definition: modint.py:70
bn_to_PyLong
PyObject * bn_to_PyLong(bn_t bn)
Definition: vm_mngr_py.c:1064
memory_page_node::size
size_t size
Definition: vm_mngr.h:93
reset_memory_access
void reset_memory_access(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:790
VmMngr::vm_mngr
vm_mngr_t vm_mngr
Definition: vm_mngr_py.h:11
set_endian32
uint32_t set_endian32(vm_mngr_t *vm_mngr, uint32_t val)
Definition: vm_mngr.c:90
vm_get_memory_write
PyObject * vm_get_memory_write(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:781
PyLong_to_bn
bn_t PyLong_to_bn(PyObject *py_long)
Definition: vm_mngr_py.c:1034
vm_add_code_bloc
PyObject * vm_add_code_bloc(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:722
vm_write_mem
int vm_write_mem(vm_mngr_t *vm_mngr, uint64_t addr, char *buffer, size_t size)
Definition: vm_mngr.c:594
get_memory_read
PyObject * get_memory_read(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:452
shellcode.ad_start
ad_start
Definition: shellcode.py:115
EXCEPT_CODE_AUTOMOD
#define EXCEPT_CODE_AUTOMOD
Definition: vm_mngr.h:169
vm_get_mem_access
PyObject * vm_get_mem_access(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:214
memory_page_node::ad_hp
void * ad_hp
Definition: vm_mngr.h:95
vm_mngr_t::exception_flags
uint64_t exception_flags
Definition: vm_mngr.h:121
full.ad
ad
Definition: full.py:147
PyGetStr
#define PyGetStr(dest, name)
Definition: compat_py23.h:181
memory_page_node
Definition: vm_mngr.h:91
check_invalid_code_blocs
void check_invalid_code_blocs(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:375
vm_set_u16
PyObject * vm_set_u16(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:403
dump_memory_breakpoint_pool
void dump_memory_breakpoint_pool(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:940
vm_reset_memory_breakpoint
PyObject * vm_reset_memory_breakpoint(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:584
check_memory_breakpoint
void check_memory_breakpoint(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:404
vm_get_memory_read
PyObject * vm_get_memory_read(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:773
vm_mngr_py.h
vm_is_mapped
PyObject * vm_is_mapped(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:756
miasm.arch.aarch64.sem.ret
def ret(arg1)
Definition: sem.py:1796
BREAK_SIGALARM
#define BREAK_SIGALARM
Definition: vm_mngr.h:83
vm_get_u32
PyObject * vm_get_u32(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:322
py_add_mem_read
PyObject * py_add_mem_read(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:599
vm_set_u32
PyObject * vm_set_u32(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:430
add_mem_read
void add_mem_read(vm_mngr_t *vm_mngr, uint64_t addr, uint64_t size)
Definition: vm_mngr.c:365
memory_page_pool
struct memory_page_list_head memory_page_pool
export_llvm.value
value
Definition: export_llvm.py:69
vm_reset_memory_page_pool
PyObject * vm_reset_memory_page_pool(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:705
compat_py23.h
init_code_bloc_pool
void init_code_bloc_pool(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:743
bignum_from_uint64
bn_t bignum_from_uint64(uint64_t i)
Definition: bn.c:82
code_bloc_pool
struct code_bloc_list_head code_bloc_pool
is_mapped
int is_mapped(vm_mngr_t *vm_mngr, uint64_t addr, size_t size)
Definition: vm_mngr.c:632
VmMngr::vmmngr
PyObject_HEAD PyObject * vmmngr
Definition: vm_mngr_py.h:10
MOD_INIT
MOD_INIT(VmMngr)
Definition: vm_mngr_py.c:1015
miasm.arch.mips32.sem.j
def j(arg1)
Definition: sem.py:156
remove_memory_breakpoint
void remove_memory_breakpoint(vm_mngr_t *vm_mngr, uint64_t ad, unsigned int access)
Definition: vm_mngr.c:970
vm_init_code_bloc_pool
PyObject * vm_init_code_bloc_pool(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:568
full.type
type
Definition: full.py:35
export_llvm.name
name
Definition: export_llvm.py:70
VmMngr
Definition: vm_mngr_py.h:8
add_memory_page
void add_memory_page(vm_mngr_t *vm_mngr, struct memory_page_node *mpn_a)
Definition: vm_mngr.c:836
vm_remove_memory_page
PyObject * vm_remove_memory_page(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:132
vm_dump_code_bloc_pool
PyObject * vm_dump_code_bloc_pool(VmMngr *self)
Definition: vm_mngr_py.c:746
vm_dump
PyObject * vm_dump(PyObject *self)
Definition: vm_mngr_py.c:649
vm_mngr
Definition: vm_mngr.py:1
is_mpn_in_tab
int is_mpn_in_tab(vm_mngr_t *vm_mngr, struct memory_page_node *mpn_a)
Definition: vm_mngr.c:811
bignum_from_int
bn_t bignum_from_int(DTYPE_TMP i)
Definition: bn.c:54
reset_memory_breakpoint
void reset_memory_breakpoint(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:796
queue.h
PyGetInt_uint64_t
#define PyGetInt_uint64_t(item, value)
Definition: compat_py23.h:195
dse_crackme.stderr
stderr
Definition: dse_crackme.py:320
add_mem_write
void add_mem_write(vm_mngr_t *vm_mngr, uint64_t addr, uint64_t size)
Definition: vm_mngr.c:370
create_memory_page_node
struct memory_page_node * create_memory_page_node(uint64_t ad, size_t size, unsigned int access, const char *name)
Definition: vm_mngr.c:664
_vm_get_exception
PyObject * _vm_get_exception(unsigned int xcpt)
Definition: vm_mngr_py.c:42
set_endian16
uint16_t set_endian16(vm_mngr_t *vm_mngr, uint16_t val)
Definition: vm_mngr.c:82
shellcode.ad_stop
ad_stop
Definition: shellcode.py:116
vm_add_memory_breakpoint
PyObject * vm_add_memory_breakpoint(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:488
bignum_lshift
bn_t bignum_lshift(bn_t a, int nbits)
Definition: bn.c:387
EXCEPT_UNK_MEM_AD
#define EXCEPT_UNK_MEM_AD
Definition: vm_mngr.h:179
shellcode.args
args
Definition: shellcode.py:26
dump
char * dump(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:892
vm_get_mem
PyObject * vm_get_mem(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:234
vm_mngr_mod_name
char vm_mngr_mod_name[]
Definition: vm_mngr_py.c:1012
vm_mngr_mod_docs
char vm_mngr_mod_docs[]
Definition: vm_mngr_py.c:1011
PyGetInt_uint8_t
#define PyGetInt_uint8_t(item, value)
Definition: compat_py23.h:192
PyLong_to_bn
bn_t PyLong_to_bn(PyObject *py_long)
Definition: vm_mngr_py.c:1034
code_bloc_node::ad_code
uint64_t ad_code
Definition: vm_mngr.h:148
vm_set_u8
PyObject * vm_set_u8(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:378
vm_check_memory_breakpoint
PyObject * vm_check_memory_breakpoint(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:642
vm_init_memory_page_pool
PyObject * vm_init_memory_page_pool(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:561
vm_set_mem_access
PyObject * vm_set_mem_access(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:150
PyGetInt_size_t
#define PyGetInt_size_t(item, value)
Definition: compat_py23.h:190
bignum_to_uint64
uint64_t bignum_to_uint64(bn_t n)
Definition: bn.c:134
bignum_mask
bn_t bignum_mask(bn_t src, int bits)
Definition: bn.c:699
depgraph.result
string result
Definition: depgraph.py:99
init_memory_breakpoint
void init_memory_breakpoint(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:755
vm_get_all_memory
PyObject * vm_get_all_memory(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:668
py_add_mem_write
PyObject * py_add_mem_write(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:617
dis_binary.addr
addr
Definition: dis_binary.py:24
global_vmmngr
VmMngr * global_vmmngr
Definition: vm_mngr_py.c:40
vm_add_memory_page
PyObject * vm_add_memory_page(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:76
vm_set_mem
PyObject * vm_set_mem(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:176
init_memory_page_pool
void init_memory_page_pool(vm_mngr_t *vm_mngr)
Definition: vm_mngr.c:736
vm_mngr_t
Definition: vm_mngr.h:110
create_code_bloc_node
struct code_bloc_node * create_code_bloc_node(uint64_t ad_start, uint64_t ad_stop)
Definition: vm_mngr.c:698
code_bloc_node::ad_start
uint64_t ad_start
Definition: vm_mngr.h:146
remove_memory_page
void remove_memory_page(vm_mngr_t *vm_mngr, uint64_t ad)
Definition: vm_mngr.c:865
vm_get_u8
PyObject * vm_get_u8(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:268
simplification_tools.o
o
Definition: simplification_tools.py:24
code_bloc_node::ad_stop
uint64_t ad_stop
Definition: vm_mngr.h:147
set_endian64
uint64_t set_endian64(vm_mngr_t *vm_mngr, uint64_t val)
Definition: vm_mngr.c:98
set_alarm
PyObject * set_alarm(VmMngr *self)
Definition: vm_mngr_py.c:65
vm_get_exception
PyObject * vm_get_exception(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:553
vm_dump_memory_breakpoint
PyObject * vm_dump_memory_breakpoint(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:660
vm_check_invalid_code_blocs
PyObject * vm_check_invalid_code_blocs(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:635
bn_to_PyLong
PyObject * bn_to_PyLong(bn_t bn)
Definition: vm_mngr_py.c:1064
vm_init_memory_breakpoint
PyObject * vm_init_memory_breakpoint(VmMngr *self, PyObject *args)
Definition: vm_mngr_py.c:576
RAISE
#define RAISE(errtype, msg)
Definition: vm_mngr_py.c:35
memory_page_node::access
uint64_t access
Definition: vm_mngr.h:94
BN_BYTE_SIZE
#define BN_BYTE_SIZE
Definition: bn.h:43
add_code_bloc
void add_code_bloc(vm_mngr_t *vm_mngr, struct code_bloc_node *cbp)
Definition: vm_mngr.c:715
shellcode.size
size
Definition: shellcode.py:32
miasm.arch.aarch64.regs.exception_flags
exception_flags
Definition: regs.py:7
memory_page_node::ad
uint64_t ad
Definition: vm_mngr.h:92