├── .gitignore
├── ARKSurvivalEvolved.vcxproj
├── ARKSurvivalEvolved.vcxproj.filters
├── AllPointsBulletin.vcxproj
├── AllPointsBulletin.vcxproj.filters
├── AloneInTheDarkIllumination.vcxproj
├── AloneInTheDarkIllumination.vcxproj.filters
├── Borderlands2.vcxproj
├── Borderlands2.vcxproj.filters
├── CreateNewProject.bat
├── CreateNewProject.ps1
├── Engine
├── IGenerator.hpp
├── Logger.cpp
├── Logger.hpp
├── Main.cpp
├── NameValidator.cpp
├── NameValidator.hpp
├── NamesStore.cpp
├── NamesStore.hpp
├── ObjectsStore.cpp
├── ObjectsStore.hpp
├── Package.cpp
├── Package.hpp
├── PatternFinder.cpp
├── PatternFinder.hpp
├── PrintHelper.cpp
├── PrintHelper.hpp
├── UE1
│ ├── FunctionFlags.cpp
│ ├── FunctionFlags.hpp
│ ├── GenericTypes.cpp
│ ├── GenericTypes.hpp
│ ├── Package.cpp
│ ├── PropertyFlags.cpp
│ └── PropertyFlags.hpp
├── UE2
│ ├── FunctionFlags.cpp
│ ├── FunctionFlags.hpp
│ ├── GenericTypes.cpp
│ ├── GenericTypes.hpp
│ ├── Package.cpp
│ ├── PropertyFlags.cpp
│ └── PropertyFlags.hpp
├── UE3
│ ├── FunctionFlags.cpp
│ ├── FunctionFlags.hpp
│ ├── GenericTypes.cpp
│ ├── GenericTypes.hpp
│ ├── Package.cpp
│ ├── PropertyFlags.cpp
│ └── PropertyFlags.hpp
├── UE4
│ ├── FunctionFlags.cpp
│ ├── FunctionFlags.hpp
│ ├── GenericTypes.cpp
│ ├── GenericTypes.hpp
│ ├── Package.cpp
│ ├── PropertyFlags.cpp
│ └── PropertyFlags.hpp
├── cpplinq.hpp
└── tinyformat.h
├── Fortnite.vcxproj
├── Fortnite.vcxproj.filters
├── Hawken.vcxproj
├── Hawken.vcxproj.filters
├── LICENSE
├── Paragon.vcxproj
├── Paragon.vcxproj.filters
├── PlayerUnknownsBattlegrounds.vcxproj
├── PlayerUnknownsBattlegrounds.vcxproj.filters
├── README.md
├── RocketLeague.vcxproj
├── RocketLeague.vcxproj.filters
├── Target
├── ARKSurvivalEvolved
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── AllPointsBulletin
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── AloneInTheDarkIllumination
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── Borderlands2
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── Fortnite
│ ├── EngineClasses.hpp
│ ├── Fortnite.rcnet
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── Hawken
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── PUBG
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── Paragon
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── RocketLeague
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ ├── ObjectsStore.cpp
│ └── RocketLeague.rcnet
├── TribesAscend
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── Unreal
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── Unreal2
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── UnrealTournament2004
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── UnrealTournament3
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
└── UnrealTournament4
│ ├── EngineClasses.hpp
│ ├── Generator.cpp
│ ├── GenericTypes.cpp
│ ├── NamesStore.cpp
│ └── ObjectsStore.cpp
├── TribesAscend.vcxproj
├── TribesAscend.vcxproj.filters
├── Unreal.vcxproj
├── Unreal.vcxproj.filters
├── Unreal2.vcxproj
├── Unreal2.vcxproj.filters
├── UnrealEngineSDKGenerator.sln
├── UnrealTournament2004.vcxproj
├── UnrealTournament2004.vcxproj.filters
├── UnrealTournament3.vcxproj
├── UnrealTournament3.vcxproj.filters
├── UnrealTournament4.vcxproj
└── UnrealTournament4.vcxproj.filters
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
--------------------------------------------------------------------------------
/ARKSurvivalEvolved.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE4
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE4
38 |
39 |
40 | Engine\UE4
41 |
42 |
43 | Engine\UE4
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE4
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE4
83 |
84 |
85 | Engine\UE4
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/AllPointsBulletin.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE3
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE3
38 |
39 |
40 | Engine\UE3
41 |
42 |
43 | Engine\UE3
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE3
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE3
83 |
84 |
85 | Engine\UE3
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/AloneInTheDarkIllumination.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE4
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE4
38 |
39 |
40 | Engine\UE4
41 |
42 |
43 | Engine\UE4
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE4
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE4
83 |
84 |
85 | Engine\UE4
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Borderlands2.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE3
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE3
38 |
39 |
40 | Engine\UE3
41 |
42 |
43 | Engine\UE3
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE3
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE3
83 |
84 |
85 | Engine\UE3
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/CreateNewProject.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | echo copy from:
4 | set /p from=
5 | echo new name:
6 | set /p to=
7 |
8 | powershell -executionpolicy unrestricted ./CreateNewProject.ps1 %from% %to%
--------------------------------------------------------------------------------
/CreateNewProject.ps1:
--------------------------------------------------------------------------------
1 | Write-Host "Create $($args[1]) from $($args[0])"
2 |
3 | $source = @"
4 | using System.IO;
5 |
6 | namespace UnrealEngineSDKGenerator
7 | {
8 | public class Program
9 | {
10 | public static void Create(string oldname, string newname)
11 | {
12 | DirectoryInfo newdir = new DirectoryInfo(Path.Combine("./Target", newname));
13 | newdir.Create();
14 | CopyFilesRecursively(new DirectoryInfo(Path.Combine("./Target", oldname)), newdir);
15 |
16 | File.WriteAllText(newname + ".vcxproj", File.ReadAllText(oldname + ".vcxproj").Replace(oldname, newname));
17 | File.WriteAllText(newname + ".vcxproj.filters", File.ReadAllText(oldname + ".vcxproj.filters").Replace(oldname, newname));
18 | }
19 |
20 | public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target)
21 | {
22 | foreach (DirectoryInfo dir in source.GetDirectories())
23 | CopyFilesRecursively(dir, target.CreateSubdirectory(dir.Name));
24 | foreach (FileInfo file in source.GetFiles())
25 | file.CopyTo(Path.Combine(target.FullName, file.Name));
26 | }
27 | }
28 | }
29 | "@
30 |
31 | Add-Type -TypeDefinition $Source -Language CSharp
32 |
33 | [UnrealEngineSDKGenerator.Program]::Create($args[0], $args[1])
--------------------------------------------------------------------------------
/Engine/Logger.cpp:
--------------------------------------------------------------------------------
1 | #include "Logger.hpp"
2 |
3 | std::ostream* Logger::stream = nullptr;
4 |
5 | void Logger::SetStream(std::ostream* _stream)
6 | {
7 | stream = _stream;
8 | }
9 |
10 | void Logger::Log(const std::string& message)
11 | {
12 | if (stream != nullptr)
13 | {
14 | (*stream) << message << '\n' << std::flush;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Logger.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include "tinyformat.h"
8 |
9 | class Logger
10 | {
11 | public:
12 |
13 | ///
14 | /// Sets the stream where the output goes to.
15 | ///
16 | /// [in] The stream.
17 | static void SetStream(std::ostream* stream);
18 |
19 | ///
20 | /// Logs the given message.
21 | ///
22 | /// The message.
23 | static void Log(const std::string& message);
24 |
25 | ///
26 | /// Formats and logs the given message.
27 | ///
28 | /// Type of the arguments.
29 | /// Describes the format to use.
30 | /// Variable arguments providing the arguments.
31 | template
32 | static void Log(const char* fmt, const Args&... args)
33 | {
34 | Log(tfm::format(fmt, args...));
35 | }
36 |
37 | private:
38 | static std::ostream *stream;
39 | };
40 |
--------------------------------------------------------------------------------
/Engine/NameValidator.cpp:
--------------------------------------------------------------------------------
1 | #include "NameValidator.hpp"
2 |
3 | #include
4 |
5 | #include "ObjectsStore.hpp"
6 |
7 | std::string MakeValidName(std::string&& name)
8 | {
9 | std::string valid(name);
10 |
11 | for (auto i = 0u; i < name.length(); ++i)
12 | {
13 | if (valid[i] == ' '
14 | || valid[i] == '?'
15 | || valid[i] == '+'
16 | || valid[i] == '-'
17 | || valid[i] == ':'
18 | || valid[i] == '/'
19 | || valid[i] == '^'
20 | || valid[i] == '('
21 | || valid[i] == ')'
22 | || valid[i] == '['
23 | || valid[i] == ']'
24 | || valid[i] == '<'
25 | || valid[i] == '>'
26 | || valid[i] == '&'
27 | || valid[i] == '.'
28 | || valid[i] == '#'
29 | || valid[i] == '\''
30 | || valid[i] == '"'
31 | || valid[i] == '%')
32 | {
33 | valid[i] = '_';
34 | }
35 | }
36 |
37 | if (!valid.empty())
38 | {
39 | if (std::isdigit(valid[0]))
40 | {
41 | valid = '_' + valid;
42 | }
43 | }
44 |
45 | return valid;
46 | }
47 |
48 | std::string SimplifyEnumName(std::string&& name)
49 | {
50 | const auto index = name.find_last_of(':');
51 | if (index == std::string::npos)
52 | {
53 | return name;
54 | }
55 |
56 | return name.substr(index + 1);
57 | }
58 |
59 | template
60 | std::string MakeUniqueCppNameImpl(const T& t)
61 | {
62 | std::string name;
63 | if (ObjectsStore().CountObjects(t.GetName()) > 1)
64 | {
65 | name += MakeValidName(t.GetOuter().GetName()) + "_";
66 | }
67 | return name + MakeValidName(t.GetName());
68 | }
69 |
70 | std::string MakeUniqueCppName(const UEConst& c)
71 | {
72 | return MakeUniqueCppNameImpl(c);
73 | }
74 |
75 | std::string MakeUniqueCppName(const UEEnum& e)
76 | {
77 | auto name = MakeUniqueCppNameImpl(e);
78 | if (!name.empty() && name[0] != 'E')
79 | {
80 | name = 'E' + name;
81 | }
82 | return name;
83 | }
84 |
85 | std::string MakeUniqueCppName(const UEStruct& ss)
86 | {
87 | std::string name;
88 | if (ObjectsStore().CountObjects(ss.GetName()) > 1)
89 | {
90 | name += MakeValidName(ss.GetOuter().GetNameCPP()) + "_";
91 | }
92 | return name + MakeValidName(ss.GetNameCPP());
93 | }
94 |
--------------------------------------------------------------------------------
/Engine/NameValidator.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | class UEConst;
6 | class UEEnum;
7 | class UEStruct;
8 |
9 | ///
10 | /// Makes valid C++ name from the given name.
11 | ///
12 | /// The name to process.
13 | /// A valid C++ name.
14 | std::string MakeValidName(std::string&& name);
15 |
16 | std::string SimplifyEnumName(std::string&& name);
17 |
18 | std::string MakeUniqueCppName(const UEConst& c);
19 | std::string MakeUniqueCppName(const UEEnum& e);
20 | std::string MakeUniqueCppName(const UEStruct& ss);
21 |
--------------------------------------------------------------------------------
/Engine/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include "NamesStore.hpp"
2 |
3 | NamesIterator NamesStore::begin()
4 | {
5 | return NamesIterator(*this, 0);
6 | }
7 |
8 | NamesIterator NamesStore::begin() const
9 | {
10 | return NamesIterator(*this, 0);
11 | }
12 |
13 | NamesIterator NamesStore::end()
14 | {
15 | return NamesIterator(*this);
16 | }
17 |
18 | NamesIterator NamesStore::end() const
19 | {
20 | return NamesIterator(*this);
21 | }
22 |
23 | NamesIterator::NamesIterator(const NamesStore& _store)
24 | : store(_store),
25 | index(_store.GetNamesNum())
26 | {
27 | }
28 |
29 | NamesIterator::NamesIterator(const NamesStore& _store, size_t _index)
30 | : store(_store),
31 | index(_index)
32 | {
33 | }
34 |
35 | void NamesIterator::swap(NamesIterator& other) noexcept
36 | {
37 | std::swap(index, other.index);
38 | }
39 |
40 | NamesIterator& NamesIterator::operator++()
41 | {
42 | for (++index; index < store.GetNamesNum(); ++index)
43 | {
44 | if (store.IsValid(index))
45 | {
46 | break;
47 | }
48 | }
49 | return *this;
50 | }
51 |
52 | NamesIterator NamesIterator::operator++ (int)
53 | {
54 | auto tmp(*this);
55 | ++(*this);
56 | return tmp;
57 | }
58 |
59 | bool NamesIterator::operator==(const NamesIterator& rhs) const
60 | {
61 | return index == rhs.index;
62 | }
63 |
64 | bool NamesIterator::operator!=(const NamesIterator& rhs) const
65 | {
66 | return index != rhs.index;
67 | }
68 |
69 | UENameInfo NamesIterator::operator*() const
70 | {
71 | return { index, store.GetById(index) };
72 | }
73 |
74 | UENameInfo NamesIterator::operator->() const
75 | {
76 | return { index, store.GetById(index) };
77 | }
--------------------------------------------------------------------------------
/Engine/NamesStore.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "GenericTypes.hpp"
6 |
7 | class NamesIterator;
8 |
9 | class NamesStore
10 | {
11 | friend NamesIterator;
12 |
13 | public:
14 |
15 | ///
16 | /// Initializes this object.
17 | ///
18 | /// true if it succeeds, false if it fails.
19 | static bool Initialize();
20 |
21 | /// Gets the address of the global names store.
22 | /// The address of the global names store.
23 | static void* GetAddress();
24 |
25 | NamesIterator begin();
26 |
27 | NamesIterator begin() const;
28 |
29 | NamesIterator end();
30 |
31 | NamesIterator end() const;
32 |
33 | ///
34 | /// Gets the number of available names.
35 | ///
36 | /// The number of names.
37 | size_t GetNamesNum() const;
38 |
39 | ///
40 | /// Test if the given id is valid.
41 | ///
42 | /// The identifier.
43 | /// true if valid, false if not.
44 | bool IsValid(size_t id) const;
45 |
46 | ///
47 | /// Gets a name by id.
48 | ///
49 | /// The identifier.
50 | /// The name.
51 | std::string GetById(size_t id) const;
52 | };
53 |
54 | struct UENameInfo
55 | {
56 | size_t Index;
57 | std::string Name;
58 | };
59 |
60 | class NamesIterator : public std::iterator
61 | {
62 | const NamesStore& store;
63 | size_t index;
64 |
65 | public:
66 | NamesIterator(const NamesStore& store);
67 |
68 | explicit NamesIterator(const NamesStore& store, size_t index);
69 |
70 | void swap(NamesIterator& other) noexcept;
71 |
72 | NamesIterator& operator++();
73 |
74 | NamesIterator operator++ (int);
75 |
76 | bool operator==(const NamesIterator& rhs) const;
77 |
78 | bool operator!=(const NamesIterator& rhs) const;
79 |
80 | UENameInfo operator*() const;
81 |
82 | UENameInfo operator->() const;
83 | };
84 |
--------------------------------------------------------------------------------
/Engine/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include "ObjectsStore.hpp"
2 | #include
3 |
4 | ObjectsIterator ObjectsStore::begin()
5 | {
6 | return ObjectsIterator(*this, 0);
7 | }
8 |
9 | ObjectsIterator ObjectsStore::begin() const
10 | {
11 | return ObjectsIterator(*this, 0);
12 | }
13 |
14 | ObjectsIterator ObjectsStore::end()
15 | {
16 | return ObjectsIterator(*this);
17 | }
18 |
19 | ObjectsIterator ObjectsStore::end() const
20 | {
21 | return ObjectsIterator(*this);
22 | }
23 |
24 | UEClass ObjectsStore::FindClass(const std::string& name) const
25 | {
26 | for (auto obj : *this)
27 | {
28 | if (obj.GetFullName() == name)
29 | {
30 | return obj.Cast();
31 | }
32 | }
33 | return UEClass(nullptr);
34 | }
35 |
36 | ObjectsIterator::ObjectsIterator(const ObjectsStore& _store)
37 | : store(_store),
38 | index(_store.GetObjectsNum())
39 | {
40 | }
41 |
42 | ObjectsIterator::ObjectsIterator(const ObjectsStore& _store, size_t _index)
43 | : store(_store),
44 | index(_index),
45 | current(_store.GetById(_index))
46 | {
47 | }
48 |
49 | ObjectsIterator::ObjectsIterator(const ObjectsIterator& other)
50 | : store(other.store),
51 | index(other.index),
52 | current(other.current)
53 | {
54 | }
55 |
56 | ObjectsIterator::ObjectsIterator(ObjectsIterator&& other) noexcept
57 | : store(other.store),
58 | index(other.index),
59 | current(other.current)
60 | {
61 | }
62 |
63 | ObjectsIterator& ObjectsIterator::operator=(const ObjectsIterator& rhs)
64 | {
65 | index = rhs.index;
66 | current = rhs.current;
67 | return *this;
68 | }
69 |
70 | void ObjectsIterator::swap(ObjectsIterator& other) noexcept
71 | {
72 | std::swap(index, other.index);
73 | std::swap(current, other.current);
74 | }
75 |
76 | ObjectsIterator& ObjectsIterator::operator++()
77 | {
78 | for (++index; index < store.GetObjectsNum(); ++index)
79 | {
80 | current = store.GetById(index);
81 | if (current.IsValid())
82 | {
83 | break;
84 | }
85 | }
86 | return *this;
87 | }
88 |
89 | ObjectsIterator ObjectsIterator::operator++(int)
90 | {
91 | auto tmp(*this);
92 | ++(*this);
93 | return tmp;
94 | }
95 |
96 | bool ObjectsIterator::operator==(const ObjectsIterator& rhs) const
97 | {
98 | return index == rhs.index;
99 | }
100 |
101 | bool ObjectsIterator::operator!=(const ObjectsIterator& rhs) const
102 | {
103 | return index != rhs.index;
104 | }
105 |
106 | UEObject ObjectsIterator::operator*() const
107 | {
108 | assert(current.IsValid() && "ObjectsIterator::current is not valid!");
109 |
110 | return current;
111 | }
112 |
113 | UEObject ObjectsIterator::operator->() const
114 | {
115 | return operator*();
116 | }
--------------------------------------------------------------------------------
/Engine/ObjectsStore.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "GenericTypes.hpp"
6 |
7 | class ObjectsIterator;
8 |
9 | class ObjectsStore
10 | {
11 | public:
12 |
13 | ///
14 | /// Initializes this object.
15 | ///
16 | ///
17 | /// true if it succeeds, false if it fails.
18 | ///
19 | static bool Initialize();
20 |
21 | /// Gets the address of the global objects store.
22 | /// The address of the global objects store.
23 | static void* GetAddress();
24 |
25 | ObjectsIterator begin();
26 |
27 | ObjectsIterator begin() const;
28 |
29 | ObjectsIterator end();
30 |
31 | ObjectsIterator end() const;
32 |
33 | ///
34 | /// Gets the number of available objects.
35 | ///
36 | /// The number of objects.
37 | size_t GetObjectsNum() const;
38 |
39 | ///
40 | /// Gets the object by id.
41 | ///
42 | /// The identifier.
43 | /// The object.
44 | UEObject GetById(size_t id) const;
45 |
46 | ///
47 | /// Searches for the first class with the given name.
48 | ///
49 | /// The name of the class.
50 | /// The found class which is not valid if no class could be found.
51 | UEClass FindClass(const std::string& name) const;
52 |
53 | /// Count objects which have the same name and type.
54 | /// Type of the object.
55 | /// The name to search for.
56 | /// The number of objects which share a name.
57 | template
58 | size_t CountObjects(const std::string& name) const
59 | {
60 | static std::unordered_map cache;
61 |
62 | auto it = cache.find(name);
63 | if (it != std::end(cache))
64 | {
65 | return it->second;
66 | }
67 |
68 | size_t count = 0;
69 | for (auto obj : *this)
70 | {
71 | if (obj.IsA() && obj.GetName() == name)
72 | {
73 | ++count;
74 | }
75 | }
76 |
77 | cache[name] = count;
78 |
79 | return count;
80 | }
81 | };
82 |
83 | /// Holds information about an object.
84 | struct UEObjectInfo
85 | {
86 | /// Zero-based index of the object in the global objects store.
87 | size_t Index;
88 |
89 | /// The object.
90 | UEObject Object;
91 | };
92 |
93 | /// An iterator for objects.
94 | class ObjectsIterator : public std::iterator
95 | {
96 | const ObjectsStore& store;
97 | size_t index;
98 | UEObject current;
99 |
100 | public:
101 |
102 | /// Constructor.
103 | /// The store to iterate.
104 | ObjectsIterator(const ObjectsStore& store);
105 |
106 | /// Constructor.
107 | /// The store to iterate.
108 | /// Zero-based start index.
109 | explicit ObjectsIterator(const ObjectsStore& store, size_t index);
110 |
111 | ObjectsIterator(const ObjectsIterator& other);
112 | ObjectsIterator(ObjectsIterator&& other) noexcept;
113 |
114 | ObjectsIterator& operator=(const ObjectsIterator& rhs);
115 |
116 | void swap(ObjectsIterator& other) noexcept;
117 |
118 | ObjectsIterator& operator++();
119 |
120 | ObjectsIterator operator++ (int);
121 |
122 | bool operator==(const ObjectsIterator& rhs) const;
123 |
124 | bool operator!=(const ObjectsIterator& rhs) const;
125 |
126 | UEObject operator*() const;
127 |
128 | UEObject operator->() const;
129 | };
130 |
--------------------------------------------------------------------------------
/Engine/PatternFinder.cpp:
--------------------------------------------------------------------------------
1 | #include "PatternFinder.hpp"
2 |
3 | #include
4 | #include
5 |
6 | uintptr_t FindPattern(HMODULE module, const unsigned char* pattern, const char* mask)
7 | {
8 | MODULEINFO info = { };
9 | GetModuleInformation(GetCurrentProcess(), module, &info, sizeof(MODULEINFO));
10 |
11 | return FindPattern(reinterpret_cast(module), info.SizeOfImage, pattern, mask);
12 | }
13 |
14 | uintptr_t FindPattern(uintptr_t start, size_t length, const unsigned char* pattern, const char* mask)
15 | {
16 | size_t pos = 0;
17 | auto maskLength = std::strlen(mask) - 1;
18 |
19 | auto startAdress = start;
20 | for (auto it = startAdress; it < startAdress + length; ++it)
21 | {
22 | if (*reinterpret_cast(it) == pattern[pos] || mask[pos] == '?')
23 | {
24 | if (mask[pos + 1] == '\0')
25 | {
26 | return it - maskLength;
27 | }
28 |
29 | pos++;
30 | }
31 | else
32 | {
33 | pos = 0;
34 | }
35 | }
36 |
37 | return -1;
38 | }
39 |
--------------------------------------------------------------------------------
/Engine/PatternFinder.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | ///
7 | /// Searches for the first pattern in the module.
8 | ///
9 | /// The module to scan.
10 | /// The pattern (Example: "\x12\xAB\x34")
11 | /// The mask (Example: "x?x")
12 | /// The address of the found pattern or -1 if the pattern was not found.
13 | uintptr_t FindPattern(HMODULE module, const unsigned char* pattern, const char* mask);
14 |
15 | ///
16 | /// Searches for the first pattern in the memory region.
17 | ///
18 | /// The start address of the memory region to scan.
19 | /// The length of the memory region.
20 | /// The pattern (Example: "\x12\xAB\x34")
21 | /// The mask (Example: "x?x")
22 | /// The address of the found pattern or -1 if the pattern was not found.
23 | uintptr_t FindPattern(uintptr_t start, size_t length, const unsigned char* pattern, const char* mask);
24 |
--------------------------------------------------------------------------------
/Engine/PrintHelper.cpp:
--------------------------------------------------------------------------------
1 | #include "PrintHelper.hpp"
2 |
3 | #include
4 |
5 | #include "IGenerator.hpp"
6 | #include "Package.hpp"
7 |
8 | void PrintFileHeader(std::ostream& os, const std::vector& includes, bool isHeaderFile)
9 | {
10 | extern IGenerator* generator;
11 |
12 | if (isHeaderFile)
13 | {
14 | os << "#pragma once\n\n";
15 | }
16 |
17 | os << tfm::format("// %s (%s) SDK\n\n", generator->GetGameName(), generator->GetGameVersion())
18 | << tfm::format("#ifdef _MSC_VER\n\t#pragma pack(push, 0x%X)\n#endif\n\n", generator->GetGlobalMemberAlignment());
19 |
20 | if (!includes.empty())
21 | {
22 | for (auto&& i : includes) { os << "#include " << i << "\n"; }
23 | os << "\n";
24 | }
25 |
26 | if (!generator->GetNamespaceName().empty())
27 | {
28 | os << "namespace " << generator->GetNamespaceName() << "\n{\n";
29 | }
30 | }
31 |
32 | void PrintFileHeader(std::ostream& os, bool isHeaderFile)
33 | {
34 | extern IGenerator* generator;
35 |
36 | PrintFileHeader(os, std::vector(), isHeaderFile);
37 | }
38 |
39 | void PrintFileFooter(std::ostream& os)
40 | {
41 | extern IGenerator* generator;
42 |
43 | if (!generator->GetNamespaceName().empty())
44 | {
45 | os << "}\n\n";
46 | }
47 |
48 | os << "#ifdef _MSC_VER\n\t#pragma pack(pop)\n#endif\n";
49 | }
50 |
51 | void PrintSectionHeader(std::ostream& os, const char* name)
52 | {
53 | os << "//---------------------------------------------------------------------------\n"
54 | << "//" << name << "\n"
55 | << "//---------------------------------------------------------------------------\n\n";
56 | }
57 |
58 | std::string GenerateFileName(FileContentType type, const Package& package)
59 | {
60 | extern IGenerator* generator;
61 |
62 | const char* name;
63 | switch (type)
64 | {
65 | case FileContentType::Structs:
66 | name = "%s_%s_structs.hpp";
67 | break;
68 | case FileContentType::Classes:
69 | name = "%s_%s_classes.hpp";
70 | break;
71 | case FileContentType::Functions:
72 | name = "%s_%s_functions.cpp";
73 | break;
74 | case FileContentType::FunctionParameters:
75 | name = "%s_%s_parameters.hpp";
76 | break;
77 | default:
78 | assert(false);
79 | }
80 |
81 | return tfm::format(name, generator->GetGameNameShort(), package.GetName());
82 | }
83 |
--------------------------------------------------------------------------------
/Engine/PrintHelper.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | void PrintFileHeader(std::ostream& os, const std::vector& includes, bool isHeaderFile);
7 |
8 | void PrintFileHeader(std::ostream& os, bool isHeaderFile);
9 |
10 | void PrintFileFooter(std::ostream& os);
11 |
12 | void PrintSectionHeader(std::ostream& os, const char* name);
13 |
14 | enum class FileContentType
15 | {
16 | Structs,
17 | Classes,
18 | Functions,
19 | FunctionParameters
20 | };
21 |
22 | ///
23 | /// Generates a file name composed by the game name and the package object.
24 | ///
25 | /// The type of the file.
26 | ///
27 | /// The generated file name.
28 | ///
29 | std::string GenerateFileName(FileContentType type, const class Package& package);
30 |
--------------------------------------------------------------------------------
/Engine/UE1/FunctionFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "FunctionFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEFunctionFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEFunctionFlags::Final) { buffer.push_back("Final"); }
12 | if (flags & UEFunctionFlags::Defined) { buffer.push_back("Defined"); }
13 | if (flags & UEFunctionFlags::Iterator) { buffer.push_back("Iterator"); }
14 | if (flags & UEFunctionFlags::Latent) { buffer.push_back("Latent"); }
15 | if (flags & UEFunctionFlags::PreOperator) { buffer.push_back("PreOperator"); }
16 | if (flags & UEFunctionFlags::Singular) { buffer.push_back("Singular"); }
17 | if (flags & UEFunctionFlags::Net) { buffer.push_back("Net"); }
18 | if (flags & UEFunctionFlags::NetReliable) { buffer.push_back("NetReliable"); }
19 | if (flags & UEFunctionFlags::Simulated) { buffer.push_back("Simulated"); }
20 | if (flags & UEFunctionFlags::Exec) { buffer.push_back("Exec"); }
21 | if (flags & UEFunctionFlags::Native) { buffer.push_back("Native"); }
22 | if (flags & UEFunctionFlags::Event) { buffer.push_back("Event"); }
23 | if (flags & UEFunctionFlags::Operator) { buffer.push_back("Operator"); }
24 | if (flags & UEFunctionFlags::Static) { buffer.push_back("Static"); }
25 | if (flags & UEFunctionFlags::HasOptionalParms) { buffer.push_back("HasOptionalParms"); }
26 | if (flags & UEFunctionFlags::Const) { buffer.push_back("Const"); }
27 | if (flags & UEFunctionFlags::Public) { buffer.push_back("Public"); }
28 | if (flags & UEFunctionFlags::Private) { buffer.push_back("Private"); }
29 | if (flags & UEFunctionFlags::Protected) { buffer.push_back("Protected"); }
30 | if (flags & UEFunctionFlags::Delegate) { buffer.push_back("Delegate"); }
31 | if (flags & UEFunctionFlags::NetServer) { buffer.push_back("NetServer"); }
32 | if (flags & UEFunctionFlags::HasOutParms) { buffer.push_back("HasOutParms"); }
33 | if (flags & UEFunctionFlags::HasDefaults) { buffer.push_back("HasDefaults"); }
34 | if (flags & UEFunctionFlags::NetClient) { buffer.push_back("NetClient"); }
35 | if (flags & UEFunctionFlags::DLLImport) { buffer.push_back("DLLImport"); }
36 | if (flags & UEFunctionFlags::K2Call) { buffer.push_back("K2Call"); }
37 | if (flags & UEFunctionFlags::K2Override) { buffer.push_back("K2Override"); }
38 | if (flags & UEFunctionFlags::K2Pure) { buffer.push_back("K2Pure"); }
39 |
40 | switch (buffer.size())
41 | {
42 | case 0:
43 | return std::string();
44 | case 1:
45 | return std::string(buffer[0]);
46 | default:
47 | std::ostringstream os;
48 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
49 | os << *buffer.rbegin();
50 | return os.str();
51 | }
52 | }
--------------------------------------------------------------------------------
/Engine/UE1/FunctionFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEFunctionFlags : uint32_t
7 | {
8 | Final = 0x00000001,
9 | Defined = 0x00000002,
10 | Iterator = 0x00000004,
11 | Latent = 0x00000008,
12 | PreOperator = 0x00000010,
13 | Singular = 0x00000020,
14 | Net = 0x00000040,
15 | NetReliable = 0x00000080,
16 | Simulated = 0x00000100,
17 | Exec = 0x00000200,
18 | Native = 0x00000400,
19 | Event = 0x00000800,
20 | Operator = 0x00001000,
21 | Static = 0x00002000,
22 | HasOptionalParms = 0x00004000,
23 | Const = 0x00008000,
24 | Public = 0x00020000,
25 | Private = 0x00040000,
26 | Protected = 0x00080000,
27 | Delegate = 0x00100000,
28 | NetServer = 0x00200000,
29 | HasOutParms = 0x00400000,
30 | HasDefaults = 0x00800000,
31 | NetClient = 0x01000000,
32 | DLLImport = 0x02000000,
33 | K2Call = 0x04000000,
34 | K2Override = 0x08000000,
35 | K2Pure = 0x10000000
36 | };
37 |
38 | inline bool operator&(UEFunctionFlags lhs, UEFunctionFlags rhs)
39 | {
40 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
41 | }
42 |
43 | std::string StringifyFlags(const UEFunctionFlags flags);
44 |
--------------------------------------------------------------------------------
/Engine/UE1/Package.cpp:
--------------------------------------------------------------------------------
1 | #include "../Package.hpp"
2 |
3 | bool Package::Method::Parameter::MakeType(UEPropertyFlags flags, Type& type)
4 | {
5 | if (flags & UEPropertyFlags::ReturnParm)
6 | {
7 | type = Type::Return;
8 | }
9 | else if (flags & UEPropertyFlags::OutParm)
10 | {
11 | type = Type::Out;
12 | }
13 | else if (flags & UEPropertyFlags::Parm)
14 | {
15 | type = Type::Default;
16 | }
17 | else
18 | {
19 | return false;
20 | }
21 |
22 | return true;
23 | }
--------------------------------------------------------------------------------
/Engine/UE1/PropertyFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "PropertyFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEPropertyFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEPropertyFlags::Edit) { buffer.push_back("Edit"); }
12 | if (flags & UEPropertyFlags::Const) { buffer.push_back("Const"); }
13 | if (flags & UEPropertyFlags::Input) { buffer.push_back("Input"); }
14 | if (flags & UEPropertyFlags::ExportObject) { buffer.push_back("ExportObject"); }
15 | if (flags & UEPropertyFlags::OptionalParm) { buffer.push_back("OptionalParm"); }
16 | if (flags & UEPropertyFlags::Net) { buffer.push_back("Net"); }
17 | if (flags & UEPropertyFlags::EditFixedSize) { buffer.push_back("EditFixedSize"); }
18 | if (flags & UEPropertyFlags::Parm) { buffer.push_back("Parm"); }
19 | if (flags & UEPropertyFlags::OutParm) { buffer.push_back("OutParm"); }
20 | if (flags & UEPropertyFlags::SkipParm) { buffer.push_back("SkipParm"); }
21 | if (flags & UEPropertyFlags::ReturnParm) { buffer.push_back("ReturnParm"); }
22 | if (flags & UEPropertyFlags::CoerceParm) { buffer.push_back("CoerceParm"); }
23 | if (flags & UEPropertyFlags::Native) { buffer.push_back("Native"); }
24 | if (flags & UEPropertyFlags::Transient) { buffer.push_back("Transient"); }
25 | if (flags & UEPropertyFlags::Config) { buffer.push_back("Config"); }
26 | if (flags & UEPropertyFlags::Localized) { buffer.push_back("Localized"); }
27 | if (flags & UEPropertyFlags::EditConst) { buffer.push_back("EditConst"); }
28 | if (flags & UEPropertyFlags::GlobalConfig) { buffer.push_back("GlobalConfig"); }
29 | if (flags & UEPropertyFlags::Component) { buffer.push_back("Component"); }
30 | if (flags & UEPropertyFlags::AlwaysInit) { buffer.push_back("AlwaysInit"); }
31 | if (flags & UEPropertyFlags::DuplicateTransient) { buffer.push_back("DuplicateTransient"); }
32 | if (flags & UEPropertyFlags::NeedCtorLink) { buffer.push_back("NeedCtorLink"); }
33 | if (flags & UEPropertyFlags::NoExport) { buffer.push_back("NoExport"); }
34 | if (flags & UEPropertyFlags::NoImport) { buffer.push_back("NoImport"); }
35 | if (flags & UEPropertyFlags::NoClear) { buffer.push_back("NoClear"); }
36 | if (flags & UEPropertyFlags::EditInline) { buffer.push_back("EditInline"); }
37 | if (flags & UEPropertyFlags::EditInlineUse) { buffer.push_back("EditInlineUse"); }
38 | if (flags & UEPropertyFlags::Deprecated) { buffer.push_back("Deprecated"); }
39 | if (flags & UEPropertyFlags::DataBinding) { buffer.push_back("DataBinding"); }
40 | if (flags & UEPropertyFlags::SerializeText) { buffer.push_back("SerializeText"); }
41 | if (flags & UEPropertyFlags::RepNotify) { buffer.push_back("RepNotify"); }
42 | if (flags & UEPropertyFlags::Interp) { buffer.push_back("Interp"); }
43 | if (flags & UEPropertyFlags::NonTransactional) { buffer.push_back("NonTransactional"); }
44 | if (flags & UEPropertyFlags::EditorOnly) { buffer.push_back("EditorOnly"); }
45 | if (flags & UEPropertyFlags::NotForConsole) { buffer.push_back("NotForConsole"); }
46 | if (flags & UEPropertyFlags::RepRetry) { buffer.push_back("RepRetry"); }
47 | if (flags & UEPropertyFlags::PrivateWrite) { buffer.push_back("PrivateWrite"); }
48 | if (flags & UEPropertyFlags::ProtectedWrite) { buffer.push_back("ProtectedWrite"); }
49 | if (flags & UEPropertyFlags::ArchetypeProperty) { buffer.push_back("ArchetypeProperty"); }
50 | if (flags & UEPropertyFlags::EditHide) { buffer.push_back("EditHide"); }
51 | if (flags & UEPropertyFlags::EditTextBox) { buffer.push_back("EditTextBox"); }
52 | if (flags & UEPropertyFlags::CrossLevelPassive) { buffer.push_back("CrossLevelPassive"); }
53 | if (flags & UEPropertyFlags::CrossLevelActive) { buffer.push_back("CrossLevelActive"); }
54 |
55 | switch (buffer.size())
56 | {
57 | case 0:
58 | return std::string();
59 | case 1:
60 | return std::string(buffer[0]);
61 | default:
62 | std::ostringstream os;
63 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
64 | os << *buffer.rbegin();
65 | return os.str();
66 | }
67 | }
--------------------------------------------------------------------------------
/Engine/UE1/PropertyFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEPropertyFlags : uint64_t
7 | {
8 | Edit = 0x0000000000000001,
9 | Const = 0x0000000000000002,
10 | Input = 0x0000000000000004,
11 | ExportObject = 0x0000000000000008,
12 | OptionalParm = 0x0000000000000010,
13 | Net = 0x0000000000000020,
14 | EditFixedSize = 0x0000000000000040,
15 | Parm = 0x0000000000000080,
16 | OutParm = 0x0000000000000100,
17 | SkipParm = 0x0000000000000200,
18 | ReturnParm = 0x0000000000000400,
19 | CoerceParm = 0x0000000000000800,
20 | Native = 0x0000000000001000,
21 | Transient = 0x0000000000002000,
22 | Config = 0x0000000000004000,
23 | Localized = 0x0000000000008000,
24 | EditConst = 0x0000000000020000,
25 | GlobalConfig = 0x0000000000040000,
26 | Component = 0x0000000000080000,
27 | AlwaysInit = 0x0000000000100000,
28 | DuplicateTransient = 0x0000000000200000,
29 | NeedCtorLink = 0x0000000000400000,
30 | NoExport = 0x0000000000800000,
31 | NoImport = 0x0000000001000000,
32 | NoClear = 0x0000000002000000,
33 | EditInline = 0x0000000004000000,
34 | EditInlineUse = 0x0000000010000000,
35 | Deprecated = 0x0000000020000000,
36 | DataBinding = 0x0000000040000000,
37 | SerializeText = 0x0000000080000000,
38 | RepNotify = 0x0000000100000000,
39 | Interp = 0x0000000200000000,
40 | NonTransactional = 0x0000000400000000,
41 | EditorOnly = 0x0000000800000000,
42 | NotForConsole = 0x0000001000000000,
43 | RepRetry = 0x0000002000000000,
44 | PrivateWrite = 0x0000004000000000,
45 | ProtectedWrite = 0x0000008000000000,
46 | ArchetypeProperty = 0x0000010000000000,
47 | EditHide = 0x0000020000000000,
48 | EditTextBox = 0x0000040000000000,
49 | CrossLevelPassive = 0x0000100000000000,
50 | CrossLevelActive = 0x0000200000000000
51 | };
52 |
53 | inline bool operator&(UEPropertyFlags lhs, UEPropertyFlags rhs)
54 | {
55 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
56 | }
57 |
58 | std::string StringifyFlags(const UEPropertyFlags flags);
--------------------------------------------------------------------------------
/Engine/UE2/FunctionFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "FunctionFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEFunctionFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEFunctionFlags::Final) { buffer.push_back("Final"); }
12 | if (flags & UEFunctionFlags::Defined) { buffer.push_back("Defined"); }
13 | if (flags & UEFunctionFlags::Iterator) { buffer.push_back("Iterator"); }
14 | if (flags & UEFunctionFlags::Latent) { buffer.push_back("Latent"); }
15 | if (flags & UEFunctionFlags::PreOperator) { buffer.push_back("PreOperator"); }
16 | if (flags & UEFunctionFlags::Singular) { buffer.push_back("Singular"); }
17 | if (flags & UEFunctionFlags::Net) { buffer.push_back("Net"); }
18 | if (flags & UEFunctionFlags::NetReliable) { buffer.push_back("NetReliable"); }
19 | if (flags & UEFunctionFlags::Simulated) { buffer.push_back("Simulated"); }
20 | if (flags & UEFunctionFlags::Exec) { buffer.push_back("Exec"); }
21 | if (flags & UEFunctionFlags::Native) { buffer.push_back("Native"); }
22 | if (flags & UEFunctionFlags::Event) { buffer.push_back("Event"); }
23 | if (flags & UEFunctionFlags::Operator) { buffer.push_back("Operator"); }
24 | if (flags & UEFunctionFlags::Static) { buffer.push_back("Static"); }
25 | if (flags & UEFunctionFlags::HasOptionalParms) { buffer.push_back("HasOptionalParms"); }
26 | if (flags & UEFunctionFlags::Const) { buffer.push_back("Const"); }
27 | if (flags & UEFunctionFlags::Public) { buffer.push_back("Public"); }
28 | if (flags & UEFunctionFlags::Private) { buffer.push_back("Private"); }
29 | if (flags & UEFunctionFlags::Protected) { buffer.push_back("Protected"); }
30 | if (flags & UEFunctionFlags::Delegate) { buffer.push_back("Delegate"); }
31 | if (flags & UEFunctionFlags::NetServer) { buffer.push_back("NetServer"); }
32 | if (flags & UEFunctionFlags::HasOutParms) { buffer.push_back("HasOutParms"); }
33 | if (flags & UEFunctionFlags::HasDefaults) { buffer.push_back("HasDefaults"); }
34 | if (flags & UEFunctionFlags::NetClient) { buffer.push_back("NetClient"); }
35 | if (flags & UEFunctionFlags::DLLImport) { buffer.push_back("DLLImport"); }
36 | if (flags & UEFunctionFlags::K2Call) { buffer.push_back("K2Call"); }
37 | if (flags & UEFunctionFlags::K2Override) { buffer.push_back("K2Override"); }
38 | if (flags & UEFunctionFlags::K2Pure) { buffer.push_back("K2Pure"); }
39 |
40 | switch (buffer.size())
41 | {
42 | case 0:
43 | return std::string();
44 | case 1:
45 | return std::string(buffer[0]);
46 | default:
47 | std::ostringstream os;
48 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
49 | os << *buffer.rbegin();
50 | return os.str();
51 | }
52 | }
--------------------------------------------------------------------------------
/Engine/UE2/FunctionFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEFunctionFlags : uint32_t
7 | {
8 | Final = 0x00000001,
9 | Defined = 0x00000002,
10 | Iterator = 0x00000004,
11 | Latent = 0x00000008,
12 | PreOperator = 0x00000010,
13 | Singular = 0x00000020,
14 | Net = 0x00000040,
15 | NetReliable = 0x00000080,
16 | Simulated = 0x00000100,
17 | Exec = 0x00000200,
18 | Native = 0x00000400,
19 | Event = 0x00000800,
20 | Operator = 0x00001000,
21 | Static = 0x00002000,
22 | HasOptionalParms = 0x00004000,
23 | Const = 0x00008000,
24 | Public = 0x00020000,
25 | Private = 0x00040000,
26 | Protected = 0x00080000,
27 | Delegate = 0x00100000,
28 | NetServer = 0x00200000,
29 | HasOutParms = 0x00400000,
30 | HasDefaults = 0x00800000,
31 | NetClient = 0x01000000,
32 | DLLImport = 0x02000000,
33 | K2Call = 0x04000000,
34 | K2Override = 0x08000000,
35 | K2Pure = 0x10000000
36 | };
37 |
38 | inline bool operator&(UEFunctionFlags lhs, UEFunctionFlags rhs)
39 | {
40 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
41 | }
42 |
43 | std::string StringifyFlags(const UEFunctionFlags flags);
44 |
--------------------------------------------------------------------------------
/Engine/UE2/Package.cpp:
--------------------------------------------------------------------------------
1 | #include "../Package.hpp"
2 |
3 | bool Package::Method::Parameter::MakeType(UEPropertyFlags flags, Type& type)
4 | {
5 | if (flags & UEPropertyFlags::ReturnParm)
6 | {
7 | type = Type::Return;
8 | }
9 | else if (flags & UEPropertyFlags::OutParm)
10 | {
11 | type = Type::Out;
12 | }
13 | else if (flags & UEPropertyFlags::Parm)
14 | {
15 | type = Type::Default;
16 | }
17 | else
18 | {
19 | return false;
20 | }
21 |
22 | return true;
23 | }
--------------------------------------------------------------------------------
/Engine/UE2/PropertyFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "PropertyFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEPropertyFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEPropertyFlags::Edit) { buffer.push_back("Edit"); }
12 | if (flags & UEPropertyFlags::Const) { buffer.push_back("Const"); }
13 | if (flags & UEPropertyFlags::Input) { buffer.push_back("Input"); }
14 | if (flags & UEPropertyFlags::ExportObject) { buffer.push_back("ExportObject"); }
15 | if (flags & UEPropertyFlags::OptionalParm) { buffer.push_back("OptionalParm"); }
16 | if (flags & UEPropertyFlags::Net) { buffer.push_back("Net"); }
17 | if (flags & UEPropertyFlags::EditFixedSize) { buffer.push_back("EditFixedSize"); }
18 | if (flags & UEPropertyFlags::Parm) { buffer.push_back("Parm"); }
19 | if (flags & UEPropertyFlags::OutParm) { buffer.push_back("OutParm"); }
20 | if (flags & UEPropertyFlags::SkipParm) { buffer.push_back("SkipParm"); }
21 | if (flags & UEPropertyFlags::ReturnParm) { buffer.push_back("ReturnParm"); }
22 | if (flags & UEPropertyFlags::CoerceParm) { buffer.push_back("CoerceParm"); }
23 | if (flags & UEPropertyFlags::Native) { buffer.push_back("Native"); }
24 | if (flags & UEPropertyFlags::Transient) { buffer.push_back("Transient"); }
25 | if (flags & UEPropertyFlags::Config) { buffer.push_back("Config"); }
26 | if (flags & UEPropertyFlags::Localized) { buffer.push_back("Localized"); }
27 | if (flags & UEPropertyFlags::EditConst) { buffer.push_back("EditConst"); }
28 | if (flags & UEPropertyFlags::GlobalConfig) { buffer.push_back("GlobalConfig"); }
29 | if (flags & UEPropertyFlags::Component) { buffer.push_back("Component"); }
30 | if (flags & UEPropertyFlags::AlwaysInit) { buffer.push_back("AlwaysInit"); }
31 | if (flags & UEPropertyFlags::DuplicateTransient) { buffer.push_back("DuplicateTransient"); }
32 | if (flags & UEPropertyFlags::NeedCtorLink) { buffer.push_back("NeedCtorLink"); }
33 | if (flags & UEPropertyFlags::NoExport) { buffer.push_back("NoExport"); }
34 | if (flags & UEPropertyFlags::NoImport) { buffer.push_back("NoImport"); }
35 | if (flags & UEPropertyFlags::NoClear) { buffer.push_back("NoClear"); }
36 | if (flags & UEPropertyFlags::EditInline) { buffer.push_back("EditInline"); }
37 | if (flags & UEPropertyFlags::EditInlineUse) { buffer.push_back("EditInlineUse"); }
38 | if (flags & UEPropertyFlags::Deprecated) { buffer.push_back("Deprecated"); }
39 | if (flags & UEPropertyFlags::DataBinding) { buffer.push_back("DataBinding"); }
40 | if (flags & UEPropertyFlags::SerializeText) { buffer.push_back("SerializeText"); }
41 | if (flags & UEPropertyFlags::RepNotify) { buffer.push_back("RepNotify"); }
42 | if (flags & UEPropertyFlags::Interp) { buffer.push_back("Interp"); }
43 | if (flags & UEPropertyFlags::NonTransactional) { buffer.push_back("NonTransactional"); }
44 | if (flags & UEPropertyFlags::EditorOnly) { buffer.push_back("EditorOnly"); }
45 | if (flags & UEPropertyFlags::NotForConsole) { buffer.push_back("NotForConsole"); }
46 | if (flags & UEPropertyFlags::RepRetry) { buffer.push_back("RepRetry"); }
47 | if (flags & UEPropertyFlags::PrivateWrite) { buffer.push_back("PrivateWrite"); }
48 | if (flags & UEPropertyFlags::ProtectedWrite) { buffer.push_back("ProtectedWrite"); }
49 | if (flags & UEPropertyFlags::ArchetypeProperty) { buffer.push_back("ArchetypeProperty"); }
50 | if (flags & UEPropertyFlags::EditHide) { buffer.push_back("EditHide"); }
51 | if (flags & UEPropertyFlags::EditTextBox) { buffer.push_back("EditTextBox"); }
52 | if (flags & UEPropertyFlags::CrossLevelPassive) { buffer.push_back("CrossLevelPassive"); }
53 | if (flags & UEPropertyFlags::CrossLevelActive) { buffer.push_back("CrossLevelActive"); }
54 |
55 | switch (buffer.size())
56 | {
57 | case 0:
58 | return std::string();
59 | case 1:
60 | return std::string(buffer[0]);
61 | default:
62 | std::ostringstream os;
63 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
64 | os << *buffer.rbegin();
65 | return os.str();
66 | }
67 | }
--------------------------------------------------------------------------------
/Engine/UE2/PropertyFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEPropertyFlags : uint64_t
7 | {
8 | Edit = 0x0000000000000001,
9 | Const = 0x0000000000000002,
10 | Input = 0x0000000000000004,
11 | ExportObject = 0x0000000000000008,
12 | OptionalParm = 0x0000000000000010,
13 | Net = 0x0000000000000020,
14 | EditFixedSize = 0x0000000000000040,
15 | Parm = 0x0000000000000080,
16 | OutParm = 0x0000000000000100,
17 | SkipParm = 0x0000000000000200,
18 | ReturnParm = 0x0000000000000400,
19 | CoerceParm = 0x0000000000000800,
20 | Native = 0x0000000000001000,
21 | Transient = 0x0000000000002000,
22 | Config = 0x0000000000004000,
23 | Localized = 0x0000000000008000,
24 | EditConst = 0x0000000000020000,
25 | GlobalConfig = 0x0000000000040000,
26 | Component = 0x0000000000080000,
27 | AlwaysInit = 0x0000000000100000,
28 | DuplicateTransient = 0x0000000000200000,
29 | NeedCtorLink = 0x0000000000400000,
30 | NoExport = 0x0000000000800000,
31 | NoImport = 0x0000000001000000,
32 | NoClear = 0x0000000002000000,
33 | EditInline = 0x0000000004000000,
34 | EditInlineUse = 0x0000000010000000,
35 | Deprecated = 0x0000000020000000,
36 | DataBinding = 0x0000000040000000,
37 | SerializeText = 0x0000000080000000,
38 | RepNotify = 0x0000000100000000,
39 | Interp = 0x0000000200000000,
40 | NonTransactional = 0x0000000400000000,
41 | EditorOnly = 0x0000000800000000,
42 | NotForConsole = 0x0000001000000000,
43 | RepRetry = 0x0000002000000000,
44 | PrivateWrite = 0x0000004000000000,
45 | ProtectedWrite = 0x0000008000000000,
46 | ArchetypeProperty = 0x0000010000000000,
47 | EditHide = 0x0000020000000000,
48 | EditTextBox = 0x0000040000000000,
49 | CrossLevelPassive = 0x0000100000000000,
50 | CrossLevelActive = 0x0000200000000000
51 | };
52 |
53 | inline bool operator&(UEPropertyFlags lhs, UEPropertyFlags rhs)
54 | {
55 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
56 | }
57 |
58 | std::string StringifyFlags(const UEPropertyFlags flags);
--------------------------------------------------------------------------------
/Engine/UE3/FunctionFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "FunctionFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEFunctionFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEFunctionFlags::Final) { buffer.push_back("Final"); }
12 | if (flags & UEFunctionFlags::Defined) { buffer.push_back("Defined"); }
13 | if (flags & UEFunctionFlags::Iterator) { buffer.push_back("Iterator"); }
14 | if (flags & UEFunctionFlags::Latent) { buffer.push_back("Latent"); }
15 | if (flags & UEFunctionFlags::PreOperator) { buffer.push_back("PreOperator"); }
16 | if (flags & UEFunctionFlags::Singular) { buffer.push_back("Singular"); }
17 | if (flags & UEFunctionFlags::Net) { buffer.push_back("Net"); }
18 | if (flags & UEFunctionFlags::NetReliable) { buffer.push_back("NetReliable"); }
19 | if (flags & UEFunctionFlags::Simulated) { buffer.push_back("Simulated"); }
20 | if (flags & UEFunctionFlags::Exec) { buffer.push_back("Exec"); }
21 | if (flags & UEFunctionFlags::Native) { buffer.push_back("Native"); }
22 | if (flags & UEFunctionFlags::Event) { buffer.push_back("Event"); }
23 | if (flags & UEFunctionFlags::Operator) { buffer.push_back("Operator"); }
24 | if (flags & UEFunctionFlags::Static) { buffer.push_back("Static"); }
25 | if (flags & UEFunctionFlags::HasOptionalParms) { buffer.push_back("HasOptionalParms"); }
26 | if (flags & UEFunctionFlags::Const) { buffer.push_back("Const"); }
27 | if (flags & UEFunctionFlags::Public) { buffer.push_back("Public"); }
28 | if (flags & UEFunctionFlags::Private) { buffer.push_back("Private"); }
29 | if (flags & UEFunctionFlags::Protected) { buffer.push_back("Protected"); }
30 | if (flags & UEFunctionFlags::Delegate) { buffer.push_back("Delegate"); }
31 | if (flags & UEFunctionFlags::NetServer) { buffer.push_back("NetServer"); }
32 | if (flags & UEFunctionFlags::HasOutParms) { buffer.push_back("HasOutParms"); }
33 | if (flags & UEFunctionFlags::HasDefaults) { buffer.push_back("HasDefaults"); }
34 | if (flags & UEFunctionFlags::NetClient) { buffer.push_back("NetClient"); }
35 | if (flags & UEFunctionFlags::DLLImport) { buffer.push_back("DLLImport"); }
36 | if (flags & UEFunctionFlags::K2Call) { buffer.push_back("K2Call"); }
37 | if (flags & UEFunctionFlags::K2Override) { buffer.push_back("K2Override"); }
38 | if (flags & UEFunctionFlags::K2Pure) { buffer.push_back("K2Pure"); }
39 |
40 | switch (buffer.size())
41 | {
42 | case 0:
43 | return std::string();
44 | case 1:
45 | return std::string(buffer[0]);
46 | default:
47 | std::ostringstream os;
48 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
49 | os << *buffer.rbegin();
50 | return os.str();
51 | }
52 | }
--------------------------------------------------------------------------------
/Engine/UE3/FunctionFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEFunctionFlags : uint32_t
7 | {
8 | Final = 0x00000001,
9 | Defined = 0x00000002,
10 | Iterator = 0x00000004,
11 | Latent = 0x00000008,
12 | PreOperator = 0x00000010,
13 | Singular = 0x00000020,
14 | Net = 0x00000040,
15 | NetReliable = 0x00000080,
16 | Simulated = 0x00000100,
17 | Exec = 0x00000200,
18 | Native = 0x00000400,
19 | Event = 0x00000800,
20 | Operator = 0x00001000,
21 | Static = 0x00002000,
22 | HasOptionalParms = 0x00004000,
23 | Const = 0x00008000,
24 | Public = 0x00020000,
25 | Private = 0x00040000,
26 | Protected = 0x00080000,
27 | Delegate = 0x00100000,
28 | NetServer = 0x00200000,
29 | HasOutParms = 0x00400000,
30 | HasDefaults = 0x00800000,
31 | NetClient = 0x01000000,
32 | DLLImport = 0x02000000,
33 | K2Call = 0x04000000,
34 | K2Override = 0x08000000,
35 | K2Pure = 0x10000000
36 | };
37 |
38 | inline bool operator&(UEFunctionFlags lhs, UEFunctionFlags rhs)
39 | {
40 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
41 | }
42 |
43 | std::string StringifyFlags(const UEFunctionFlags flags);
44 |
--------------------------------------------------------------------------------
/Engine/UE3/GenericTypes.cpp:
--------------------------------------------------------------------------------
1 | #include "GenericTypes.hpp"
2 |
3 | void* UEObject::GetAddress() const
4 | {
5 | return object;
6 | }
7 |
8 | UEObject UEObject::GetPackageObject() const
9 | {
10 | UEObject package(nullptr);
11 |
12 | for (auto outer = GetOuter(); outer.IsValid(); outer = outer.GetOuter())
13 | {
14 | package = outer;
15 | }
16 |
17 | return package;
18 | }
19 |
20 | std::string UEObject::GetFullName() const
21 | {
22 | if (GetClass().IsValid())
23 | {
24 | std::string temp;
25 |
26 | for (auto outer = GetOuter(); outer.IsValid(); outer = outer.GetOuter())
27 | {
28 | temp = outer.GetName() + "." + temp;
29 | }
30 |
31 | std::string name = GetClass().GetName();
32 | name += " ";
33 | name += temp;
34 | name += GetName();
35 |
36 | return name;
37 | }
38 |
39 | return std::string("(null)");
40 | }
41 |
42 | std::string UEObject::GetNameCPP() const
43 | {
44 | std::string name;
45 |
46 | if (IsA())
47 | {
48 | auto c = Cast();
49 | while (c.IsValid())
50 | {
51 | auto className = c.GetName();
52 | if (className == "Actor")
53 | {
54 | name += "A";
55 | break;
56 | }
57 | if (className == "Object")
58 | {
59 | name += "U";
60 | break;
61 | }
62 |
63 | c = c.GetSuper().Cast();
64 | }
65 | }
66 | else
67 | {
68 | name += "F";
69 | }
70 |
71 | name += GetName();
72 |
73 | return name;
74 | }
75 |
76 | UEProperty::Info UEProperty::GetInfo() const
77 | {
78 | if (IsValid())
79 | {
80 | if (IsA())
81 | {
82 | return Cast().GetInfo();
83 | }
84 | if (IsA())
85 | {
86 | return Cast().GetInfo();
87 | }
88 | if (IsA())
89 | {
90 | return Cast().GetInfo();
91 | }
92 | if (IsA())
93 | {
94 | return Cast().GetInfo();
95 | }
96 | if (IsA())
97 | {
98 | return Cast().GetInfo();
99 | }
100 | if (IsA())
101 | {
102 | return Cast().GetInfo();
103 | }
104 | if (IsA())
105 | {
106 | return Cast().GetInfo();
107 | }
108 | if (IsA())
109 | {
110 | return Cast().GetInfo();
111 | }
112 | if (IsA())
113 | {
114 | return Cast().GetInfo();
115 | }
116 | if (IsA())
117 | {
118 | return Cast().GetInfo();
119 | }
120 | if (IsA())
121 | {
122 | return Cast().GetInfo();
123 | }
124 | if (IsA())
125 | {
126 | return Cast().GetInfo();
127 | }
128 | if (IsA())
129 | {
130 | return Cast().GetInfo();
131 | }
132 | if (IsA())
133 | {
134 | return Cast().GetInfo();
135 | }
136 | }
137 | return { PropertyType::Unknown };
138 | }
139 |
140 | //---------------------------------------------------------------------------
141 | //UEByteProperty
142 | //---------------------------------------------------------------------------
143 | bool UEByteProperty::IsEnum() const
144 | {
145 | return GetEnum().IsValid();
146 | }
147 | //---------------------------------------------------------------------------
148 | //UEEnumProperty
149 | //---------------------------------------------------------------------------
150 | UEEnum UEEnumProperty::GetEnum() const
151 | {
152 | return UEEnum(nullptr);
153 | }
154 | //---------------------------------------------------------------------------
155 | UEClass UEEnumProperty::StaticClass()
156 | {
157 | //Unreal Engine 3 doesn't have the EnumProperty class
158 | return nullptr;
159 | }
160 | //---------------------------------------------------------------------------
161 | //UEBoolProperty
162 | //---------------------------------------------------------------------------
163 | int GetBitPosition(uint32_t value)
164 | {
165 | int i16 = !(value & 0xffff) << 4;
166 | value >>= i16;
167 |
168 | int i8 = !(value & 0xff) << 3;
169 | value >>= i8;
170 |
171 | int i4 = !(value & 0xf) << 2;
172 | value >>= i4;
173 |
174 | int i2 = !(value & 0x3) << 1;
175 | value >>= i2;
176 |
177 | int i1 = !(value & 0x1);
178 |
179 | int i0 = (value >> i1) & 1 ? 0 : -32;
180 |
181 | return i16 + i8 + i4 + i2 + i1 + i0;
182 | }
183 | //---------------------------------------------------------------------------
184 | std::array UEBoolProperty::GetMissingBitsCount(const UEBoolProperty& other) const
185 | {
186 | // If there is no previous bitfield member, just calculate the missing bits.
187 | if (!other.IsValid())
188 | {
189 | return { GetBitPosition(GetBitMask()), -1 };
190 | }
191 |
192 | // If both bitfield member belong to the same int, calculate the bit position difference.
193 | if (GetOffset() == other.GetOffset())
194 | {
195 | return { GetBitPosition(GetBitMask()) - GetBitPosition(other.GetBitMask()) - 1, -1 };
196 | }
197 |
198 | // If they have different offsets, we need two distances
199 | // |0000...1000|0010...0000|
200 | // 1. ^---^
201 | // 2. ^--^
202 |
203 | return { std::numeric_limits::digits - GetBitPosition(other.GetBitMask()) - 1, GetBitPosition(GetBitMask()) };
204 | }
205 | //---------------------------------------------------------------------------
--------------------------------------------------------------------------------
/Engine/UE3/Package.cpp:
--------------------------------------------------------------------------------
1 | #include "../Package.hpp"
2 |
3 | bool Package::Method::Parameter::MakeType(UEPropertyFlags flags, Type& type)
4 | {
5 | if (flags & UEPropertyFlags::ReturnParm)
6 | {
7 | type = Type::Return;
8 | }
9 | else if (flags & UEPropertyFlags::OutParm)
10 | {
11 | type = Type::Out;
12 | }
13 | else if (flags & UEPropertyFlags::Parm)
14 | {
15 | type = Type::Default;
16 | }
17 | else
18 | {
19 | return false;
20 | }
21 |
22 | return true;
23 | }
--------------------------------------------------------------------------------
/Engine/UE3/PropertyFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "PropertyFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEPropertyFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEPropertyFlags::Edit) { buffer.push_back("Edit"); }
12 | if (flags & UEPropertyFlags::Const) { buffer.push_back("Const"); }
13 | if (flags & UEPropertyFlags::Input) { buffer.push_back("Input"); }
14 | if (flags & UEPropertyFlags::ExportObject) { buffer.push_back("ExportObject"); }
15 | if (flags & UEPropertyFlags::OptionalParm) { buffer.push_back("OptionalParm"); }
16 | if (flags & UEPropertyFlags::Net) { buffer.push_back("Net"); }
17 | if (flags & UEPropertyFlags::EditFixedSize) { buffer.push_back("EditFixedSize"); }
18 | if (flags & UEPropertyFlags::Parm) { buffer.push_back("Parm"); }
19 | if (flags & UEPropertyFlags::OutParm) { buffer.push_back("OutParm"); }
20 | if (flags & UEPropertyFlags::SkipParm) { buffer.push_back("SkipParm"); }
21 | if (flags & UEPropertyFlags::ReturnParm) { buffer.push_back("ReturnParm"); }
22 | if (flags & UEPropertyFlags::CoerceParm) { buffer.push_back("CoerceParm"); }
23 | if (flags & UEPropertyFlags::Native) { buffer.push_back("Native"); }
24 | if (flags & UEPropertyFlags::Transient) { buffer.push_back("Transient"); }
25 | if (flags & UEPropertyFlags::Config) { buffer.push_back("Config"); }
26 | if (flags & UEPropertyFlags::Localized) { buffer.push_back("Localized"); }
27 | if (flags & UEPropertyFlags::EditConst) { buffer.push_back("EditConst"); }
28 | if (flags & UEPropertyFlags::GlobalConfig) { buffer.push_back("GlobalConfig"); }
29 | if (flags & UEPropertyFlags::Component) { buffer.push_back("Component"); }
30 | if (flags & UEPropertyFlags::AlwaysInit) { buffer.push_back("AlwaysInit"); }
31 | if (flags & UEPropertyFlags::DuplicateTransient) { buffer.push_back("DuplicateTransient"); }
32 | if (flags & UEPropertyFlags::NeedCtorLink) { buffer.push_back("NeedCtorLink"); }
33 | if (flags & UEPropertyFlags::NoExport) { buffer.push_back("NoExport"); }
34 | if (flags & UEPropertyFlags::NoImport) { buffer.push_back("NoImport"); }
35 | if (flags & UEPropertyFlags::NoClear) { buffer.push_back("NoClear"); }
36 | if (flags & UEPropertyFlags::EditInline) { buffer.push_back("EditInline"); }
37 | if (flags & UEPropertyFlags::EditInlineUse) { buffer.push_back("EditInlineUse"); }
38 | if (flags & UEPropertyFlags::Deprecated) { buffer.push_back("Deprecated"); }
39 | if (flags & UEPropertyFlags::DataBinding) { buffer.push_back("DataBinding"); }
40 | if (flags & UEPropertyFlags::SerializeText) { buffer.push_back("SerializeText"); }
41 | if (flags & UEPropertyFlags::RepNotify) { buffer.push_back("RepNotify"); }
42 | if (flags & UEPropertyFlags::Interp) { buffer.push_back("Interp"); }
43 | if (flags & UEPropertyFlags::NonTransactional) { buffer.push_back("NonTransactional"); }
44 | if (flags & UEPropertyFlags::EditorOnly) { buffer.push_back("EditorOnly"); }
45 | if (flags & UEPropertyFlags::NotForConsole) { buffer.push_back("NotForConsole"); }
46 | if (flags & UEPropertyFlags::RepRetry) { buffer.push_back("RepRetry"); }
47 | if (flags & UEPropertyFlags::PrivateWrite) { buffer.push_back("PrivateWrite"); }
48 | if (flags & UEPropertyFlags::ProtectedWrite) { buffer.push_back("ProtectedWrite"); }
49 | if (flags & UEPropertyFlags::ArchetypeProperty) { buffer.push_back("ArchetypeProperty"); }
50 | if (flags & UEPropertyFlags::EditHide) { buffer.push_back("EditHide"); }
51 | if (flags & UEPropertyFlags::EditTextBox) { buffer.push_back("EditTextBox"); }
52 | if (flags & UEPropertyFlags::CrossLevelPassive) { buffer.push_back("CrossLevelPassive"); }
53 | if (flags & UEPropertyFlags::CrossLevelActive) { buffer.push_back("CrossLevelActive"); }
54 |
55 | switch (buffer.size())
56 | {
57 | case 0:
58 | return std::string();
59 | case 1:
60 | return std::string(buffer[0]);
61 | default:
62 | std::ostringstream os;
63 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
64 | os << *buffer.rbegin();
65 | return os.str();
66 | }
67 | }
--------------------------------------------------------------------------------
/Engine/UE3/PropertyFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEPropertyFlags : uint64_t
7 | {
8 | Edit = 0x0000000000000001,
9 | Const = 0x0000000000000002,
10 | Input = 0x0000000000000004,
11 | ExportObject = 0x0000000000000008,
12 | OptionalParm = 0x0000000000000010,
13 | Net = 0x0000000000000020,
14 | EditFixedSize = 0x0000000000000040,
15 | Parm = 0x0000000000000080,
16 | OutParm = 0x0000000000000100,
17 | SkipParm = 0x0000000000000200,
18 | ReturnParm = 0x0000000000000400,
19 | CoerceParm = 0x0000000000000800,
20 | Native = 0x0000000000001000,
21 | Transient = 0x0000000000002000,
22 | Config = 0x0000000000004000,
23 | Localized = 0x0000000000008000,
24 | EditConst = 0x0000000000020000,
25 | GlobalConfig = 0x0000000000040000,
26 | Component = 0x0000000000080000,
27 | AlwaysInit = 0x0000000000100000,
28 | DuplicateTransient = 0x0000000000200000,
29 | NeedCtorLink = 0x0000000000400000,
30 | NoExport = 0x0000000000800000,
31 | NoImport = 0x0000000001000000,
32 | NoClear = 0x0000000002000000,
33 | EditInline = 0x0000000004000000,
34 | EditInlineUse = 0x0000000010000000,
35 | Deprecated = 0x0000000020000000,
36 | DataBinding = 0x0000000040000000,
37 | SerializeText = 0x0000000080000000,
38 | RepNotify = 0x0000000100000000,
39 | Interp = 0x0000000200000000,
40 | NonTransactional = 0x0000000400000000,
41 | EditorOnly = 0x0000000800000000,
42 | NotForConsole = 0x0000001000000000,
43 | RepRetry = 0x0000002000000000,
44 | PrivateWrite = 0x0000004000000000,
45 | ProtectedWrite = 0x0000008000000000,
46 | ArchetypeProperty = 0x0000010000000000,
47 | EditHide = 0x0000020000000000,
48 | EditTextBox = 0x0000040000000000,
49 | CrossLevelPassive = 0x0000100000000000,
50 | CrossLevelActive = 0x0000200000000000
51 | };
52 |
53 | inline bool operator&(UEPropertyFlags lhs, UEPropertyFlags rhs)
54 | {
55 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
56 | }
57 |
58 | std::string StringifyFlags(const UEPropertyFlags flags);
--------------------------------------------------------------------------------
/Engine/UE4/FunctionFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "FunctionFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEFunctionFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEFunctionFlags::Final) { buffer.push_back("Final"); }
12 | if (flags & UEFunctionFlags::RequiredAPI) { buffer.push_back("RequiredAPI"); }
13 | if (flags & UEFunctionFlags::BlueprintAuthorityOnly) { buffer.push_back("BlueprintAuthorityOnly"); }
14 | if (flags & UEFunctionFlags::BlueprintCosmetic) { buffer.push_back("BlueprintCosmetic"); }
15 | if (flags & UEFunctionFlags::Net) { buffer.push_back("Net"); }
16 | if (flags & UEFunctionFlags::NetReliable) { buffer.push_back("NetReliable"); }
17 | if (flags & UEFunctionFlags::NetRequest) { buffer.push_back("NetRequest"); }
18 | if (flags & UEFunctionFlags::Exec) { buffer.push_back("Exec"); }
19 | if (flags & UEFunctionFlags::Native) { buffer.push_back("Native"); }
20 | if (flags & UEFunctionFlags::Event) { buffer.push_back("Event"); }
21 | if (flags & UEFunctionFlags::NetResponse) { buffer.push_back("NetResponse"); }
22 | if (flags & UEFunctionFlags::Static) { buffer.push_back("Static"); }
23 | if (flags & UEFunctionFlags::NetMulticast) { buffer.push_back("NetMulticast"); }
24 | if (flags & UEFunctionFlags::MulticastDelegate) { buffer.push_back("MulticastDelegate"); }
25 | if (flags & UEFunctionFlags::Public) { buffer.push_back("Public"); }
26 | if (flags & UEFunctionFlags::Private) { buffer.push_back("Private"); }
27 | if (flags & UEFunctionFlags::Protected) { buffer.push_back("Protected"); }
28 | if (flags & UEFunctionFlags::Delegate) { buffer.push_back("Delegate"); }
29 | if (flags & UEFunctionFlags::NetServer) { buffer.push_back("NetServer"); }
30 | if (flags & UEFunctionFlags::HasOutParms) { buffer.push_back("HasOutParms"); }
31 | if (flags & UEFunctionFlags::HasDefaults) { buffer.push_back("HasDefaults"); }
32 | if (flags & UEFunctionFlags::NetClient) { buffer.push_back("NetClient"); }
33 | if (flags & UEFunctionFlags::DLLImport) { buffer.push_back("DLLImport"); }
34 | if (flags & UEFunctionFlags::BlueprintCallable) { buffer.push_back("BlueprintCallable"); }
35 | if (flags & UEFunctionFlags::BlueprintEvent) { buffer.push_back("BlueprintEvent"); }
36 | if (flags & UEFunctionFlags::BlueprintPure) { buffer.push_back("BlueprintPure"); }
37 | if (flags & UEFunctionFlags::Const) { buffer.push_back("Const"); }
38 | if (flags & UEFunctionFlags::NetValidate) { buffer.push_back("NetValidate"); }
39 |
40 | switch (buffer.size())
41 | {
42 | case 0:
43 | return std::string();
44 | case 1:
45 | return std::string(buffer[0]);
46 | default:
47 | std::ostringstream os;
48 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
49 | os << *buffer.rbegin();
50 | return os.str();
51 | }
52 | }
--------------------------------------------------------------------------------
/Engine/UE4/FunctionFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEFunctionFlags : uint32_t
7 | {
8 | Final = 0x00000001,
9 | RequiredAPI = 0x00000002,
10 | BlueprintAuthorityOnly = 0x00000004,
11 | BlueprintCosmetic = 0x00000008,
12 | Net = 0x00000040,
13 | NetReliable = 0x00000080,
14 | NetRequest = 0x00000100,
15 | Exec = 0x00000200,
16 | Native = 0x00000400,
17 | Event = 0x00000800,
18 | NetResponse = 0x00001000,
19 | Static = 0x00002000,
20 | NetMulticast = 0x00004000,
21 | MulticastDelegate = 0x00010000,
22 | Public = 0x00020000,
23 | Private = 0x00040000,
24 | Protected = 0x00080000,
25 | Delegate = 0x00100000,
26 | NetServer = 0x00200000,
27 | HasOutParms = 0x00400000,
28 | HasDefaults = 0x00800000,
29 | NetClient = 0x01000000,
30 | DLLImport = 0x02000000,
31 | BlueprintCallable = 0x04000000,
32 | BlueprintEvent = 0x08000000,
33 | BlueprintPure = 0x10000000,
34 | Const = 0x40000000,
35 | NetValidate = 0x80000000
36 | };
37 |
38 | inline bool operator&(UEFunctionFlags lhs, UEFunctionFlags rhs)
39 | {
40 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
41 | }
42 |
43 | std::string StringifyFlags(const UEFunctionFlags flags);
44 |
--------------------------------------------------------------------------------
/Engine/UE4/Package.cpp:
--------------------------------------------------------------------------------
1 | #include "../Package.hpp"
2 |
3 | bool Package::Method::Parameter::MakeType(UEPropertyFlags flags, Type& type)
4 | {
5 | if (flags & UEPropertyFlags::ReturnParm)
6 | {
7 | type = Type::Return;
8 | }
9 | else if (flags & UEPropertyFlags::OutParm)
10 | {
11 | //if it is a const parameter make it a default parameter
12 | if (flags & UEPropertyFlags::ConstParm)
13 | {
14 | type = Type::Default;
15 | }
16 | else
17 | {
18 | type = Type::Out;
19 | }
20 | }
21 | else if (flags & UEPropertyFlags::Parm)
22 | {
23 | type = Type::Default;
24 | }
25 | else
26 | {
27 | return false;
28 | }
29 |
30 | return true;
31 | }
--------------------------------------------------------------------------------
/Engine/UE4/PropertyFlags.cpp:
--------------------------------------------------------------------------------
1 | #include "PropertyFlags.hpp"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | std::string StringifyFlags(const UEPropertyFlags flags)
8 | {
9 | std::vector buffer;
10 |
11 | if (flags & UEPropertyFlags::Edit) { buffer.push_back("Edit"); }
12 | if (flags & UEPropertyFlags::ConstParm) { buffer.push_back("ConstParm"); }
13 | if (flags & UEPropertyFlags::BlueprintVisible) { buffer.push_back("BlueprintVisible"); }
14 | if (flags & UEPropertyFlags::ExportObject) { buffer.push_back("ExportObject"); }
15 | if (flags & UEPropertyFlags::BlueprintReadOnly) { buffer.push_back("BlueprintReadOnly"); }
16 | if (flags & UEPropertyFlags::Net) { buffer.push_back("Net"); }
17 | if (flags & UEPropertyFlags::EditFixedSize) { buffer.push_back("EditFixedSize"); }
18 | if (flags & UEPropertyFlags::Parm) { buffer.push_back("Parm"); }
19 | if (flags & UEPropertyFlags::OutParm) { buffer.push_back("OutParm"); }
20 | if (flags & UEPropertyFlags::ZeroConstructor) { buffer.push_back("ZeroConstructor"); }
21 | if (flags & UEPropertyFlags::ReturnParm) { buffer.push_back("ReturnParm"); }
22 | if (flags & UEPropertyFlags::DisableEditOnTemplate) { buffer.push_back("DisableEditOnTemplate"); }
23 | if (flags & UEPropertyFlags::Transient) { buffer.push_back("Transient"); }
24 | if (flags & UEPropertyFlags::Config) { buffer.push_back("Config"); }
25 | if (flags & UEPropertyFlags::DisableEditOnInstance) { buffer.push_back("DisableEditOnInstance"); }
26 | if (flags & UEPropertyFlags::EditConst) { buffer.push_back("EditConst"); }
27 | if (flags & UEPropertyFlags::GlobalConfig) { buffer.push_back("GlobalConfig"); }
28 | if (flags & UEPropertyFlags::InstancedReference) { buffer.push_back("InstancedReference"); }
29 | if (flags & UEPropertyFlags::DuplicateTransient) { buffer.push_back("DuplicateTransient"); }
30 | if (flags & UEPropertyFlags::SubobjectReference) { buffer.push_back("SubobjectReference"); }
31 | if (flags & UEPropertyFlags::SaveGame) { buffer.push_back("SaveGame"); }
32 | if (flags & UEPropertyFlags::NoClear) { buffer.push_back("NoClear"); }
33 | if (flags & UEPropertyFlags::ReferenceParm) { buffer.push_back("ReferenceParm"); }
34 | if (flags & UEPropertyFlags::BlueprintAssignable) { buffer.push_back("BlueprintAssignable"); }
35 | if (flags & UEPropertyFlags::Deprecated) { buffer.push_back("Deprecated"); }
36 | if (flags & UEPropertyFlags::IsPlainOldData) { buffer.push_back("IsPlainOldData"); }
37 | if (flags & UEPropertyFlags::RepSkip) { buffer.push_back("RepSkip"); }
38 | if (flags & UEPropertyFlags::RepNotify) { buffer.push_back("RepNotify"); }
39 | if (flags & UEPropertyFlags::Interp) { buffer.push_back("Interp"); }
40 | if (flags & UEPropertyFlags::NonTransactional) { buffer.push_back("NonTransactional"); }
41 | if (flags & UEPropertyFlags::EditorOnly) { buffer.push_back("EditorOnly"); }
42 | if (flags & UEPropertyFlags::NoDestructor) { buffer.push_back("NoDestructor"); }
43 | if (flags & UEPropertyFlags::AutoWeak) { buffer.push_back("AutoWeak"); }
44 | if (flags & UEPropertyFlags::ContainsInstancedReference) { buffer.push_back("ContainsInstancedReference"); }
45 | if (flags & UEPropertyFlags::AssetRegistrySearchable) { buffer.push_back("AssetRegistrySearchable"); }
46 | if (flags & UEPropertyFlags::SimpleDisplay) { buffer.push_back("SimpleDisplay"); }
47 | if (flags & UEPropertyFlags::AdvancedDisplay) { buffer.push_back("AdvancedDisplay"); }
48 | if (flags & UEPropertyFlags::Protected) { buffer.push_back("Protected"); }
49 | if (flags & UEPropertyFlags::BlueprintCallable) { buffer.push_back("BlueprintCallable"); }
50 | if (flags & UEPropertyFlags::BlueprintAuthorityOnly) { buffer.push_back("BlueprintAuthorityOnly"); }
51 | if (flags & UEPropertyFlags::TextExportTransient) { buffer.push_back("TextExportTransient"); }
52 | if (flags & UEPropertyFlags::NonPIEDuplicateTransient) { buffer.push_back("NonPIEDuplicateTransient"); }
53 | if (flags & UEPropertyFlags::ExposeOnSpawn) { buffer.push_back("ExposeOnSpawn"); }
54 | if (flags & UEPropertyFlags::PersistentInstance) { buffer.push_back("PersistentInstance"); }
55 | if (flags & UEPropertyFlags::UObjectWrapper) { buffer.push_back("UObjectWrapper"); }
56 | if (flags & UEPropertyFlags::HasGetValueTypeHash) { buffer.push_back("HasGetValueTypeHash"); }
57 | if (flags & UEPropertyFlags::NativeAccessSpecifierPublic) { buffer.push_back("NativeAccessSpecifierPublic"); }
58 | if (flags & UEPropertyFlags::NativeAccessSpecifierProtected) { buffer.push_back("NativeAccessSpecifierProtected"); }
59 | if (flags & UEPropertyFlags::NativeAccessSpecifierPrivate) { buffer.push_back("NativeAccessSpecifierPrivate"); }
60 |
61 | switch (buffer.size())
62 | {
63 | case 0:
64 | return std::string();
65 | case 1:
66 | return std::string(buffer[0]);
67 | default:
68 | std::ostringstream os;
69 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", "));
70 | os << *buffer.rbegin();
71 | return os.str();
72 | }
73 | }
--------------------------------------------------------------------------------
/Engine/UE4/PropertyFlags.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | enum class UEPropertyFlags : uint64_t
7 | {
8 | Edit = 0x0000000000000001,
9 | ConstParm = 0x0000000000000002,
10 | BlueprintVisible = 0x0000000000000004,
11 | ExportObject = 0x0000000000000008,
12 | BlueprintReadOnly = 0x0000000000000010,
13 | Net = 0x0000000000000020,
14 | EditFixedSize = 0x0000000000000040,
15 | Parm = 0x0000000000000080,
16 | OutParm = 0x0000000000000100,
17 | ZeroConstructor = 0x0000000000000200,
18 | ReturnParm = 0x0000000000000400,
19 | DisableEditOnTemplate = 0x0000000000000800,
20 | Transient = 0x0000000000002000,
21 | Config = 0x0000000000004000,
22 | DisableEditOnInstance = 0x0000000000010000,
23 | EditConst = 0x0000000000020000,
24 | GlobalConfig = 0x0000000000040000,
25 | InstancedReference = 0x0000000000080000,
26 | DuplicateTransient = 0x0000000000200000,
27 | SubobjectReference = 0x0000000000400000,
28 | SaveGame = 0x0000000001000000,
29 | NoClear = 0x0000000002000000,
30 | ReferenceParm = 0x0000000008000000,
31 | BlueprintAssignable = 0x0000000010000000,
32 | Deprecated = 0x0000000020000000,
33 | IsPlainOldData = 0x0000000040000000,
34 | RepSkip = 0x0000000080000000,
35 | RepNotify = 0x0000000100000000,
36 | Interp = 0x0000000200000000,
37 | NonTransactional = 0x0000000400000000,
38 | EditorOnly = 0x0000000800000000,
39 | NoDestructor = 0x0000001000000000,
40 | AutoWeak = 0x0000004000000000,
41 | ContainsInstancedReference = 0x0000008000000000,
42 | AssetRegistrySearchable = 0x0000010000000000,
43 | SimpleDisplay = 0x0000020000000000,
44 | AdvancedDisplay = 0x0000040000000000,
45 | Protected = 0x0000080000000000,
46 | BlueprintCallable = 0x0000100000000000,
47 | BlueprintAuthorityOnly = 0x0000200000000000,
48 | TextExportTransient = 0x0000400000000000,
49 | NonPIEDuplicateTransient = 0x0000800000000000,
50 | ExposeOnSpawn = 0x0001000000000000,
51 | PersistentInstance = 0x0002000000000000,
52 | UObjectWrapper = 0x0004000000000000,
53 | HasGetValueTypeHash = 0x0008000000000000,
54 | NativeAccessSpecifierPublic = 0x0010000000000000,
55 | NativeAccessSpecifierProtected = 0x0020000000000000,
56 | NativeAccessSpecifierPrivate = 0x0040000000000000
57 | };
58 |
59 | inline bool operator&(UEPropertyFlags lhs, UEPropertyFlags rhs)
60 | {
61 | return (static_cast>(lhs) & static_cast>(rhs)) == static_cast>(rhs);
62 | }
63 |
64 | std::string StringifyFlags(const UEPropertyFlags flags);
--------------------------------------------------------------------------------
/Fortnite.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE4
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE4
38 |
39 |
40 | Engine\UE4
41 |
42 |
43 | Engine\UE4
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE4
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE4
83 |
84 |
85 | Engine\UE4
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Hawken.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE3
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE3
38 |
39 |
40 | Engine\UE3
41 |
42 |
43 | Engine\UE3
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE3
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE3
83 |
84 |
85 | Engine\UE3
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Paragon.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE4
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE4
38 |
39 |
40 | Engine\UE4
41 |
42 |
43 | Engine\UE4
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE4
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE4
83 |
84 |
85 | Engine\UE4
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/PlayerUnknownsBattlegrounds.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE4
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE4
38 |
39 |
40 | Engine
41 |
42 |
43 | Engine\UE4
44 |
45 |
46 | Engine\UE4
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE4
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine
83 |
84 |
85 | Engine
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine\UE4
95 |
96 |
97 | Engine\UE4
98 |
99 |
100 |
--------------------------------------------------------------------------------
/RocketLeague.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Engine
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Engine
17 |
18 |
19 | Engine
20 |
21 |
22 | Engine
23 |
24 |
25 | Engine
26 |
27 |
28 | Engine\UE3
29 |
30 |
31 | Engine
32 |
33 |
34 | Engine
35 |
36 |
37 | Engine\UE3
38 |
39 |
40 | Engine\UE3
41 |
42 |
43 | Engine\UE3
44 |
45 |
46 | Engine
47 |
48 |
49 |
50 |
51 | {5fb70966-5939-4bcf-b096-6b909315ed0d}
52 |
53 |
54 | {77ff275a-574c-4908-9ae5-345300346f41}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Engine\UE3
62 |
63 |
64 | Engine
65 |
66 |
67 | Engine
68 |
69 |
70 | Engine
71 |
72 |
73 | Engine
74 |
75 |
76 | Engine
77 |
78 |
79 | Engine
80 |
81 |
82 | Engine\UE3
83 |
84 |
85 | Engine\UE3
86 |
87 |
88 | Engine
89 |
90 |
91 | Engine
92 |
93 |
94 | Engine
95 |
96 |
97 | Engine
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Target/ARKSurvivalEvolved/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | static const auto NAME_WIDE_MASK = 0x1;
12 | static const auto NAME_INDEX_SHIFT = 1;
13 |
14 | int32_t Index;
15 | char UnknownData00[0x04];
16 | FNameEntry* HashNext;
17 | union
18 | {
19 | char AnsiName[1024];
20 | wchar_t WideName[1024];
21 | };
22 |
23 | int32_t GetIndex() const
24 | {
25 | return Index >> NAME_INDEX_SHIFT;
26 | }
27 |
28 | bool IsWide() const
29 | {
30 | return Index & NAME_WIDE_MASK;
31 | }
32 |
33 | const char* GetAnsiName() const
34 | {
35 | return AnsiName;
36 | }
37 |
38 | const wchar_t* GetWideName() const
39 | {
40 | return WideName;
41 | }
42 | };
43 |
44 | template
45 | class TStaticIndirectArrayThreadSafeRead
46 | {
47 | public:
48 | int32_t Num() const
49 | {
50 | return NumElements;
51 | }
52 |
53 | bool IsValidIndex(int32_t index) const
54 | {
55 | return index >= 0 && index < Num() && GetById(index) != nullptr;
56 | }
57 |
58 | ElementType const* const& GetById(int32_t index) const
59 | {
60 | return *GetItemPtr(index);
61 | }
62 |
63 | private:
64 | ElementType const* const* GetItemPtr(int32_t Index) const
65 | {
66 | int32_t ChunkIndex = Index / ElementsPerChunk;
67 | int32_t WithinChunkIndex = Index % ElementsPerChunk;
68 | ElementType** Chunk = Chunks[ChunkIndex];
69 | return Chunk + WithinChunkIndex;
70 | }
71 |
72 | enum
73 | {
74 | ChunkTableSize = (MaxTotalElements + ElementsPerChunk - 1) / ElementsPerChunk
75 | };
76 |
77 | ElementType** Chunks[ChunkTableSize];
78 | int32_t NumElements;
79 | int32_t NumChunks;
80 | };
81 |
82 | using TNameEntryArray = TStaticIndirectArrayThreadSafeRead;
83 |
84 | TNameEntryArray* GlobalNames = nullptr;
85 |
86 | bool NamesStore::Initialize()
87 | {
88 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x89\x83\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x89\x1D"), "xxx????x????xxx");
89 | if (address == -1)
90 | {
91 | return false;
92 | }
93 |
94 | address += 12;
95 |
96 | auto offset = *reinterpret_cast(address + 3);
97 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 7 + offset));
98 |
99 | return true;
100 | }
101 |
102 | void* NamesStore::GetAddress()
103 | {
104 | return GlobalNames;
105 | }
106 |
107 | size_t NamesStore::GetNamesNum() const
108 | {
109 | return GlobalNames->Num();
110 | }
111 |
112 | bool NamesStore::IsValid(size_t id) const
113 | {
114 | return GlobalNames->IsValidIndex(static_cast(id));
115 | }
116 |
117 | std::string NamesStore::GetById(size_t id) const
118 | {
119 | return GlobalNames->GetById(static_cast(id))->GetAnsiName();
120 | }
121 |
--------------------------------------------------------------------------------
/Target/ARKSurvivalEvolved/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FUObjectArray
9 | {
10 | public:
11 | int32_t ObjFirstGCIndex;
12 | int32_t ObjLastNonGCIndex;
13 | int32_t OpenForDisregardForGC;
14 |
15 | TArray ObjObjects;
16 | TArray ObjAvailable;
17 | };
18 |
19 | FUObjectArray* GlobalObjects = nullptr;
20 |
21 | bool ObjectsStore::Initialize()
22 | {
23 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x8D\x05\x00\x00\x00\x00\x45\x84\xC0\x48\x89\x01"), "xxx????xxxxxx");
24 | if (address == -1)
25 | {
26 | return false;
27 | }
28 |
29 | auto offset = *reinterpret_cast(address + 3);
30 | GlobalObjects = reinterpret_cast(address + 7 + offset);
31 |
32 | return true;
33 | }
34 |
35 | void* ObjectsStore::GetAddress()
36 | {
37 | return GlobalObjects;
38 | }
39 |
40 | size_t ObjectsStore::GetObjectsNum() const
41 | {
42 | return GlobalObjects->ObjObjects.Num();
43 | }
44 |
45 | UEObject ObjectsStore::GetById(size_t id) const
46 | {
47 | return GlobalObjects->ObjObjects[id];
48 | }
49 |
--------------------------------------------------------------------------------
/Target/AllPointsBulletin/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | uint32_t Flags;
12 | char pad_0x0004[0xC];
13 | union
14 | {
15 | char Name[1024];
16 | char* NamePtr;
17 | };
18 |
19 | const char* GetName() const
20 | {
21 | return Flags & 0x4000 ? NamePtr : Name;
22 | }
23 | };
24 |
25 | TArray* GlobalNames = nullptr;
26 |
27 | bool NamesStore::Initialize()
28 | {
29 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x8B\x0D\x00\x00\x00\x00\x83\x3C\x81\x00"), "xx????xxxx");
30 | if (address == -1)
31 | {
32 | return false;
33 | }
34 |
35 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 2));
36 |
37 | return true;
38 | }
39 |
40 | void* NamesStore::GetAddress()
41 | {
42 | return GlobalNames;
43 | }
44 |
45 | size_t NamesStore::GetNamesNum() const
46 | {
47 | return GlobalNames->Num();
48 | }
49 |
50 | bool NamesStore::IsValid(size_t id) const
51 | {
52 | return GlobalNames->IsValidIndex(id) && (*GlobalNames)[id] != nullptr;
53 | }
54 |
55 | std::string NamesStore::GetById(size_t id) const
56 | {
57 | return (*GlobalNames)[id]->GetName();
58 | }
59 |
--------------------------------------------------------------------------------
/Target/AllPointsBulletin/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | TArray* GlobalObjects = nullptr;
9 |
10 | bool ObjectsStore::Initialize()
11 | {
12 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\xA1\x00\x00\x00\x00\x8B\x34\xB0\x85\xF6"), "x????xxxxx");
13 | if (address == -1)
14 | {
15 | return false;
16 | }
17 |
18 | GlobalObjects = reinterpret_cast(*reinterpret_cast(address + 1));
19 |
20 | return true;
21 | }
22 |
23 | void* ObjectsStore::GetAddress()
24 | {
25 | return GlobalObjects;
26 | }
27 |
28 | size_t ObjectsStore::GetObjectsNum() const
29 | {
30 | return GlobalObjects->Num();
31 | }
32 |
33 | UEObject ObjectsStore::GetById(size_t id) const
34 | {
35 | return (*GlobalObjects)[id];
36 | }
37 |
--------------------------------------------------------------------------------
/Target/AloneInTheDarkIllumination/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | __int32 Index;
12 | char pad_0x0004[0x4];
13 | FNameEntry* HashNext;
14 | union
15 | {
16 | char AnsiName[1024];
17 | wchar_t WideName[1024];
18 | };
19 |
20 | const char* GetName() const
21 | {
22 | return AnsiName;
23 | }
24 | };
25 |
26 | template
27 | class TStaticIndirectArrayThreadSafeRead
28 | {
29 | public:
30 | int32_t Num() const
31 | {
32 | return NumElements;
33 | }
34 |
35 | bool IsValidIndex(int32_t index) const
36 | {
37 | return index >= 0 && index < Num() && GetById(index) != nullptr;
38 | }
39 |
40 | ElementType const* const& GetById(int32_t index) const
41 | {
42 | return *GetItemPtr(index);
43 | }
44 |
45 | private:
46 | ElementType const* const* GetItemPtr(int32_t Index) const
47 | {
48 | int32_t ChunkIndex = Index / ElementsPerChunk;
49 | int32_t WithinChunkIndex = Index % ElementsPerChunk;
50 | ElementType** Chunk = Chunks[ChunkIndex];
51 | return Chunk + WithinChunkIndex;
52 | }
53 |
54 | enum
55 | {
56 | ChunkTableSize = (MaxTotalElements + ElementsPerChunk - 1) / ElementsPerChunk
57 | };
58 |
59 | ElementType** Chunks[ChunkTableSize];
60 | __int32 NumElements;
61 | __int32 NumChunks;
62 | };
63 |
64 | using TNameEntryArray = TStaticIndirectArrayThreadSafeRead;
65 |
66 | TNameEntryArray* GlobalNames = nullptr;
67 |
68 | bool NamesStore::Initialize()
69 | {
70 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x8B\x5C\x24\x00\x48\x89\x05\x00\x00\x00\x00\x48\x83\xC4\x28\xC3"), "xxxx?xxx????xxxxx");
71 | if (address == -1)
72 | {
73 | return false;
74 | }
75 |
76 | address += 5;
77 |
78 | auto offset = *reinterpret_cast(address + 3);
79 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 7 + offset));
80 |
81 | return true;
82 | }
83 |
84 | void* NamesStore::GetAddress()
85 | {
86 | return GlobalNames;
87 | }
88 |
89 | size_t NamesStore::GetNamesNum() const
90 | {
91 | return GlobalNames->Num();
92 | }
93 |
94 | bool NamesStore::IsValid(size_t id) const
95 | {
96 | return GlobalNames->IsValidIndex(static_cast(id));
97 | }
98 |
99 | std::string NamesStore::GetById(size_t id) const
100 | {
101 | return GlobalNames->GetById(static_cast(id))->GetName();
102 | }
103 |
--------------------------------------------------------------------------------
/Target/AloneInTheDarkIllumination/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FUObjectArray
9 | {
10 | public:
11 | __int32 ObjFirstGCIndex;
12 | __int32 ObjLastNonGCIndex;
13 | __int32 OpenForDisregardForGC;
14 |
15 | TArray ObjObjects;
16 | };
17 |
18 | FUObjectArray* GlobalObjects = nullptr;
19 |
20 | bool ObjectsStore::Initialize()
21 | {
22 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x8D\x15\x00\x00\x00\x00\x41\x8B\xF9"), "xxx????xxx");
23 | if (address == -1)
24 | {
25 | return false;
26 | }
27 |
28 | auto offset = *reinterpret_cast(address + 3);
29 | GlobalObjects = reinterpret_cast(address + 7 + offset);
30 |
31 | return true;
32 | }
33 |
34 | void* ObjectsStore::GetAddress()
35 | {
36 | return GlobalObjects;
37 | }
38 |
39 | size_t ObjectsStore::GetObjectsNum() const
40 | {
41 | return GlobalObjects->ObjObjects.Num();
42 | }
43 |
44 | UEObject ObjectsStore::GetById(size_t id) const
45 | {
46 | return GlobalObjects->ObjObjects[id];
47 | }
48 |
--------------------------------------------------------------------------------
/Target/Borderlands2/EngineClasses.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | struct FPointer
8 | {
9 | uintptr_t Dummy;
10 | };
11 |
12 | struct FQWord
13 | {
14 | int A;
15 | int B;
16 | };
17 |
18 | struct FName
19 | {
20 | int32_t Index;
21 | int32_t Number;
22 | };
23 |
24 | template
25 | struct TArray
26 | {
27 | friend struct FString;
28 |
29 | public:
30 | TArray()
31 | {
32 | Data = nullptr;
33 | Count = Max = 0;
34 | };
35 |
36 | size_t Num() const
37 | {
38 | return Count;
39 | };
40 |
41 | T& operator[](size_t i)
42 | {
43 | return Data[i];
44 | };
45 |
46 | const T& operator[](size_t i) const
47 | {
48 | return Data[i];
49 | };
50 |
51 | bool IsValidIndex(size_t i) const
52 | {
53 | return i < Num();
54 | }
55 |
56 | private:
57 | T* Data;
58 | int32_t Count;
59 | int32_t Max;
60 | };
61 |
62 | struct FString : public TArray
63 | {
64 | std::string ToString() const
65 | {
66 | int size = WideCharToMultiByte(CP_UTF8, 0, Data, Count - 1, nullptr, 0, nullptr, nullptr);
67 | std::string str(size, 0);
68 | WideCharToMultiByte(CP_UTF8, 0, Data, Count - 1, &str[0], size, nullptr, nullptr);
69 | return str;
70 | }
71 | };
72 |
73 | class FScriptInterface
74 | {
75 | private:
76 | UObject* ObjectPointer;
77 | void* InterfacePointer;
78 |
79 | public:
80 | UObject* GetObject() const
81 | {
82 | return ObjectPointer;
83 | }
84 |
85 | UObject*& GetObjectRef()
86 | {
87 | return ObjectPointer;
88 | }
89 |
90 | void* GetInterface() const
91 | {
92 | return ObjectPointer != nullptr ? InterfacePointer : nullptr;
93 | }
94 | };
95 |
96 | template
97 | class TScriptInterface : public FScriptInterface
98 | {
99 | public:
100 | InterfaceType* operator->() const
101 | {
102 | return (InterfaceType*)GetInterface();
103 | }
104 |
105 | InterfaceType& operator*() const
106 | {
107 | return *((InterfaceType*)GetInterface());
108 | }
109 |
110 | operator bool() const
111 | {
112 | return GetInterface() != nullptr;
113 | }
114 | };
115 |
116 | struct FScriptDelegate
117 | {
118 | unsigned char UnknownData[0x0C];
119 | };
120 |
121 | class UClass;
122 |
123 | class UObject
124 | {
125 | public:
126 | FPointer VTableObject;
127 | char UnknownData00[0x1C];
128 | uint32_t InternalIndex;
129 | char UnknownData01[0x04];
130 | UObject* Outer;
131 | FName Name;
132 | UObject* Class;
133 | char UnknownData02[0x04];
134 | };
135 |
136 | class UField : public UObject
137 | {
138 | public:
139 | UField* Next;
140 | };
141 |
142 | class UEnum : public UField
143 | {
144 | public:
145 | TArray Names;
146 | };
147 |
148 | class UConst : public UField
149 | {
150 | public:
151 | FString Value;
152 | };
153 |
154 | class UStruct : public UField
155 | {
156 | public:
157 | char UnknownData00[0x08];
158 | UField* SuperField;
159 | UField* Children;
160 | uint16_t PropertySize;
161 | char UnknownData01[0x3A];
162 | };
163 |
164 | class UScriptStruct : public UStruct
165 | {
166 | public:
167 | char UnknownData00[0x1C];
168 | };
169 |
170 | class UFunction : public UStruct
171 | {
172 | public:
173 | uint32_t FunctionFlags;
174 | uint16_t iNative;
175 | uint16_t RepOffset;
176 | FName FriendlyName;
177 | uint8_t OperPrecendence;
178 | uint8_t NumParms;
179 | uint16_t ParmsSize;
180 | uint16_t ReturnValueOffset;
181 | void* Func;
182 | };
183 |
184 | class UState : public UStruct
185 | {
186 | public:
187 | char UnknownData00[0x2C];
188 | };
189 |
190 | class UClass : public UStruct
191 | {
192 | public:
193 | char UnknownData00[0x60];
194 | UObject* ClassDefaultObject;
195 | char UnknownData01[0x5C];
196 | };
197 |
198 | class UProperty : public UField
199 | {
200 | public:
201 | uint32_t ArrayDim;
202 | uint32_t ElementSize;
203 | uint64_t PropertyFlags;
204 | uint16_t PropertySize;
205 | char UnknownData00[0x0E];
206 | uint32_t Offset;
207 | UProperty* PropertyLinkNext;
208 | char UnknownData01[0x18];
209 | };
210 |
211 | class UByteProperty : public UProperty
212 | {
213 | public:
214 | UEnum* Enum;
215 | };
216 |
217 | class UIntProperty : public UProperty
218 | {
219 | public:
220 |
221 | };
222 |
223 | class UFloatProperty : public UProperty
224 | {
225 | public:
226 |
227 | };
228 |
229 | class UDoubleProperty : public UProperty
230 | {
231 | public:
232 |
233 | };
234 |
235 | class UBoolProperty : public UProperty
236 | {
237 | public:
238 | unsigned long BitMask;
239 | };
240 |
241 | class UObjectProperty : public UProperty
242 | {
243 | public:
244 | UClass* PropertyClass;
245 | };
246 |
247 | class UComponentProperty : public UObjectProperty
248 | {
249 | public:
250 |
251 | };
252 |
253 | class UClassProperty : public UObjectProperty
254 | {
255 | public:
256 | UClass* MetaClass;
257 | };
258 |
259 | class UInterfaceProperty : public UProperty
260 | {
261 | public:
262 | UClass* InterfaceClass;
263 | };
264 |
265 | class UNameProperty : public UProperty
266 | {
267 | public:
268 |
269 | };
270 |
271 | class UStructProperty : public UProperty
272 | {
273 | public:
274 | UStruct* Struct;
275 | };
276 |
277 | class UStrProperty : public UProperty
278 | {
279 | public:
280 |
281 | };
282 |
283 | class UArrayProperty : public UProperty
284 | {
285 | public:
286 | UProperty* Inner;
287 | };
288 |
289 | class UMapProperty : public UProperty
290 | {
291 | public:
292 | UProperty* KeyProp;
293 | UProperty* ValueProp;
294 | };
295 |
296 | class UDelegateProperty : public UProperty
297 | {
298 | public:
299 | UFunction* SignatureFunction;
300 | };
301 |
--------------------------------------------------------------------------------
/Target/Borderlands2/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | char UnknownData00[0x10];
12 | char Name[1024];
13 |
14 | std::string GetName() const
15 | {
16 | return Name;
17 | }
18 | };
19 |
20 | TArray* GlobalNames = nullptr;
21 |
22 | bool NamesStore::Initialize()
23 | {
24 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x8B\x0D\x00\x00\x00\x00\x83\x3C\x81\x00\x74"), "xx????xxxxx");
25 | if (address == -1)
26 | {
27 | return false;
28 | }
29 |
30 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 2));
31 |
32 | return true;
33 | }
34 |
35 | void* NamesStore::GetAddress()
36 | {
37 | return GlobalNames;
38 | }
39 |
40 | size_t NamesStore::GetNamesNum() const
41 | {
42 | return GlobalNames->Num();
43 | }
44 |
45 | bool NamesStore::IsValid(size_t id) const
46 | {
47 | return GlobalNames->IsValidIndex(id) && (*GlobalNames)[id] != nullptr;
48 | }
49 |
50 | std::string NamesStore::GetById(size_t id) const
51 | {
52 | return (*GlobalNames)[id]->GetName();
53 | }
54 |
--------------------------------------------------------------------------------
/Target/Borderlands2/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | TArray* GlobalObjects = nullptr;
9 |
10 | bool ObjectsStore::Initialize()
11 | {
12 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\xA1\x00\x00\x00\x00\x8B\x00\x00\x8B\x00\x00\x25\x00\x02\x00\x00"), "x????x??x??xxxxx");
13 | if (address == -1)
14 | {
15 | return false;
16 | }
17 |
18 | GlobalObjects = reinterpret_cast(*reinterpret_cast(address + 1));
19 |
20 | return true;
21 | }
22 |
23 | void* ObjectsStore::GetAddress()
24 | {
25 | return GlobalObjects;
26 | }
27 |
28 | size_t ObjectsStore::GetObjectsNum() const
29 | {
30 | return GlobalObjects->Num();
31 | }
32 |
33 | UEObject ObjectsStore::GetById(size_t id) const
34 | {
35 | return (*GlobalObjects)[id];
36 | }
37 |
--------------------------------------------------------------------------------
/Target/Fortnite/Fortnite.rcnet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/polivilas/UnrealEngineSDKGenerator/0589f640fa61c05316c1708e6c3b9ab3e13eb6aa/Target/Fortnite/Fortnite.rcnet
--------------------------------------------------------------------------------
/Target/Fortnite/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | __int32 Index;
12 | char pad_0x0004[0x4];
13 | FNameEntry* HashNext;
14 | union
15 | {
16 | char AnsiName[1024];
17 | wchar_t WideName[1024];
18 | };
19 |
20 | const char* GetName() const
21 | {
22 | return AnsiName;
23 | }
24 | };
25 |
26 | template
27 | class TStaticIndirectArrayThreadSafeRead
28 | {
29 | public:
30 | int32_t Num() const
31 | {
32 | return NumElements;
33 | }
34 |
35 | bool IsValidIndex(int32_t index) const
36 | {
37 | return index >= 0 && index < Num() && GetById(index) != nullptr;
38 | }
39 |
40 | ElementType const* const& GetById(int32_t index) const
41 | {
42 | return *GetItemPtr(index);
43 | }
44 |
45 | private:
46 | ElementType const* const* GetItemPtr(int32_t Index) const
47 | {
48 | int32_t ChunkIndex = Index / ElementsPerChunk;
49 | int32_t WithinChunkIndex = Index % ElementsPerChunk;
50 | ElementType** Chunk = Chunks[ChunkIndex];
51 | return Chunk + WithinChunkIndex;
52 | }
53 |
54 | enum
55 | {
56 | ChunkTableSize = (MaxTotalElements + ElementsPerChunk - 1) / ElementsPerChunk
57 | };
58 |
59 | ElementType** Chunks[ChunkTableSize];
60 | __int32 NumElements;
61 | __int32 NumChunks;
62 | };
63 |
64 | using TNameEntryArray = TStaticIndirectArrayThreadSafeRead;
65 |
66 | TNameEntryArray* GlobalNames = nullptr;
67 |
68 | bool NamesStore::Initialize()
69 | {
70 | const auto address = FindPattern(GetModuleHandleW(L"FortniteClient-Win64-Shipping.exe"), reinterpret_cast("\x48\x89\x1D\x00\x00\x00\x00\x48\x8B\x5C\x24\x00\x48\x83\xC4\x28\xC3\x48\x8B\x5C\x24\x00\x48\x89\x05\x00\x00\x00\x00\x48\x83\xC4\x28\xC3"), "xxx????xxxx?xxxxxxxxx?xxx????xxxxx");
71 | if (address == -1)
72 | {
73 | return false;
74 | }
75 |
76 | const auto offset = *reinterpret_cast(address + 3);
77 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 7 + offset));
78 |
79 | return true;
80 | }
81 |
82 | void* NamesStore::GetAddress()
83 | {
84 | return GlobalNames;
85 | }
86 |
87 | size_t NamesStore::GetNamesNum() const
88 | {
89 | return GlobalNames->Num();
90 | }
91 |
92 | bool NamesStore::IsValid(size_t id) const
93 | {
94 | return GlobalNames->IsValidIndex(static_cast(id));
95 | }
96 |
97 | std::string NamesStore::GetById(size_t id) const
98 | {
99 | return GlobalNames->GetById(static_cast(id))->GetName();
100 | }
101 |
--------------------------------------------------------------------------------
/Target/Fortnite/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FUObjectItem
9 | {
10 | public:
11 | UObject* Object; //0x0000
12 | __int32 Flags; //0x0008
13 | __int32 ClusterIndex; //0x000C
14 | __int32 SerialNumber; //0x0010
15 | };
16 |
17 | class TUObjectArray
18 | {
19 | public:
20 | FUObjectItem* Objects;
21 | int32_t MaxElements;
22 | int32_t NumElements;
23 | };
24 |
25 | class FUObjectArray
26 | {
27 | public:
28 | __int32 ObjFirstGCIndex; //0x0000
29 | __int32 ObjLastNonGCIndex; //0x0004
30 | __int32 MaxObjectsNotConsideredByGC; //0x0008
31 | __int32 OpenForDisregardForGC; //0x000C
32 |
33 | TUObjectArray ObjObjects; //0x0010
34 | };
35 |
36 | FUObjectArray* GlobalObjects = nullptr;
37 |
38 | bool ObjectsStore::Initialize()
39 | {
40 | const auto address = FindPattern(GetModuleHandleW(L"FortniteClient-Win64-Shipping.exe"), reinterpret_cast("\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x01\x33\xC9\x84\xD2\x41\x8B\x40\x08\x49\x89\x48\x10\x0F\x45\x05\x00\x00\x00\x00\xFF\xC0\x49\x89\x48\x10\x41\x89\x40\x08"), "xxx????xxxxxxxxxxxxxxxxxx????xxxxxxxxxx");
41 | if (address == -1)
42 | {
43 | return false;
44 | }
45 |
46 | const auto offset = *reinterpret_cast(address + 3);
47 | GlobalObjects = reinterpret_cast(address + 7 + offset);
48 |
49 | return true;
50 | }
51 |
52 | void* ObjectsStore::GetAddress()
53 | {
54 | return GlobalObjects;
55 | }
56 |
57 | size_t ObjectsStore::GetObjectsNum() const
58 | {
59 | return GlobalObjects->ObjObjects.NumElements;
60 | }
61 |
62 | UEObject ObjectsStore::GetById(size_t id) const
63 | {
64 | return GlobalObjects->ObjObjects.Objects[id].Object;
65 | }
66 |
--------------------------------------------------------------------------------
/Target/Hawken/EngineClasses.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | struct FPointer
8 | {
9 | uintptr_t Dummy;
10 | };
11 |
12 | struct FQWord
13 | {
14 | int A;
15 | int B;
16 | };
17 |
18 | struct FName
19 | {
20 | int32_t Index;
21 | int32_t Number;
22 | };
23 |
24 | template
25 | struct TArray
26 | {
27 | friend struct FString;
28 |
29 | public:
30 | TArray()
31 | {
32 | Data = nullptr;
33 | Count = Max = 0;
34 | };
35 |
36 | size_t Num() const
37 | {
38 | return Count;
39 | };
40 |
41 | T& operator[](size_t i)
42 | {
43 | return Data[i];
44 | };
45 |
46 | const T& operator[](size_t i) const
47 | {
48 | return Data[i];
49 | };
50 |
51 | bool IsValidIndex(size_t i) const
52 | {
53 | return i < Num();
54 | }
55 |
56 | private:
57 | T* Data;
58 | int32_t Count;
59 | int32_t Max;
60 | };
61 |
62 | struct FString : public TArray
63 | {
64 | std::string ToString() const
65 | {
66 | int size = WideCharToMultiByte(CP_UTF8, 0, Data, Count - 1, nullptr, 0, nullptr, nullptr);
67 | std::string str(size, 0);
68 | WideCharToMultiByte(CP_UTF8, 0, Data, Count - 1, &str[0], size, nullptr, nullptr);
69 | return str;
70 | }
71 | };
72 |
73 | class FScriptInterface
74 | {
75 | private:
76 | UObject* ObjectPointer;
77 | void* InterfacePointer;
78 |
79 | public:
80 | UObject* GetObject() const
81 | {
82 | return ObjectPointer;
83 | }
84 |
85 | UObject*& GetObjectRef()
86 | {
87 | return ObjectPointer;
88 | }
89 |
90 | void* GetInterface() const
91 | {
92 | return ObjectPointer != nullptr ? InterfacePointer : nullptr;
93 | }
94 | };
95 |
96 | template
97 | class TScriptInterface : public FScriptInterface
98 | {
99 | public:
100 | InterfaceType* operator->() const
101 | {
102 | return (InterfaceType*)GetInterface();
103 | }
104 |
105 | InterfaceType& operator*() const
106 | {
107 | return *((InterfaceType*)GetInterface());
108 | }
109 |
110 | operator bool() const
111 | {
112 | return GetInterface() != nullptr;
113 | }
114 | };
115 |
116 | struct FScriptDelegate
117 | {
118 | unsigned char UnknownData[0x0C];
119 | };
120 |
121 | class UClass;
122 |
123 | class UObject
124 | {
125 | public:
126 | FPointer VTableObject;
127 | char UnknownData00[0x1C];
128 | uint32_t InternalIndex;
129 | char UnknownData01[0x04];
130 | UObject* Outer;
131 | FName Name;
132 | UObject* Class;
133 | UObject* ObjectArchetype;
134 | };
135 |
136 | class UField : public UObject
137 | {
138 | public:
139 | UField* Next;
140 | };
141 |
142 | class UEnum : public UField
143 | {
144 | public:
145 | TArray Names;
146 | };
147 |
148 | class UConst : public UField
149 | {
150 | public:
151 | FString Value;
152 | };
153 |
154 | class UStruct : public UField
155 | {
156 | public:
157 | char UnknownData00[0x08];
158 | UField* SuperField;
159 | UField* Children;
160 | uint32_t PropertySize;
161 | char UnknownData01[0x30];
162 | };
163 |
164 | class UScriptStruct : public UStruct
165 | {
166 | public:
167 | char UnknownData00[0x1C];
168 | };
169 |
170 | class UFunction : public UStruct
171 | {
172 | public:
173 | uint32_t FunctionFlags;
174 | uint16_t iNative;
175 | uint16_t RepOffset;
176 | FName FriendlyName;
177 | uint8_t OperPrecendence;
178 | uint8_t NumParms;
179 | uint16_t ParmsSize;
180 | uint16_t ReturnValueOffset;
181 | void* Func;
182 | };
183 |
184 | class UState : public UStruct
185 | {
186 | public:
187 | char UnknownData00[0x48];
188 | };
189 |
190 | class UClass : public UStruct
191 | {
192 | public:
193 | char UnknownData00[0x88];
194 | UObject* ClassDefaultObject;
195 | char UnknownData01[0x70];
196 | };
197 |
198 | class UProperty : public UField
199 | {
200 | public:
201 | uint32_t ArrayDim;
202 | uint32_t ElementSize;
203 | FQWord PropertyFlags;
204 | uint32_t PropertySize;
205 | char UnknownData00[0x0C];
206 | uint32_t Offset;
207 | char UnknownData01[0x0C];
208 | };
209 |
210 | class UByteProperty : public UProperty
211 | {
212 | public:
213 | UEnum* Enum;
214 | };
215 |
216 | class UIntProperty : public UProperty
217 | {
218 | public:
219 |
220 | };
221 |
222 | class UFloatProperty : public UProperty
223 | {
224 | public:
225 |
226 | };
227 |
228 | class UDoubleProperty : public UProperty
229 | {
230 | public:
231 |
232 | };
233 |
234 | class UBoolProperty : public UProperty
235 | {
236 | public:
237 | unsigned long BitMask;
238 | };
239 |
240 | class UObjectProperty : public UProperty
241 | {
242 | public:
243 | UClass* PropertyClass;
244 | };
245 |
246 | class UComponentProperty : public UObjectProperty
247 | {
248 | public:
249 |
250 | };
251 |
252 | class UClassProperty : public UObjectProperty
253 | {
254 | public:
255 | UClass* MetaClass;
256 | };
257 |
258 | class UInterfaceProperty : public UProperty
259 | {
260 | public:
261 | UClass* InterfaceClass;
262 | };
263 |
264 | class UNameProperty : public UProperty
265 | {
266 | public:
267 |
268 | };
269 |
270 | class UStructProperty : public UProperty
271 | {
272 | public:
273 | UStruct* Struct;
274 | };
275 |
276 | class UStrProperty : public UProperty
277 | {
278 | public:
279 |
280 | };
281 |
282 | class UArrayProperty : public UProperty
283 | {
284 | public:
285 | UProperty* Inner;
286 | };
287 |
288 | class UMapProperty : public UProperty
289 | {
290 | public:
291 | UProperty* KeyProp;
292 | UProperty* ValueProp;
293 | };
294 |
295 | class UDelegateProperty : public UProperty
296 | {
297 | public:
298 | UFunction* SignatureFunction;
299 | };
300 |
--------------------------------------------------------------------------------
/Target/Hawken/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | static const auto NAME_WIDE_MASK = 0x1;
11 | static const auto NAME_INDEX_SHIFT = 1;
12 |
13 | public:
14 | uint64_t Flags;
15 | uint32_t Index;
16 | FNameEntry* HashNext;
17 | union
18 | {
19 | char AnsiName[1024];
20 | wchar_t WideName[1024];
21 | };
22 |
23 | const int32_t GetIndex() const
24 | {
25 | return Index >> NAME_INDEX_SHIFT;
26 | }
27 |
28 | bool IsWide() const
29 | {
30 | return Index & NAME_WIDE_MASK;
31 | }
32 |
33 | const char* GetAnsiName() const
34 | {
35 | return AnsiName;
36 | }
37 |
38 | const wchar_t* GetWideName() const
39 | {
40 | return WideName;
41 | }
42 |
43 | std::string GetName() const
44 | {
45 | if (IsWide())
46 | {
47 | auto length = std::wcslen(WideName);
48 |
49 | std::string str(length, '\0');
50 |
51 | std::use_facet>(std::locale()).narrow(WideName, WideName + length, '?', &str[0]);
52 |
53 | return str;
54 | }
55 | else
56 | {
57 | return AnsiName;
58 | }
59 | }
60 | };
61 |
62 | TArray* GlobalNames = nullptr;
63 |
64 | bool NamesStore::Initialize()
65 | {
66 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x8B\x0D\x00\x00\x00\x00\x83\x3C\x81\x00\x74"), "xx????xxxxx");
67 | if (address == -1)
68 | {
69 | return false;
70 | }
71 |
72 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 2));
73 |
74 | return true;
75 | }
76 |
77 | void* NamesStore::GetAddress()
78 | {
79 | return GlobalNames;
80 | }
81 |
82 | size_t NamesStore::GetNamesNum() const
83 | {
84 | return GlobalNames->Num();
85 | }
86 |
87 | bool NamesStore::IsValid(size_t id) const
88 | {
89 | return GlobalNames->IsValidIndex(id) && (*GlobalNames)[id] != nullptr;
90 | }
91 |
92 | std::string NamesStore::GetById(size_t id) const
93 | {
94 | return (*GlobalNames)[id]->GetName();
95 | }
96 |
--------------------------------------------------------------------------------
/Target/Hawken/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | TArray* GlobalObjects = nullptr;
9 |
10 | bool ObjectsStore::Initialize()
11 | {
12 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\xA1\x00\x00\x00\x00\x8B\x00\x00\x8B\x00\x00\x25\x00\x02\x00\x00"), "x????x??x??xxxxx");
13 | if (address == -1)
14 | {
15 | return false;
16 | }
17 |
18 | GlobalObjects = reinterpret_cast(*reinterpret_cast(address + 1));
19 |
20 | return true;
21 | }
22 |
23 | void* ObjectsStore::GetAddress()
24 | {
25 | return GlobalObjects;
26 | }
27 |
28 | size_t ObjectsStore::GetObjectsNum() const
29 | {
30 | return GlobalObjects->Num();
31 | }
32 |
33 | UEObject ObjectsStore::GetById(size_t id) const
34 | {
35 | return (*GlobalObjects)[id];
36 | }
37 |
--------------------------------------------------------------------------------
/Target/PUBG/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | __int32 Index;
12 | char pad_0x0004[0x4];
13 | FNameEntry* HashNext;
14 | union
15 | {
16 | char AnsiName[1024];
17 | wchar_t WideName[1024];
18 | };
19 |
20 | const char* GetName() const
21 | {
22 | return AnsiName;
23 | }
24 | };
25 |
26 | template
27 | class TStaticIndirectArrayThreadSafeRead
28 | {
29 | public:
30 | int32_t Num() const
31 | {
32 | return NumElements;
33 | }
34 |
35 | bool IsValidIndex(int32_t index) const
36 | {
37 | return index >= 0 && index < Num() && GetById(index) != nullptr;
38 | }
39 |
40 | ElementType const* const& GetById(int32_t index) const
41 | {
42 | return *GetItemPtr(index);
43 | }
44 |
45 | private:
46 | ElementType const* const* GetItemPtr(int32_t Index) const
47 | {
48 | int32_t ChunkIndex = Index / ElementsPerChunk;
49 | int32_t WithinChunkIndex = Index % ElementsPerChunk;
50 | ElementType** Chunk = Chunks[ChunkIndex];
51 | return Chunk + WithinChunkIndex;
52 | }
53 |
54 | enum
55 | {
56 | ChunkTableSize = (MaxTotalElements + ElementsPerChunk - 1) / ElementsPerChunk
57 | };
58 |
59 | ElementType** Chunks[ChunkTableSize];
60 | __int32 NumElements;
61 | __int32 NumChunks;
62 | };
63 |
64 | using TNameEntryArray = TStaticIndirectArrayThreadSafeRead;
65 |
66 | TNameEntryArray* GlobalNames = nullptr;
67 |
68 | bool NamesStore::Initialize()
69 | {
70 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x89\x1D\x00\x00\x00\x00\x48\x8B\x5C\x24\x00\x48\x83\xC4\x28\xC3\x48\x8B\x5C\x24\x00\x48\x89\x05\x00\x00\x00\x00\x48\x83\xC4\x28\xC3"), "xxx????xxxx?xxxxxxxxx?xxx????xxxxx");
71 | if (address == -1)
72 | {
73 | return false;
74 | }
75 |
76 | auto offset = *reinterpret_cast(address + 3);
77 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 7 + offset));
78 |
79 | return true;
80 | }
81 |
82 | void* NamesStore::GetAddress()
83 | {
84 | return GlobalNames;
85 | }
86 |
87 | size_t NamesStore::GetNamesNum() const
88 | {
89 | return GlobalNames->Num();
90 | }
91 |
92 | bool NamesStore::IsValid(size_t id) const
93 | {
94 | return GlobalNames->IsValidIndex(static_cast(id));
95 | }
96 |
97 | std::string NamesStore::GetById(size_t id) const
98 | {
99 | return GlobalNames->GetById(static_cast(id))->GetName();
100 | }
101 |
--------------------------------------------------------------------------------
/Target/PUBG/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FUObjectItem
9 | {
10 | public:
11 | UObject* Object; //0x0000
12 | __int32 Flags; //0x0008
13 | __int32 ClusterIndex; //0x000C
14 | __int32 SerialNumber; //0x0010
15 | };
16 |
17 | class TUObjectArray
18 | {
19 | public:
20 | FUObjectItem* Objects;
21 | int32_t MaxElements;
22 | int32_t NumElements;
23 | };
24 |
25 | class FUObjectArray
26 | {
27 | public:
28 | __int32 ObjFirstGCIndex; //0x0000
29 | __int32 ObjLastNonGCIndex; //0x0004
30 | __int32 MaxObjectsNotConsideredByGC; //0x0008
31 | __int32 OpenForDisregardForGC; //0x000C
32 |
33 | TUObjectArray ObjObjects; //0x0010
34 | };
35 |
36 | FUObjectArray* GlobalObjects = nullptr;
37 |
38 | bool ObjectsStore::Initialize()
39 | {
40 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x8D\x0D\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x8B\xD6\x48\x89\xB5"), "xxx????x????x????xxxxxx");
41 | if (address == -1)
42 | {
43 | return false;
44 | }
45 | auto offset = *reinterpret_cast(address + 3);
46 | GlobalObjects = reinterpret_cast(address + 7 + offset);
47 |
48 | return true;
49 | }
50 |
51 | void* ObjectsStore::GetAddress()
52 | {
53 | return GlobalObjects;
54 | }
55 |
56 | size_t ObjectsStore::GetObjectsNum() const
57 | {
58 | return GlobalObjects->ObjObjects.NumElements;
59 | }
60 |
61 | UEObject ObjectsStore::GetById(size_t id) const
62 | {
63 | return GlobalObjects->ObjObjects.Objects[id].Object;
64 | }
65 |
--------------------------------------------------------------------------------
/Target/Paragon/NamesStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "NamesStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FNameEntry
9 | {
10 | public:
11 | __int32 Index;
12 | char pad_0x0004[0x4];
13 | FNameEntry* HashNext;
14 | union
15 | {
16 | char AnsiName[1024];
17 | wchar_t WideName[1024];
18 | };
19 |
20 | const char* GetName() const
21 | {
22 | return AnsiName;
23 | }
24 | };
25 |
26 | template
27 | class TStaticIndirectArrayThreadSafeRead
28 | {
29 | public:
30 | int32_t Num() const
31 | {
32 | return NumElements;
33 | }
34 |
35 | bool IsValidIndex(int32_t index) const
36 | {
37 | return index >= 0 && index < Num() && GetById(index) != nullptr;
38 | }
39 |
40 | ElementType const* const& GetById(int32_t index) const
41 | {
42 | return *GetItemPtr(index);
43 | }
44 |
45 | private:
46 | ElementType const* const* GetItemPtr(int32_t Index) const
47 | {
48 | int32_t ChunkIndex = Index / ElementsPerChunk;
49 | int32_t WithinChunkIndex = Index % ElementsPerChunk;
50 | ElementType** Chunk = Chunks[ChunkIndex];
51 | return Chunk + WithinChunkIndex;
52 | }
53 |
54 | enum
55 | {
56 | ChunkTableSize = (MaxTotalElements + ElementsPerChunk - 1) / ElementsPerChunk
57 | };
58 |
59 | ElementType** Chunks[ChunkTableSize];
60 | __int32 NumElements;
61 | __int32 NumChunks;
62 | };
63 |
64 | using TNameEntryArray = TStaticIndirectArrayThreadSafeRead;
65 |
66 | TNameEntryArray* GlobalNames = nullptr;
67 |
68 | bool NamesStore::Initialize()
69 | {
70 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x89\x05\x00\x00\x00\x00\x48\x83\xC4\x28\xC3\xE9"), "xxx????xxxxxx");
71 | if (address == -1)
72 | {
73 | return false;
74 | }
75 |
76 | auto offset = *reinterpret_cast(address + 3);
77 | GlobalNames = reinterpret_cast(*reinterpret_cast(address + 7 + offset));
78 |
79 | return true;
80 | }
81 |
82 | void* NamesStore::GetAddress()
83 | {
84 | return GlobalNames;
85 | }
86 |
87 | size_t NamesStore::GetNamesNum() const
88 | {
89 | return GlobalNames->Num();
90 | }
91 |
92 | bool NamesStore::IsValid(size_t id) const
93 | {
94 | return GlobalNames->IsValidIndex(static_cast(id));
95 | }
96 |
97 | std::string NamesStore::GetById(size_t id) const
98 | {
99 | return GlobalNames->GetById(static_cast(id))->GetName();
100 | }
101 |
--------------------------------------------------------------------------------
/Target/Paragon/ObjectsStore.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "PatternFinder.hpp"
4 | #include "ObjectsStore.hpp"
5 |
6 | #include "EngineClasses.hpp"
7 |
8 | class FUObjectItem
9 | {
10 | public:
11 | UObject* Object; //0x0000
12 | __int32 Flags; //0x0008
13 | __int32 ClusterIndex; //0x000C
14 | __int32 SerialNumber; //0x0010
15 | };
16 |
17 | class TUObjectArray
18 | {
19 | public:
20 | FUObjectItem* Objects;
21 | int32_t MaxElements;
22 | int32_t NumElements;
23 | };
24 |
25 | class FUObjectArray
26 | {
27 | public:
28 | __int32 ObjFirstGCIndex; //0x0000
29 | __int32 ObjLastNonGCIndex; //0x0004
30 | __int32 MaxObjectsNotConsideredByGC; //0x0008
31 | __int32 OpenForDisregardForGC; //0x000C
32 |
33 | TUObjectArray ObjObjects; //0x0010
34 | };
35 |
36 | FUObjectArray* GlobalObjects = nullptr;
37 |
38 | bool ObjectsStore::Initialize()
39 | {
40 | auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast("\x48\x8D\x15\x00\x00\x00\x00\x48\x8D\x4C\x24\x00\x45\x8B\xFE"), "xxx????xxxx?xxx");
41 | if (address == -1)
42 | {
43 | return false;
44 | }
45 | auto offset = *reinterpret_cast