1 /***************************************************************************************************
3 Zyan Disassembler Library (Zydis)
5 Original Author : Florian Bernd
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 ***************************************************************************************************/
27 #include <Zydis/Zydis.h>
29 /* ============================================================================================== */
30 /* Exported functions */
31 /* ============================================================================================== */
33 ZyanU64
ZydisGetVersion(void)
38 ZyanStatus
ZydisIsFeatureEnabled(ZydisFeature feature
)
42 case ZYDIS_FEATURE_DECODER
:
43 #ifndef ZYDIS_DISABLE_DECODER
44 return ZYAN_STATUS_TRUE
;
46 return ZYAN_STATUS_FALSE
;
48 case ZYDIS_FEATURE_ENCODER
:
49 #ifndef ZYDIS_DISABLE_ENCODER
50 return ZYAN_STATUS_TRUE
;
52 return ZYAN_STATUS_FALSE
;
54 case ZYDIS_FEATURE_FORMATTER
:
55 #ifndef ZYDIS_DISABLE_FORMATTER
56 return ZYAN_STATUS_TRUE
;
58 return ZYAN_STATUS_FALSE
;
60 case ZYDIS_FEATURE_AVX512
:
61 #ifndef ZYDIS_DISABLE_AVX512
62 return ZYAN_STATUS_TRUE
;
64 return ZYAN_STATUS_FALSE
;
67 case ZYDIS_FEATURE_KNC
:
68 #ifndef ZYDIS_DISABLE_KNC
69 return ZYAN_STATUS_TRUE
;
71 return ZYAN_STATUS_FALSE
;
74 case ZYDIS_FEATURE_SEGMENT
:
75 #ifndef ZYDIS_DISABLE_SEGMENT
76 return ZYAN_STATUS_TRUE
;
78 return ZYAN_STATUS_FALSE
;
82 return ZYAN_STATUS_INVALID_ARGUMENT
;
86 /* ============================================================================================== */