fix libafl side wih new version
This commit is contained in:
parent
ad1628c6e6
commit
0832bb4892
@ -34,27 +34,6 @@
|
|||||||
|
|
||||||
#include <qemu-plugin.h>
|
#include <qemu-plugin.h>
|
||||||
|
|
||||||
//// --- Begin LibAFL code ---
|
|
||||||
static inline gpointer g_memdup2_qemu(gconstpointer mem, gsize byte_size)
|
|
||||||
{
|
|
||||||
#if GLIB_CHECK_VERSION(2, 68, 0)
|
|
||||||
return g_memdup2(mem, byte_size);
|
|
||||||
#else
|
|
||||||
gpointer new_mem;
|
|
||||||
|
|
||||||
if (mem && byte_size != 0) {
|
|
||||||
new_mem = g_malloc(byte_size);
|
|
||||||
memcpy(new_mem, mem, byte_size);
|
|
||||||
} else {
|
|
||||||
new_mem = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new_mem;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#define g_memdup2(m, s) g_memdup2_qemu(m, s)
|
|
||||||
//// --- End LibAFL code ---
|
|
||||||
|
|
||||||
QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
|
QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
|
||||||
|
|
||||||
/* saved so we can uninstall later */
|
/* saved so we can uninstall later */
|
||||||
|
@ -302,7 +302,7 @@ void gdb_handle_query_rcmd(GArray *params, void *user_ctx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = strlen(get_param(params, 0)->data);
|
len = strlen(gdb_get_cmd_param(params, 0)->data);
|
||||||
if (len % 2) {
|
if (len % 2) {
|
||||||
gdb_put_packet("E01");
|
gdb_put_packet("E01");
|
||||||
return;
|
return;
|
||||||
@ -310,7 +310,7 @@ void gdb_handle_query_rcmd(GArray *params, void *user_ctx)
|
|||||||
|
|
||||||
g_assert(gdbserver_state.mem_buf->len == 0);
|
g_assert(gdbserver_state.mem_buf->len == 0);
|
||||||
len = len / 2;
|
len = len / 2;
|
||||||
gdb_hextomem(gdbserver_state.mem_buf, get_param(params, 0)->data, len);
|
gdb_hextomem(gdbserver_state.mem_buf, gdb_get_cmd_param(params, 0)->data, len);
|
||||||
|
|
||||||
if (libafl_qemu_gdb_exec()) {
|
if (libafl_qemu_gdb_exec()) {
|
||||||
gdb_put_packet("OK");
|
gdb_put_packet("OK");
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
|
||||||
#include "exec/cpu-defs.h"
|
#include "exec/cpu-defs.h"
|
||||||
#include "exec/translator.h"
|
|
||||||
|
|
||||||
#define EXCP_LIBAFL_EXIT 0xf4775747
|
#define EXCP_LIBAFL_EXIT 0xf4775747
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "tcg/tcg-op.h"
|
#include "tcg/tcg-op.h"
|
||||||
#include "tcg/tcg-temp-internal.h"
|
#include "tcg/tcg-temp-internal.h"
|
||||||
#include "sysemu/runstate.h"
|
#include "sysemu/runstate.h"
|
||||||
#include "exec/translator.h"
|
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "libafl/cpu.h"
|
#include "libafl/cpu.h"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "libafl/gdb.h"
|
#include "libafl/gdb.h"
|
||||||
#include "gdbstub/internals.h"
|
#include "gdbstub/internals.h"
|
||||||
|
#include "gdbstub/commands.h"
|
||||||
|
|
||||||
static struct libafl_custom_gdb_cmd* libafl_qemu_gdb_cmds;
|
static struct libafl_custom_gdb_cmd* libafl_qemu_gdb_cmds;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user