This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdllmain.hpp
102 lines (91 loc) · 4.07 KB
/
dllmain.hpp
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
#pragma once
#include "pch.hpp"
#include "Printer.hpp"
#include "Engine/Engine.hpp"
namespace Utils
{
void Messagebox(const std::string& message, const std::string& title, uint32_t flags);
uintptr_t FindPattern(HMODULE hModule, const uint8_t* pattern, const char* mask);
bool MapExists(std::multimap<std::string, std::string>& map, const std::string& key, const std::string& value);
bool SortProperty(class UProperty* uPropertyA, class UProperty* uPropertyB);
bool SortPropertyPair(const std::pair<class UProperty*, std::string>& pairA, const std::pair<class UProperty*, std::string>& pairB);
bool IsStructProperty(EPropertyTypes propertyType);
bool IsBitField(EPropertyTypes propertyType);
bool IsBitField(unsigned long dimension);
bool AreGObjectsValid();
bool AreGNamesValid();
}
namespace Retrievers
{
void GetAllPropertyFlags(std::ostringstream& stream, uint64_t propertyFlags);
void GetAllFunctionFlags(std::ostringstream& stream, uint64_t functionFlags);
EPropertyTypes GetPropertyTypeInternal(class UProperty* uProperty, std::string& outPropertyType, bool ignoreEnum, bool isBitField = false);
EPropertyTypes GetPropertyType(class UProperty* uProperty, std::string& outPropertyType, bool isBitField = false);
size_t GetPropertySize(class UProperty* uProperty, bool isBitField = true);
uintptr_t GetEntryPoint();
uintptr_t GetOffset(uintptr_t address);
}
namespace ConstGenerator
{
void GenerateConst(std::ofstream& file, class UConst* constant);
void ProcessConsts(std::ofstream& file, class UObject* packageObj);
}
namespace EnumGenerator
{
extern std::unordered_map<std::string, std::vector<class UEnum*>> mEnumCache;
extern std::unordered_map<UEnum*, std::string> mGeneratedNames;
std::string GenerateEnumName(class UEnum* uEnum);
void GenerateEnum(std::ofstream& file, class UEnum* uEnum);
void ProcessEnums(std::ofstream& file, class UObject* packageObj);
}
namespace StructGenerator
{
extern std::vector<std::string> vGeneratedStructs;
class UScriptStruct* FindLargestStruct(const std::string& structFullName);
void GenerateStructFields(std::ofstream& structStream, EClassTypes structType);
void GenerateStruct(std::ofstream& file, class UScriptStruct* scriptStruct);
void GenerateStructProperties(std::ofstream& file, class UScriptStruct* scriptStruct, class UObject* packageObj);
void ProcessStructs(std::ofstream& file, class UObject* packageObj);
}
namespace ClassGenerator
{
extern std::unordered_map<std::string, int32_t> mGeneratedClasses;
void GenerateClassFields(std::ostringstream& classStream, class UClass* uClass, EClassTypes classType);
void GenerateClass(std::ofstream& file, class UClass* uClass);
void GenerateClassProperties(std::ofstream& file, class UClass* uClass, class UObject* packageObj);
void ProcessClasses(std::ofstream& file, class UObject* packageObj);
}
namespace ParameterGenerator
{
void GenerateParameter(std::ofstream& file, class UClass* uClass);
void ProcessParameters(std::ofstream& file, class UObject* packageObj);
}
namespace FunctionGenerator
{
void GenerateVirtualFunctions(std::ofstream& file);
void GenerateFunctionCode(std::ofstream& file, class UClass* uClass);
void GenerateFunctionDescription(std::ofstream& file, class UClass* uClass);
void ProcessFunctions(std::ofstream& file, class UObject* packageObj);
}
namespace Generator
{
extern bool GlobalsInitialized;
extern std::ofstream LogFile;
extern std::vector<class UObject*> vPackages;
extern std::vector<class UObject*> vIncludes;
extern std::vector<std::pair<std::string, int32_t>> vConstants;
std::string CreateValidName(std::string name);
std::string CreateUniqueName(class UClass* uClass);
std::string CreateUniqueName(class UFunction* uFunction, class UClass* uClass);
std::string CreateIndexName(class UObject* uObject, bool pushBack);
void MakeWindowsFunction(std::string& functionName);
void GenerateConstants();
void GenerateHeaders();
void GenerateDefines();
void ProcessPackages(const std::filesystem::path& directory);
void GenerateSDK();
void DumpInstances(bool dumpNames, bool dumpObjects);
void DumpObjects();
void DumpNames();
bool Initialize(bool createLogFile);
}