60 r->big_endian = big_endian;
61 r->mem_key_size = mem_key_size;
136 if (!
a->cur->get_reg_profile) {
147 char *profile =
a->cur->get_reg_profile(
a);
243 if (!cur || !analysis->read_at) {
292 if (analysis->
il_vm) {
297 return !!analysis->
il_vm;
RZ_API void rz_analysis_il_vm_cleanup(RzAnalysis *analysis)
RZ_API void rz_analysis_il_vm_sync_from_reg(RzAnalysisILVM *vm, RZ_NONNULL RzReg *reg)
static void setup_vm_init_state(RzAnalysisILVM *vm, RZ_NULLABLE RzAnalysisILInitState *is, RZ_NULLABLE RzReg *reg)
RZ_API void rz_analysis_il_config_add_label(RZ_NONNULL RzAnalysisILConfig *cfg, RZ_NONNULL RZ_OWN RzILEffectLabel *label)
RZ_API void rz_analysis_il_init_state_free(RzAnalysisILInitState *state)
RZ_API RZ_OWN RzAnalysisILConfig * rz_analysis_il_config_new(ut32 pc_size, bool big_endian, ut32 mem_key_size)
static bool setup_regs(RzAnalysis *a, RzAnalysisILVM *vm, RzAnalysisILConfig *cfg)
RZ_API bool rz_analysis_il_vm_sync_to_reg(RzAnalysisILVM *vm, RZ_NONNULL RzReg *reg)
RZ_API void rz_analysis_il_config_free(RzAnalysisILConfig *cfg)
RZ_API RZ_OWN RzAnalysisILVM * rz_analysis_il_vm_new(RzAnalysis *a, RZ_NULLABLE RzReg *init_state_reg)
static void var_state_free(void *e, void *user)
RZ_API bool rz_analysis_il_vm_setup(RzAnalysis *analysis)
RZ_API RzAnalysisILInitState * rz_analysis_il_init_state_new()
RZ_API RzAnalysisILStepResult rz_analysis_il_vm_step(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisILVM *vm, RZ_NULLABLE RzReg *reg)
RZ_API void rz_analysis_il_vm_free(RZ_NULLABLE RzAnalysisILVM *vm)
RZ_API void rz_analysis_il_init_state_set_var(RZ_NONNULL RzAnalysisILInitState *state, RZ_NONNULL const char *name, RZ_NONNULL RZ_OWN RzILVal *val)
static void setup_vm_from_config(RzAnalysis *analysis, RzAnalysisILVM *vm, RzAnalysisILConfig *cfg)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RzILMem * rz_il_mem_new(RzBuffer *buf, ut32 key_len)
RZ_API RZ_OWN RzILVal * rz_il_value_dup(RZ_NONNULL const RzILVal *val)
RZ_API void rz_il_value_free(RZ_NULLABLE RzILVal *val)
RZ_API void rz_il_vm_sync_from_reg(RZ_NONNULL RzILVM *vm, RZ_NONNULL RzILRegBinding *rb, RZ_NONNULL RzReg *reg)
RZ_API void rz_il_vm_setup_reg_binding(RZ_NONNULL RzILVM *vm, RZ_NONNULL RZ_BORROW RzILRegBinding *rb)
RZ_API bool rz_il_vm_sync_to_reg(RZ_NONNULL RzILVM *vm, RZ_NONNULL RzILRegBinding *rb, RZ_NONNULL RzReg *reg)
RZ_API RzILRegBinding * rz_il_reg_binding_exactly(RZ_NONNULL RzReg *reg, size_t regs_count, RZ_NONNULL RZ_BORROW const char **regs)
RZ_API void rz_il_reg_binding_free(RzILRegBinding *rb)
RZ_API RzILRegBinding * rz_il_reg_binding_derive(RZ_NONNULL RzReg *reg)
Calculate a new binding of IL variables against the profile of the given RzReg.
RZ_API void rz_il_vm_set_global_var(RZ_NONNULL RzILVM *vm, RZ_NONNULL const char *name, RZ_OWN RzILVal *val)
RZ_API void rz_il_vm_add_mem(RzILVM *vm, RzILMemIndex index, RZ_OWN RzILMem *mem)
RZ_API RzILVM * rz_il_vm_new(ut64 start_addr, ut32 addr_size, bool big_endian)
RZ_API void rz_il_vm_free(RzILVM *vm)
RZ_API void rz_il_vm_add_label(RZ_NONNULL RzILVM *vm, RZ_NONNULL RzILEffectLabel *label)
RZ_API bool rz_il_vm_step(RzILVM *vm, RzILOpEffect *op, ut64 fallthrough_addr)
RZ_API RzILEffectLabel * rz_il_effect_label_dup(RZ_NONNULL RzILEffectLabel *lbl)
RZ_API void rz_il_effect_label_free(RzILEffectLabel *lbl)
RZ_API bool rz_analysis_op_fini(RzAnalysisOp *op)
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
RZ_API bool rz_reg_set_profile_string(RZ_NONNULL RzReg *reg, RZ_NONNULL const char *profile_str)
Parses a register profile string and sets up all registers accordingly in reg.
RZ_API void rz_reg_free(RzReg *reg)
RZ_API RzReg * rz_reg_new(void)
@ RZ_ANALYSIS_IL_STEP_IL_RUNTIME_ERROR
@ RZ_ANALYSIS_IL_STEP_INVALID_OP
@ RZ_ANALYSIS_IL_STEP_RESULT_SUCCESS
@ RZ_ANALYSIS_IL_STEP_RESULT_NOT_SET_UP
@ RZ_ANALYSIS_OP_MASK_HINT
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
RZ_API ut64 rz_bv_to_ut64(RZ_NONNULL const RzBitVector *x)
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_io(RZ_NONNULL void *iob)
Creates a new buffer wrapping the memory map exposed by RzIOBind.
RZ_API void rz_pvector_init(RzPVector *vec, RzPVectorFree free)
RZ_API void rz_pvector_fini(RzPVector *vec)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
void(* RzPVectorFree)(void *e)
#define rz_vector_foreach(vec, it)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void rz_vector_fini(RzVector *vec)
RZ_API void rz_vector_init(RzVector *vec, size_t elem_size, RzVectorFree free, void *free_user)
#define rz_pvector_foreach(vec, it)
Description of the global context of an RzAnalysisILVM.
ut32 pc_size
size of the program counter in bits
RzPVector labels
global labels, primarily for syscall/hook callbacks
ut32 mem_key_size
address size for memory 0, bound against IO
RZ_NULLABLE const char ** reg_bindings
Description of an initial state of an RzAnalysisILVM.
Description of the contents of a single IL variable.
High-level RzIL vm to emulate disassembled code.
RZ_NONNULL RzILRegBinding * reg_binding
specifies which (global) variables are bound to registers
RZ_NONNULL RzILVM * vm
low-level vm to execute IL code
RZ_NONNULL RzBuffer * io_buf
buffer to use for memory 0 (io)
RzAnalysisILConfigCB il_config
return an IL config to execute lifted code of the given analysis' arch/cpu/bits
struct rz_analysis_plugin_t * cur
RzAnalysisILVM * il_vm
user-faced VM, NEVER use this for any analysis passes!
ut64(WINAPI *w32_GetEnabledXStateFeatures)()