From 827f32a28bf9e0148c5e436ff1fbc87d17f49985 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Mon, 24 Jun 2024 18:19:38 -0400 Subject: [PATCH] Disable udis86 worker/decoder (#2043) * Disable udis86 worker/decoder * udis86: remove submod --------- Co-authored-by: William Woodruff --- .gitmodules | 3 --- src/worker/Makefile | 1 - src/worker/udis86/Makefile | 27 --------------------------- src/worker/udis86/udis86 | 1 - src/worker/udis86/udis86.c | 28 ---------------------------- workers.spec | 1 - 6 files changed, 61 deletions(-) delete mode 100644 src/worker/udis86/Makefile delete mode 160000 src/worker/udis86/udis86 delete mode 100644 src/worker/udis86/udis86.c diff --git a/.gitmodules b/.gitmodules index fd10eb99..cfc6e1f2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule "src/worker/zydis/zydis"] path = src/worker/zydis/zydis url = https://github.com/zyantific/zydis.git -[submodule "src/worker/udis86/udis86"] - path = src/worker/udis86/udis86 - url = https://github.com/vmt/udis86.git [submodule "src/worker/dynamorio/dynamorio"] path = src/worker/dynamorio/dynamorio url = https://github.com/DynamoRIO/dynamorio.git diff --git a/src/worker/Makefile b/src/worker/Makefile index 15511de9..36a3597b 100644 --- a/src/worker/Makefile +++ b/src/worker/Makefile @@ -2,7 +2,6 @@ WORKERS = bfd \ capstone \ dynamorio \ fadec \ - udis86 \ xed \ zydis \ bddisasm \ diff --git a/src/worker/udis86/Makefile b/src/worker/udis86/Makefile deleted file mode 100644 index c59b937b..00000000 --- a/src/worker/udis86/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# NOTE(ww): I don't fully understand why I need the RPATH here -# but not in the capstone build. -override CFLAGS := $(CFLAGS) -Wl,-rpath,$(shell pwd)/udis86/build/lib -override CPPFLAGS := $(CPPFLAGS) -Iudis86/build/include -override LDFLAGS := $(LDFLAGS) -Ludis86/build/lib -override LDLIBS := $(LDLIBS) -ludis86 - -.PHONY: all -all: udis86.so - -udis86/build/lib/libudis86.so: - cd udis86 && \ - ./autogen.sh && \ - ./configure --prefix=$(shell pwd)/udis86/build/ && \ - make -j 4 && \ - make install - -udis86.so: udis86.o - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) udis86.o $(LDLIBS) -o $@ - -udis86.o: udis86/build/lib/libudis86.so udis86.c - -.PHONY: clean -clean: - make -C udis86 clean - rm -rf *.o *.so - rm -rf udis86/build diff --git a/src/worker/udis86/udis86 b/src/worker/udis86/udis86 deleted file mode 160000 index 56ff6c87..00000000 --- a/src/worker/udis86/udis86 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 56ff6c87c11de0ffa725b14339004820556e343d diff --git a/src/worker/udis86/udis86.c b/src/worker/udis86/udis86.c deleted file mode 100644 index 090988c0..00000000 --- a/src/worker/udis86/udis86.c +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#include "../worker.h" - -static ud_t udis; - -char *worker_name = "udis86"; - -void worker_ctor() { - ud_init(&udis); - ud_set_mode(&udis, 64); - ud_set_syntax(&udis, UD_SYN_INTEL); - ud_set_vendor(&udis, UD_VENDOR_ANY); -} - -void try_decode(decode_result *result, uint8_t *raw_insn, uint8_t length) { - ud_set_input_buffer(&udis, raw_insn, length); - - size_t count = ud_disassemble(&udis); - if (count <= 0 || strstr(ud_insn_asm(&udis), "invalid")) { - result->status = S_FAILURE; - } else { - result->status = S_SUCCESS; - strncpy(result->result, ud_insn_asm(&udis), MISHEGOS_DEC_MAXLEN); - result->len = strlen(result->result); - result->ndecoded = ud_insn_len(&udis); - } -} diff --git a/workers.spec b/workers.spec index 687310b3..9020b2c1 100644 --- a/workers.spec +++ b/workers.spec @@ -2,7 +2,6 @@ ./src/worker/capstone/capstone.so ./src/worker/dynamorio/dynamorio.so ./src/worker/fadec/fadec.so -./src/worker/udis86/udis86.so ./src/worker/xed/xed.so ./src/worker/zydis/zydis.so ./src/worker/bddisasm/bddisasm.so