Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
saviosg committed Jul 26, 2019
0 parents commit 4a56f54
Show file tree
Hide file tree
Showing 29 changed files with 14,280 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
KERNEL_PATH ?= /lib/modules/$(shell uname -r)/build

MODULE_NAME = op_emu

$(MODULE_NAME)-objs := trap_hook.o opemu.o ssse3.o sse3.o opemu_math.o sse42.o sse41.o fpins.o libudis86/udis86.o libudis86/syn.o libudis86/decode.o libudis86/itab.o libudis86/syn-intel.o libudis86/syn-att.o


obj-m += $(MODULE_NAME).o

KBUILD_CFLAGS += -DDEBUG -g -O2 -march=native -mtune=native -mmmx -msse -msse2

export KBUILD_CFLAGS

all:
make -C $(KERNEL_PATH) M=$(PWD) modules

clean:
make -C $(KERNEL_PATH) M=$(PWD) clean
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## OPEMU for Linux

- This is an adaptation of the original Opcode Emulator from [xnu-amd's repo](https://github.com/sinetek/xnu-amd/tree/master/osfmk/OPEMU) for Linux.

- For the kernel module, and a few other things (fpins, SSE4.1...), I took some code from [Meowthra's OPEMU](https://www.insanelymac.com/forum/topic/338919-opcode-emulator-opemu-for-linux-64-bit/), which looks pretty good, but does not fit my needs (SSSE3, SSE4.1, & SSE4.2).

## What's working

- SSE3, SSSE3, SSE4.2 (mostly).
- most SSE4.1 instructions are missing, I tried to add a few but it's not working well yet.
Loading

0 comments on commit 4a56f54

Please sign in to comment.