-
Notifications
You must be signed in to change notification settings - Fork 0
/
SigsObject.h
86 lines (71 loc) · 2.7 KB
/
SigsObject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
#include <stdio.h>
#include <windows.h>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include "HipsCfgObject.h"
#include "FlagsObject.h"
#include "ParsingImpl.h"
namespace cchips {
#define SI_CATEGORY "Category"
#define SI_CALL "Calling convention"
#define SI_SIGNATURE "Signature"
#define SI_CLASS "Class"
#define SI_HOOKS "Hooks"
#define SI_PARAMETERS "Parameters"
#define SI_HANDLE "Handle"
#define SI_ENSURE "Ensure"
#define SI_PRELOG "PreLog"
#define SI_POSTLOG "PostLog"
#define SI_PRECHECK "PreCheck"
#define SI_POSTCHECK "PostCheck"
#define SI_LOGGING "Logging"
#define SI_LIBRARY "Library"
#define SI_RETURN "Return"
#define SI_SUCCESS "Success"
#define SI_FAILED "Failed"
#define SI_SPECIAL "Special"
#define SI_FEATURE "Feature"
#define SI_CTYPE "Type"
#define SI_CNAME "Name"
#define SI_CDELAY "Delay"
#define SI_CVTBLIDX "VtblIdx"
#define SI_BITMAP "Bitmap"
#define SI_PLATFORM "Platform"
#define SI_PROC_TYPE "Processes"
#define SI_PROC_CATEGORY "Category"
#define SI_CCODE "CCode"
#define SI_CHECK "Check"
#define SI_MODIFY "Modify"
#define SI_LOG "Log"
#define SI_DEFINE "Define"
#define CCS_WINAPI "WINAPI"
#define CCS_CDECL "CDECL"
#define CCS_FASTCALL "FASTCALL"
#define CCS_STDCALL "STDCALL"
#define CCS_VECTORCALL "VECTORCALL"
#define VAR_CONSTANT L"%%var%d"
class CSigsCfgObject
{
public:
CSigsCfgObject() = delete;
CSigsCfgObject(const std::string& name) : m_bValid(false), m_name(name) {}
~CSigsCfgObject() = default;
static bool InitializeCheck(const std::shared_ptr<CFunction>& func_object, const ConstRapidObject& Object);
static bool InitializeLog(const std::shared_ptr<CFunction>& func_object, const ConstRapidObject& Object);
static bool InitializeEnsure(const std::shared_ptr<CFunction>& func_object, const ConstRapidObject& Object);
static bool InitializeHandle(const std::shared_ptr<CFunction>& func_object, const ConstRapidObject& Object);
static bool InitializePrototype(const std::shared_ptr<CFunction>& func_object, const ConstRapidObject& Object);
// static bool InitializeCCode(const std::shared_ptr<CFunction>& func_object, const ConstRapidObject& Object);
static bool InitializeFunction(CFunction::_call_convention call_conv, const std::string& func_name, const ConstRapidObject& Object, std::shared_ptr<CFunctionProtos> func_protos = nullptr);
bool Initialize(const std::string_view& json_str);
static const int InvalidOrdinal = -1;
private:
bool m_bValid;
std::string m_name;
std::string m_category_name;
CFunction::_call_convention GetCallConvention(const std::string_view& str_call) const;
};
} // namespace cchips