Unicorn rust bindings improvements

This commit is contained in:
Dominik Maier
2021-11-08 19:34:53 +01:00
parent 06f454d513
commit f8f0d4471f
16 changed files with 417 additions and 388 deletions

21
uc.c
View File

@@ -686,6 +686,27 @@ static void clear_deleted_hooks(uc_engine *uc)
list_clear(&uc->hooks_to_del);
}
// set a data ptr (for use in bindings)
UNICORN_EXPORT
uc_err uc_emu_set_data_ptr(uc_engine *uc, void *data)
{
if (uc == NULL) {
return UC_ERR_ARG;
}
uc->data_ptr = data;
}
// get a data ptr (for use in bindings)
UNICORN_EXPORT
void *uc_emu_get_data_ptr(uc_engine *uc, void *data)
{
if (uc == NULL) {
return NULL;
}
return uc->data_ptr;
}
UNICORN_EXPORT
uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
uint64_t timeout, size_t count)