From 164f449a02ac5203c8ddc276b408c604ac5822ea Mon Sep 17 00:00:00 2001 From: Sergej Schumilo Date: Thu, 7 Apr 2022 10:52:30 +0200 Subject: [PATCH 1/3] fix several compiler warnings --- nyx/memory_access.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nyx/memory_access.c b/nyx/memory_access.c index a523f00c6c..c449f4e0e3 100644 --- a/nyx/memory_access.c +++ b/nyx/memory_access.c @@ -592,12 +592,12 @@ static bool read_memory(uint64_t address, uint64_t* buffer, size_t size, bool re return true; } -__attribute__((always_inline)) +__attribute__((always_inline)) inline static bool bit(uint64_t value, uint8_t lsb) { return (value >> lsb) & 1; } -__attribute__((always_inline)) +__attribute__((always_inline)) inline static uint64_t bits(uint64_t value, uint8_t lsb, uint8_t msb) { return (value & ((0xffffffffffffffffull >> (64 - (msb - lsb + 1))) << lsb)) >> lsb; } @@ -633,7 +633,7 @@ static uint64_t load_entry(uint64_t address, uint64_t index, } static void print_page(uint64_t address, uint64_t entry, size_t size, bool s, bool w, bool x) { - fprintf(stderr, " %c%c%c %016llx %zx", + fprintf(stderr, " %c%c%c %016lx %zx", s ? 's' : 'u', w ? 'w' : 'r', x ? 'x' : '-', (bits(entry, 12, 51) << 12) & ~(size - 1), size); } @@ -651,7 +651,7 @@ static void print_48_pte(uint64_t address, uint64_t pde_entry, bool read_from_sn uint64_t entry = pte_table[i]; if (entry) { - fprintf(stderr, "\n 1 %016llx", address | i << 12, entry); + fprintf(stderr, "\n 1 %016lx [%ld]", address | i << 12, entry); } if (!bit(entry, 0)) { @@ -676,7 +676,7 @@ static void print_48_pde(uint64_t address, uint64_t pdpte_entry, bool read_from_ uint64_t entry = pde_table[i]; if (entry) { - fprintf(stderr, "\n 2 %016llx", address | i << 21, entry); + fprintf(stderr, "\n 2 %016lx [%ld]", address | i << 21, entry); } if (!bit(entry, 0)) { @@ -704,7 +704,7 @@ static void print_48_pdpte(uint64_t address, uint64_t pml4_entry, bool read_from uint64_t entry = pdpte_table[i]; if (entry) { - fprintf(stderr, "\n 3 %016llx", address | i << 30, entry); + fprintf(stderr, "\n 3 %016lx [%ld]", address | i << 30, entry); } if (!bit(entry, 0)) { @@ -736,7 +736,7 @@ static void print_48_pagetables_(uint64_t cr3, bool read_from_snapshot) { } if (entry) { - fprintf(stderr, "\n4 %016llx", address, entry); + fprintf(stderr, "\n4 %016lx [%ld]", address, entry); } if (bit(entry, 0)) { From 0449772d10a5513a50fd36aea16aa9010a7ad895 Mon Sep 17 00:00:00 2001 From: Sergej Schumilo Date: Thu, 7 Apr 2022 10:52:48 +0200 Subject: [PATCH 2/3] fix compile script --- compile_qemu_nyx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile_qemu_nyx.sh b/compile_qemu_nyx.sh index 641c648f86..e36fe285f8 100755 --- a/compile_qemu_nyx.sh +++ b/compile_qemu_nyx.sh @@ -45,7 +45,7 @@ compile_libraries (){ echo "[!] compiling libxdc..." cd libxdc - sudo make install + CFLAGS="-I../capstone_v4/include/" V=1 make libxdc.a cd .. echo "[!] libxdc is ready!" } From 758e65871b311121d75adf984c1efd083bd36f49 Mon Sep 17 00:00:00 2001 From: Sergej Schumilo Date: Thu, 7 Apr 2022 10:58:16 +0200 Subject: [PATCH 3/3] update NYX_HOST_VERSION --- nyx/hypercall/configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nyx/hypercall/configuration.h b/nyx/hypercall/configuration.h index 3c4e9ea0f0..a94e92b3f6 100644 --- a/nyx/hypercall/configuration.h +++ b/nyx/hypercall/configuration.h @@ -10,7 +10,7 @@ void handle_hypercall_kafl_set_agent_config(struct kvm_run *run, CPUState *cpu, #define NYX_HOST_MAGIC 0x4878794e #define NYX_AGENT_MAGIC 0x4178794e -#define NYX_HOST_VERSION 1 +#define NYX_HOST_VERSION 2 #define NYX_AGENT_VERSION 1 typedef struct host_config_s{