forked from Drifter321/DHooks2
-
Notifications
You must be signed in to change notification settings - Fork 11
/
signatures.h
53 lines (44 loc) · 1.3 KB
/
signatures.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
#ifndef _INCLUDE_SIGNATURES_H_
#define _INCLUDE_SIGNATURES_H_
#include "extension.h"
#include "util.h"
#include <string>
#include <vector>
#include <sm_stringhashmap.h>
struct ArgumentInfo {
ArgumentInfo() : name()
{ }
ArgumentInfo(std::string name, ParamInfo info) : name(name), info(info)
{ }
std::string name;
ParamInfo info;
};
class SignatureWrapper {
public:
std::string signature;
std::string address;
std::string offset;
std::vector<ArgumentInfo> args;
CallingConvention callConv;
HookType hookType;
ReturnType retType;
ThisPointerType thisType;
};
class SignatureGameConfig : public ITextListener_SMC {
public:
SignatureWrapper *GetFunctionSignature(const char *function);
public:
//ITextListener_SMC
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
SMCResult ReadSMC_LeavingSection(const SMCStates *states);
void ReadSMC_ParseStart();
private:
ReturnType GetReturnTypeFromString(const char *str);
HookParamType GetHookParamTypeFromString(const char *str);
Register_t GetCustomRegisterFromString(const char *str);
private:
StringHashMap<SignatureWrapper *> signatures_;
};
extern SignatureGameConfig *g_pSignatures;
#endif