Coverage Report

Created: 2025-08-29 07:04

/src/zydis/src/Zydis.c
Line
Count
Source (jump to first uncovered line)
1
/***************************************************************************************************
2
3
  Zyan Disassembler Library (Zydis)
4
5
  Original Author : Florian Bernd
6
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:
13
 *
14
 * The above copyright notice and this permission notice shall be included in all
15
 * copies or substantial portions of the Software.
16
 *
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
23
 * SOFTWARE.
24
25
***************************************************************************************************/
26
27
#include <Zydis/Zydis.h>
28
29
/* ============================================================================================== */
30
/* Exported functions                                                                             */
31
/* ============================================================================================== */
32
33
ZyanU64 ZydisGetVersion(void)
34
2
{
35
2
    return ZYDIS_VERSION;
36
2
}
37
38
ZyanStatus ZydisIsFeatureEnabled(ZydisFeature feature)
39
0
{
40
0
    switch (feature)
41
0
    {
42
0
    case ZYDIS_FEATURE_DECODER:
43
0
#ifndef ZYDIS_DISABLE_DECODER
44
0
        return ZYAN_STATUS_TRUE;
45
#else
46
        return ZYAN_STATUS_FALSE;
47
#endif
48
0
    case ZYDIS_FEATURE_ENCODER:
49
0
#ifndef ZYDIS_DISABLE_ENCODER
50
0
        return ZYAN_STATUS_TRUE;
51
#else
52
        return ZYAN_STATUS_FALSE;
53
#endif
54
0
    case ZYDIS_FEATURE_FORMATTER:
55
0
#ifndef ZYDIS_DISABLE_FORMATTER
56
0
        return ZYAN_STATUS_TRUE;
57
#else
58
        return ZYAN_STATUS_FALSE;
59
#endif
60
0
    case ZYDIS_FEATURE_AVX512:
61
0
#ifndef ZYDIS_DISABLE_AVX512
62
0
        return ZYAN_STATUS_TRUE;
63
#else
64
        return ZYAN_STATUS_FALSE;
65
#endif
66
67
0
    case ZYDIS_FEATURE_KNC:
68
0
#ifndef ZYDIS_DISABLE_KNC
69
0
        return ZYAN_STATUS_TRUE;
70
#else
71
        return ZYAN_STATUS_FALSE;
72
#endif
73
74
0
    case ZYDIS_FEATURE_SEGMENT:
75
0
#ifndef ZYDIS_DISABLE_SEGMENT
76
0
        return ZYAN_STATUS_TRUE;
77
#else
78
        return ZYAN_STATUS_FALSE;
79
#endif
80
81
0
    default:
82
0
        return ZYAN_STATUS_INVALID_ARGUMENT;
83
0
    }
84
0
}
85
86
/* ============================================================================================== */