Commit Graph

284 Commits

Author SHA1 Message Date
flobernd 67e04ec52f
Updated license and version-info 2018-01-19 02:38:18 +01:00
flobernd 9a43872b90
Fixed operand size of some conditional jump instructions 2018-01-19 02:36:46 +01:00
flobernd 61f607e1df
Minor optimizations and bugfixes
- Fixed `XCHG R8, RAX` falsely beeing decoded as `NOP`
- Fixed `EVEX/MVEX.R'` not beeing ignored in 16- and 32-bit mode
- Removed some unnecessary conditions from operand-action related code
2018-01-17 00:31:32 +01:00
flobernd 7074e363f0
Fixed formatting of memory operands with explicit segment register 2018-01-14 18:49:56 +01:00
flobernd 57ccc70415
Optimized detection of bad register values 2018-01-11 22:30:23 +01:00
flobernd 9c71771875
Added missing `LOCK` prefix check for `3DNOW` encoded instructions 2018-01-11 02:39:43 +01:00
flobernd 7fb7eea11f
Bugfixes and table changes
- Fixed `SSE4A` ISA-set and ISA-ext
- Added missing `VEX`-encoded `GFNI` instructions
- Added check for invalid `GATHER`/`SCATTER` registers
2018-01-11 02:17:17 +01:00
flobernd 203dee3bfb
Bugfixes and table changes
- Fixed decoding of `XOP` instructions
- Fixed handling of illegal `LOCK` prefixes for `XOP/VEX/EVEX/MVEX` instructions
- Significantly improved detection of bad register values
- Added SSE4a instructions (`EXTRQ`, `INSERTQ`, `MOVNTSD` and `MOVNTSS`)
- Added `VPOPCNTD`/`VPOPCNTQ` instructions with 128- and 256-bit vector-length
- Fixed exception-class of some `GFNI` instructions
- Fixed `RDRAND` and `RDSEED` instructions
- Fixed `SYSRET` instruction
2018-01-10 23:04:57 +01:00
flobernd fb519fe933
Internal refactorings and performance optimizations 2018-01-10 17:02:11 +01:00
flobernd 585fa7035a
Minor refactorings 2017-12-31 17:27:59 +01:00
flobernd 38c99667c4
Minor table changes
- Fixed `LWPINS` and `LWPVAL` instructions
- Added `PCONFIG` instruction
2017-12-20 23:36:59 +01:00
flobernd f8369ac13c
Minor table fixes
- Changed `XSAVE`/`XSAVEOPT` memory operand from W to RW
- Changed amount of bytes popped from stack by the `IRET` instruction
2017-12-20 09:56:51 +01:00
flobernd e4f9054c97
Changed size of `AVX2`-gather memory operands to match `AVX512`
The operand-size is now the size of a single element instead of the total size (like it already is for the `AVX512` gather/scatter instructions)
2017-12-10 10:44:59 +01:00
Joel Höner 82f72cf5a1
Fix register strings 2017-12-04 00:37:32 +01:00
Joel Höner 31c369d3f1 Merge branch 'feature/zydis-string' into develop
# Conflicts:
#	include/Zydis/Formatter.h
#	src/Formatter.c
2017-12-03 22:47:01 +01:00
flobernd dff821402b Refactored `ZydisFormatter`
- Added `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`, `ZYDIS_FORMATTER_HOOK_POST_OPERAND` and `ZYDIS_FORMATTER_HOOK_PRINT_REGISTER`
- Renamed `ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT` to `ZYDIS_FORMATTER_HOOK_PRINT_DISP`
- Renamed `ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE` to `ZYDIS_FORMATTER_HOOK_PRINT_IMM`
- Renamed `ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE` to `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE`
- Removed `ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT`
- Renamed some enums and types
- Revised documentation
- Fixed examples and tools
2017-12-03 22:38:20 +01:00
flobernd 451d7fb1a8 Fixed and refactored some enums
- Fixed `ZydisRegister` enum and string-table
- Renamed `ZYDIS_XXX_MAX_BITS` in `ZYDIS_XXX_MIN_BITS`
2017-12-03 22:38:20 +01:00
flobernd 043b1f5a5a Minor improvements to the instruction-formatter
- Added zero-termination for the output string of  `ZydisFormatterFormatInstruction` /  `ZydisFormatterFormatInstructionEx` in error cases
- Renamed some internal functions
2017-12-03 22:38:20 +01:00
flobernd 1d6c296c5f Renamed `ZydisStringAppendStaticEx` to `ZydisStringAppendExStatic` 2017-12-03 22:38:20 +01:00
flobernd 39facdf5fe Reworked `ZydisString` 2017-12-03 22:38:20 +01:00
Joel Höner 346b7fec10 Moved internal headers 2017-12-03 22:38:20 +01:00
flobernd 07c325b367 Minor bugfixes 2017-12-03 22:38:20 +01:00
flobernd a1d58c9ee7
Replaced `ZYDIS_FORMATTER_HOOK_PRINT_OPERAND_SEPARATOR` by `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`/`ZYDIS_FORMATTER_HOOK_POST_OPERAND` 2017-12-02 19:42:30 +01:00
th0rex 022a4e7423 Add hook for operand seperator to formatter 2017-12-02 18:29:16 +01:00
flobernd 217d5cc9af
Minor refactorings and bugfixes 2017-12-02 06:54:47 +01:00
flobernd 71b21c4301
Renamed `ZydisInternalString` to `ZydisGeneratedString` 2017-12-02 06:40:40 +01:00
flobernd 02030c3b92
Various changes and refactorings
- Moved types and functions from `FormatHelper.h/c` to `String.h/c`
- Added `ZydisMnemonicGetStringEx` function that returns the mnemonic-string as `ZydisString` struct
- Added `ZYDIS_UNUSED_PARAMETER` macro
- Fixed omitting of operands in custom formatter-hooks
- Fixed `FormatterHooks` example
- Refactored some code
2017-12-02 06:36:12 +01:00
Joel Höner fa12ccb64b Switch to length aware string 2017-12-01 20:40:56 +01:00
flobernd 930c4df970
Removed `ZydisDecodedInstruction.instrPointer`
The instruction-pointer was always pointing to the next instruction (which is inconsistent for branch instructions). We can't always tell IF an instruction is going to branch (for the conditional ones), so we decided to completely remove it.

You can always manually combine `instrAddress` and `length` to calculate this value.
2017-12-01 20:21:25 +01:00
flobernd 1cd788f751
Minor table fixes 2017-12-01 01:18:25 +01:00
Joel Höner 58ce3a3e7f Removed forgotten stdint.h include 2017-11-30 08:03:34 +01:00
flobernd beeaa0e279
Added additional check for invalid AVX-512 zero masks 2017-11-29 22:47:09 +01:00
flobernd 6d690a4893 Improved file-size reduction for builds without `ZYDIS_FEATURE_EVEX`/`ZYDIS_FEATURE_MVEX` 2017-11-27 13:42:24 +01:00
Joel Höner a2cc8615ba Various minor no-libc fixes 2017-11-27 00:06:09 +01:00
Joel Höner 56f47f4863 Added support for compiling on ARM target 2017-11-26 04:38:32 +01:00
flobernd 8c69dba9db Added handling of the `ZYDIS_FEATURE_EVEX` and `ZYDIS_FEATURE_MVEX` CMake switches
Disabling these features will only prevent some code from beeing generated. Completely removing EVEX/MVEX from the data-tables using a compiler-define is not possible at the moment (you have to re-generate the tables, if you want to save a few more bytes).
2017-11-25 18:14:05 +01:00
flobernd dd9d9134d4 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-11-25 16:30:10 +01:00
Joel Höner c4f5af64d0 Added own `NULL` 2017-11-25 03:18:08 +01:00
flobernd 31ff30f763 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-11-25 02:32:27 +01:00
Joel Höner cf24ee010a Introduced custom integer types 2017-11-25 01:47:02 +01:00
Joel Höner 066e7f359d Removed old feature check flags 2017-11-25 00:41:27 +01:00
flobernd 3f66d84a02 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-11-24 22:31:03 +01:00
Joel Höner f1316c434e Fixed `ZydisMemorySet` implementation 2017-11-24 20:32:52 +01:00
Joel Höner df949a5eb0 Improved no-libc support
- Added `ZYDIS_NO_LIBC` CMake switch
- When enabled, removes dependency on `memset`, `memcpy` and `strlen`
2017-11-24 19:25:48 +01:00
flobernd e789d11af1 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-11-24 17:55:00 +01:00
Joel Höner fb452e5b59 Inverted feature gate macros 2017-11-23 22:42:25 +01:00
flobernd a3d1490daa Fixed some instruction definitions 2017-11-17 01:35:56 +01:00
flobernd 0f30c1679b `KNC` instructions are only valid in 64-bit mode 2017-11-17 01:26:54 +01:00
flobernd 4195e9b0b8 Some decoder and formatter improvements
- Added `const` specifiers to some local variables
- Added KNC compatibility-mode (`ZYDIS_DECODER_MODE_KNC`) to improve decoding of ambiguous KNC/KNL+ mask-instructions
2017-11-16 22:18:20 +01:00
flobernd e314c71db3 Added some undocumented `PREFETCH` instructions 2017-11-16 18:47:42 +01:00