-
Notifications
You must be signed in to change notification settings - Fork 24
/
structs.h
142 lines (120 loc) · 3.01 KB
/
structs.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#pragma once
class TypeInfo;
class FieldInfo;
DWORD_PTR FindPattern(DWORD_PTR dwAddress, DWORD_PTR dwLen, DWORD_PTR offset, bool deref, BYTE *bMask, char * szMask);
enum kTypes
{
kType_Pointer = 53,
kType_Array = 65
};
class ClassInfo
{
public:
static ClassInfo* GetInstance()
{
static ClassInfo** instance = NULL;
if (!instance)
{
DWORD_PTR dwMatch = FindPattern((DWORD_PTR)GetModuleHandle(NULL), -1, 0, false, (BYTE*)"\x48\x8B\x05\x00\x00\x00\x00\x48\x89\x41\x08\x48\x89\x0D\x00\x00\x00\x00\xC3", "xxx????xxxxxxx????x");
if (!dwMatch)
return NULL;
DWORD_PTR dwOffset = *(DWORD*)(dwMatch + 3);
BYTE* first = (BYTE*)&dwOffset;
if (first[3] == 0xFF)
dwOffset = dwOffset + 0xFFFFFFFF00000000;
DWORD_PTR dwOffset2 = (dwMatch + 7);
instance = (ClassInfo**)(dwOffset + dwOffset2);
Log("Instance found at 0x%016llX", instance );
}
return *instance;
}
TypeInfo* typeInfo; //0x0000
ClassInfo* next; //0x0008
unsigned short id; //0x0010
unsigned short isDataContainer; //0x0012
char pad_0x0014[0x4]; //0x0014
ClassInfo* parent; //0x0018
char pad_0x0020[0x8]; //0x0020
unsigned short id3; //0x0028
char pad_0x002C[0x94]; //0x002C
};//Size=0x00C0
class TypeInfo
{
public:
char* name; //0x0000
unsigned short flags; //0x0008
unsigned short totalSize; //0x000A
char pad_0x000C[0x4];
unsigned short flags2; //0x0010
char pad_0x0012[0x6]; //0x0012
unsigned short alignment; //0x0018
unsigned short fieldCount; //0x001A
char pad_0x001C[0x4]; //0x001C
FieldInfo* enumFields; //0x0020
FieldInfo* structFields; //0x0028
FieldInfo* fields; //0x0030
};//Size=0x0038
class MemberInfoFlags
{
public:
unsigned short flagBits; // this+0x0
enum
{
kMemberTypeMask = 0x3, // constant 0x3
kTypeCategoryShift = 0x2, // constant 0x2
kTypeCategoryMask = 0x3, // constant 0x3
kTypeCodeShift = 0x4, // constant 0x4
kTypeCodeMask = 0x1F, // constant 0x1F
kMetadata = 0x800, // constant 0x800
kHomogeneous = 0x1000, // constant 0x1000
kAlwaysPersist = 0x2000, // constant 0x2000
kExposed = 0x2000, // constant 0x2000
kLayoutImmutable = 0x4000, // constant 0x4000
kBlittable = 0xFFFF8000 // constant 0xFFFF8000
};
};
enum TypeFlags
{
kTypeFlag_Enum = 0xC000
};
class MemberTypeInfo
{
public:
TypeInfo* typeInfo;
unsigned short flags;
char pad[0x8];
};
class FieldInfo
{
public:
int GetFieldSize()
{
if (!typeInfo)
return 0;
TypeInfo* ti = typeInfo->typeInfo;
switch (ti->flags)
{
case kType_Pointer:
return 8;
case kType_Array:
return 8;
default:
return ti->totalSize;
}
}
char* name;
MemberInfoFlags flags;
unsigned short offset;
char pad[0x4];
MemberTypeInfo* typeInfo;
};
class FieldInfoEnum
{
public:
char* name;
MemberInfoFlags flags;
unsigned short offset;
char pad[0x4];
__int32 value;
char pad2[0x4];
};