update QEMU-Nyx to support latest and greatest version of libxdc
This commit is contained in:
parent
4a43c93486
commit
61fd863ba1
4
nyx/pt.c
4
nyx/pt.c
@ -30,7 +30,7 @@ along with QEMU-PT. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "sysemu/kvm_int.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "sysemu/cpus.h"
|
||||
#include "nyx/hypercall.h"
|
||||
#include "nyx/hypercall/hypercall.h"
|
||||
#include "nyx/memory_access.h"
|
||||
#include "nyx/interface.h"
|
||||
#include "nyx/debug.h"
|
||||
@ -307,7 +307,7 @@ void pt_init_decoder(CPUState *cpu){
|
||||
assert(GET_GLOBAL_STATE()->shared_bitmap_size != 0);
|
||||
GET_GLOBAL_STATE()->decoder = libxdc_init(filters, (void* (*)(void*, uint64_t, bool*))page_cache_fetch2, GET_GLOBAL_STATE()->page_cache, GET_GLOBAL_STATE()->shared_bitmap_ptr, GET_GLOBAL_STATE()->shared_bitmap_size);
|
||||
|
||||
libxdc_register_bb_callback(GET_GLOBAL_STATE()->decoder, (void (*)(void*, uint64_t, uint64_t))redqueen_callback, GET_GLOBAL_STATE()->redqueen_state);
|
||||
libxdc_register_bb_callback(GET_GLOBAL_STATE()->decoder, (void (*)(void*, disassembler_mode_t, uint64_t, uint64_t))redqueen_callback, GET_GLOBAL_STATE()->redqueen_state);
|
||||
}
|
||||
|
||||
int pt_disable_ip_filtering(CPUState *cpu, uint8_t addrn, bool hmp_mode){
|
||||
|
@ -233,7 +233,7 @@ static void redqueen_trace_enabled(redqueen_t* self){
|
||||
|
||||
//libxdc_enable_tracing(GET_GLOBAL_STATE()->decoder);
|
||||
libxdc_enable_tracing(GET_GLOBAL_STATE()->decoder);
|
||||
libxdc_register_edge_callback(GET_GLOBAL_STATE()->decoder, (void (*)(void*, uint64_t, uint64_t))&redqueen_trace_register_transition, self->trace_state);
|
||||
libxdc_register_edge_callback(GET_GLOBAL_STATE()->decoder, (void (*)(void*, disassembler_mode_t, uint64_t, uint64_t))&redqueen_trace_register_transition, self->trace_state);
|
||||
//redqueen_trace_register_transition(self->trace_state, INIT_TRACE_IP, ip);
|
||||
//last_ip = ip;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ void redqueen_trace_free(redqueen_trace_t* self){
|
||||
free(self);
|
||||
}
|
||||
|
||||
void redqueen_trace_register_transition(redqueen_trace_t* self, uint64_t from, uint64_t to){
|
||||
void redqueen_trace_register_transition(redqueen_trace_t* self, disassembler_mode_t mode, uint64_t from, uint64_t to){
|
||||
khiter_t k;
|
||||
int ret;
|
||||
uint128_t key = (((uint128_t)from)<<64) | ((uint128_t)to);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "khash.h"
|
||||
#include <libxdc.h>
|
||||
|
||||
typedef unsigned __int128 uint128_t;
|
||||
typedef uint128_t khint128_t;
|
||||
@ -38,5 +39,5 @@ typedef struct redqueen_trace_s{
|
||||
redqueen_trace_t* redqueen_trace_new(void);
|
||||
void redqueen_trace_reset(redqueen_trace_t* self);
|
||||
void redqueen_trace_free(redqueen_trace_t* self);
|
||||
void redqueen_trace_register_transition(redqueen_trace_t* self, uint64_t from, uint64_t to);
|
||||
void redqueen_trace_register_transition(redqueen_trace_t* self, disassembler_mode_t mode, uint64_t from, uint64_t to);
|
||||
void redqueen_trace_write_file(redqueen_trace_t* self, int fd);
|
||||
|
@ -33,12 +33,14 @@ along with QEMU-PT. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* global singleton */
|
||||
struct state_qemu_pt global_state;
|
||||
|
||||
#define LIBXDC_RELEASE_VERSION_REQUIRED 2
|
||||
|
||||
void state_init_global(void){
|
||||
#ifdef STATE_VERBOSE
|
||||
fprintf(stderr, "--> %s <--\n", __func__);
|
||||
#endif
|
||||
/* safety first */
|
||||
assert(libxdc_get_release_version() == LIBXDC_RELEASE_VERSION);
|
||||
assert(libxdc_get_release_version() == LIBXDC_RELEASE_VERSION_REQUIRED);
|
||||
|
||||
global_state.nyx_fdl = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user