TrinityCore
enuminfo_WardenCheckMgr.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "WardenCheckMgr.h"
19#include "Define.h"
20#include "SmartEnum.h"
21#include <stdexcept>
22
24{
25
26/**********************************************************************\
27|* data for enum 'WardenActions' in 'WardenCheckMgr.h' auto-generated *|
28\**********************************************************************/
29template <>
31{
32 switch (value)
33 {
34 case WARDEN_ACTION_LOG: return { "WARDEN_ACTION_LOG", "Log", "" };
35 case WARDEN_ACTION_KICK: return { "WARDEN_ACTION_KICK", "Kick", "" };
36 case WARDEN_ACTION_BAN: return { "WARDEN_ACTION_BAN", "Ban", "" };
37 default: throw std::out_of_range("value");
38 }
39}
40
41template <>
43
44template <>
46{
47 switch (index)
48 {
49 case 0: return WARDEN_ACTION_LOG;
50 case 1: return WARDEN_ACTION_KICK;
51 case 2: return WARDEN_ACTION_BAN;
52 default: throw std::out_of_range("index");
53 }
54}
55
56template <>
58{
59 switch (value)
60 {
61 case WARDEN_ACTION_LOG: return 0;
62 case WARDEN_ACTION_KICK: return 1;
63 case WARDEN_ACTION_BAN: return 2;
64 default: throw std::out_of_range("value");
65 }
66}
67
68/****************************************************************************\
69|* data for enum 'WardenCheckCategory' in 'WardenCheckMgr.h' auto-generated *|
70\****************************************************************************/
71template <>
73{
74 switch (value)
75 {
76 case INJECT_CHECK_CATEGORY: return { "INJECT_CHECK_CATEGORY", "INJECT_CHECK_CATEGORY", "checks that test whether the client's execution has been interfered with" };
77 case LUA_CHECK_CATEGORY: return { "LUA_CHECK_CATEGORY", "LUA_CHECK_CATEGORY", "checks that test whether the lua sandbox has been modified" };
78 case MODDED_CHECK_CATEGORY: return { "MODDED_CHECK_CATEGORY", "MODDED_CHECK_CATEGORY", "checks that test whether the client has been modified" };
79 default: throw std::out_of_range("value");
80 }
81}
82
83template <>
85
86template <>
88{
89 switch (index)
90 {
91 case 0: return INJECT_CHECK_CATEGORY;
92 case 1: return LUA_CHECK_CATEGORY;
93 case 2: return MODDED_CHECK_CATEGORY;
94 default: throw std::out_of_range("index");
95 }
96}
97
98template <>
100{
101 switch (value)
102 {
103 case INJECT_CHECK_CATEGORY: return 0;
104 case LUA_CHECK_CATEGORY: return 1;
105 case MODDED_CHECK_CATEGORY: return 2;
106 default: throw std::out_of_range("value");
107 }
108}
109
110/************************************************************************\
111|* data for enum 'WardenCheckType' in 'WardenCheckMgr.h' auto-generated *|
112\************************************************************************/
113template <>
115{
116 switch (value)
117 {
118 case TIMING_CHECK: return { "TIMING_CHECK", "TIMING_CHECK", "nyi" };
119 case DRIVER_CHECK: return { "DRIVER_CHECK", "DRIVER_CHECK", "uint Seed + byte[20] SHA1 + byte driverNameIndex (check to ensure driver isn't loaded)" };
120 case PROC_CHECK: return { "PROC_CHECK", "PROC_CHECK", "nyi" };
121 case LUA_EVAL_CHECK: return { "LUA_EVAL_CHECK", "LUA_EVAL_CHECK", "evaluate arbitrary Lua check" };
122 case MPQ_CHECK: return { "MPQ_CHECK", "MPQ_CHECK", "get hash of MPQ file (to check it is not modified)" };
123 case PAGE_CHECK_A: return { "PAGE_CHECK_A", "PAGE_CHECK_A", "scans all pages for specified SHA1 hash" };
124 case PAGE_CHECK_B: return { "PAGE_CHECK_B", "PAGE_CHECK_B", "scans only pages starts with MZ+PE headers for specified hash" };
125 case MODULE_CHECK: return { "MODULE_CHECK", "MODULE_CHECK", "check to make sure module isn't injected" };
126 case MEM_CHECK: return { "MEM_CHECK", "MEM_CHECK", "retrieve specific memory" };
127 default: throw std::out_of_range("value");
128 }
129}
130
131template <>
133
134template <>
136{
137 switch (index)
138 {
139 case 0: return TIMING_CHECK;
140 case 1: return DRIVER_CHECK;
141 case 2: return PROC_CHECK;
142 case 3: return LUA_EVAL_CHECK;
143 case 4: return MPQ_CHECK;
144 case 5: return PAGE_CHECK_A;
145 case 6: return PAGE_CHECK_B;
146 case 7: return MODULE_CHECK;
147 case 8: return MEM_CHECK;
148 default: throw std::out_of_range("index");
149 }
150}
151
152template <>
154{
155 switch (value)
156 {
157 case TIMING_CHECK: return 0;
158 case DRIVER_CHECK: return 1;
159 case PROC_CHECK: return 2;
160 case LUA_EVAL_CHECK: return 3;
161 case MPQ_CHECK: return 4;
162 case PAGE_CHECK_A: return 5;
163 case PAGE_CHECK_B: return 6;
164 case MODULE_CHECK: return 7;
165 case MEM_CHECK: return 8;
166 default: throw std::out_of_range("value");
167 }
168}
169}
#define TC_API_EXPORT
Definition: Define.h:92
WardenCheckCategory
@ MODDED_CHECK_CATEGORY
@ LUA_CHECK_CATEGORY
@ INJECT_CHECK_CATEGORY
WardenCheckType
@ PROC_CHECK
@ DRIVER_CHECK
@ PAGE_CHECK_A
@ PAGE_CHECK_B
@ LUA_EVAL_CHECK
@ MPQ_CHECK
@ MEM_CHECK
@ TIMING_CHECK
@ MODULE_CHECK
WardenActions
@ WARDEN_ACTION_KICK
@ WARDEN_ACTION_BAN
@ WARDEN_ACTION_LOG
static size_t ToIndex(Enum index)
static EnumText ToString(Enum value)
static Enum FromIndex(size_t index)