Skip to content

Commit f64da25

Browse files
authored
Merge pull request #9 from qudix/dev/ue
feat: more `UE` stuff
2 parents 86bedfd + 800368e commit f64da25

61 files changed

Lines changed: 1328 additions & 114 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/RE/IDs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ namespace UE::ID
7171
namespace FName
7272
{
7373
inline constexpr REL::Offset Ctor1{ 0x0F45900 };
74+
inline constexpr REL::Offset Ctor2{ 0x0F45A70 };
7475
inline constexpr REL::Offset AppendString{ 0x0F4B710 };
7576
inline constexpr REL::Offset ToString{ 0x0F61010 };
7677
}
@@ -114,5 +115,7 @@ namespace UE::ID
114115
}
115116

116117
inline constexpr REL::Offset StaticFindObjectFast{ 0x112C350 };
118+
inline constexpr REL::Offset StaticFindObjectFastSafe{ 0x112CC40 };
117119
inline constexpr REL::Offset StaticFindObject{ 0x112C0F0 };
120+
inline constexpr REL::Offset StaticFindObjectSafe{ 0x112CCE0 };
118121
}

include/REX/W32/KERNEL32.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ namespace REX::W32
347347
};
348348
static_assert(sizeof(PROCESS_INFORMATION) == 0x18);
349349

350+
struct SRWLOCK
351+
{
352+
void* ptr;
353+
};
354+
static_assert(sizeof(SRWLOCK) == 0x08);
355+
350356
struct STARTUPINFOA
351357
{
352358
std::uint32_t size;
@@ -454,6 +460,8 @@ namespace REX::W32
454460

455461
namespace REX::W32
456462
{
463+
void AcquireSRWLockShared(SRWLOCK* a_lock) noexcept;
464+
void AcquireSRWLockExclusive(SRWLOCK* a_lock) noexcept;
457465
bool CloseHandle(HANDLE a_handle) noexcept;
458466
HANDLE CreateFileA(const char* a_fileName, std::uint32_t a_desiredAccess, std::uint32_t a_shareMode, SECURITY_ATTRIBUTES* a_attributes, std::uint32_t a_creationDisposition, std::uint32_t a_flags, HANDLE a_templateFile);
459467
HANDLE CreateFileW(const wchar_t* a_fileName, std::uint32_t a_desiredAccess, std::uint32_t a_shareMode, SECURITY_ATTRIBUTES* a_attributes, std::uint32_t a_creationDisposition, std::uint32_t a_flags, HANDLE a_templateFile);
@@ -496,8 +504,9 @@ namespace REX::W32
496504
void GetSystemInfo(SYSTEM_INFO* a_info) noexcept;
497505
bool IMAGE_SNAP_BY_ORDINAL64(std::uint64_t a_ordinal) noexcept;
498506
IMAGE_SECTION_HEADER* IMAGE_FIRST_SECTION(const IMAGE_NT_HEADERS64* a_header) noexcept;
499-
void InitializeCriticalSection(CRITICAL_SECTION* a_criticalSection);
500-
bool InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION* a_criticalSection, std::uint32_t a_spinCount);
507+
void InitializeCriticalSection(CRITICAL_SECTION* a_criticalSection) noexcept;
508+
bool InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION* a_criticalSection, std::uint32_t a_spinCount) noexcept;
509+
void InitializeSRWLock(SRWLOCK* a_lock) noexcept;
501510
std::uint32_t InterlockedCompareExchange(volatile std::uint32_t* a_target, std::uint32_t a_value, std::uint32_t a_compare) noexcept;
502511
std::uint64_t InterlockedCompareExchange64(volatile std::uint64_t* a_target, std::uint64_t a_value, std::uint64_t a_compare) noexcept;
503512
std::uint32_t InterlockedDecrement(volatile std::uint32_t* a_target) noexcept;
@@ -520,6 +529,8 @@ namespace REX::W32
520529
void OutputDebugStringW(const wchar_t* a_str) noexcept;
521530
bool QueryPerformanceCounter(std::int64_t* a_counter) noexcept;
522531
bool QueryPerformanceFrequency(std::int64_t* a_frequency) noexcept;
532+
void ReleaseSRWLockShared(SRWLOCK* a_lock) noexcept;
533+
void ReleaseSRWLockExclusive(SRWLOCK* a_lock) noexcept;
523534
std::uint32_t ResumeThread(HANDLE a_handle) noexcept;
524535
std::uint32_t SetCriticalSectionSpinCount(CRITICAL_SECTION* a_criticalSection, std::uint32_t a_spinCount) noexcept;
525536
bool SetEnvironmentVariableA(const char* a_name, const char* a_value) noexcept;
@@ -528,6 +539,8 @@ namespace REX::W32
528539
bool TerminateProcess(HANDLE a_process, std::uint32_t a_exitCode) noexcept;
529540
void* TlsGetValue(std::uint32_t a_index) noexcept;
530541
bool TlsSetValue(std::uint32_t a_index, void* a_value) noexcept;
542+
bool TryAcquireSRWLockExclusive(SRWLOCK* a_lock) noexcept;
543+
bool TryAcquireSRWLockShared(SRWLOCK* a_lock) noexcept;
531544
bool TryEnterCriticalSection(CRITICAL_SECTION* a_criticalSection) noexcept;
532545
bool UnmapViewOfFile(const void* a_baseAddress) noexcept;
533546
void* VirtualAlloc(void* a_address, std::size_t a_size, std::uint32_t a_type, std::uint32_t a_protect) noexcept;

include/UE/A/AActor.h

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#pragma once
2+
3+
#include "UE/E/EAutoReceiveInput.h"
4+
#include "UE/E/ENetDormancy.h"
5+
#include "UE/E/ENetRole.h"
6+
#include "UE/E/EPhysicsReplicationMode.h"
7+
#include "UE/E/ESpawnActorCollisionHandlingMethod.h"
8+
#include "UE/F/FActorTickFunction.h"
9+
#include "UE/F/FRenderCommandFence.h"
10+
#include "UE/F/FRepAttachment.h"
11+
#include "UE/F/FRepMovement.h"
12+
#include "UE/F/FTimerHandle.h"
13+
#include "UE/T/TObjectPtr.h"
14+
#include "UE/T/TWeakObjectPtr.h"
15+
#include "UE/U/UObject.h"
16+
17+
namespace UE::Net
18+
{
19+
class FReplicatedComponentInfo;
20+
}
21+
22+
namespace UE
23+
{
24+
class APawn;
25+
class UActorComponent;
26+
class UChildActorComponent;
27+
class UInputComponent;
28+
class USceneComponent;
29+
30+
enum class EActorUpdateOverlapsMethod : std::uint8_t
31+
{
32+
UseConfigDefault,
33+
AlwaysUpdate,
34+
OnlyUpdateMovable,
35+
NeverUpdate
36+
};
37+
38+
enum class ESpawnActorScaleMethod : std::uint8_t
39+
{
40+
OverrideRootScale,
41+
MultiplyWithRoot,
42+
SelectDefaultAtRuntime,
43+
};
44+
45+
class AActor :
46+
public UObject
47+
{
48+
public:
49+
UE_DEFINE_OBJECT("/Script/Engine", "Actor");
50+
51+
enum class EActorBeginPlayState : std::uint8_t
52+
{
53+
HasNotBegunPlay,
54+
BeginningPlay,
55+
HasBegunPlay,
56+
};
57+
58+
// override
59+
virtual ~AActor(); // 00
60+
61+
// members
62+
FActorTickFunction primaryActorTick;
63+
std::uint8_t netTemporary: 1;
64+
std::uint8_t netStartup: 1;
65+
std::uint8_t onlyRelevantToOwner: 1;
66+
std::uint8_t alwaysRelevant: 1;
67+
std::uint8_t replicateMovement: 1;
68+
std::uint8_t callPreReplication: 1;
69+
std::uint8_t callPreReplicationForReplay: 1;
70+
std::uint8_t hidden: 1;
71+
std::uint8_t tearOff: 1;
72+
std::uint8_t forceNetAddressable: 1;
73+
std::uint8_t exchangedRoles: 1;
74+
std::uint8_t netLoadOnClient: 1;
75+
std::uint8_t netUseOwnerRelevancy: 1;
76+
std::uint8_t relevantForNetworkReplays: 1;
77+
std::uint8_t relevantForLevelBounds: 1;
78+
std::uint8_t replayRewindable: 1;
79+
std::uint8_t allowTickBeforeBeginPlay: 1;
80+
std::uint8_t autoDestroyWhenFinished: 1;
81+
std::uint8_t canBeDamaged: 1;
82+
std::uint8_t blockInput: 1;
83+
std::uint8_t collideWhenPlacing: 1;
84+
std::uint8_t findCameraComponentWhenViewTarget: 1;
85+
std::uint8_t generateOverlapEventsDuringLevelStreaming: 1;
86+
std::uint8_t ignoresOriginShifting: 1;
87+
std::uint8_t enableAutoLODGeneration: 1;
88+
std::uint8_t isEditorOnlyActor: 1;
89+
std::uint8_t actorSeamlessTraveled: 1;
90+
std::uint8_t replicates: 1;
91+
std::uint8_t canBeInCluster: 1;
92+
std::uint8_t allowReceiveTickEventOnDedicatedServer: 1;
93+
std::uint8_t netCheckedInitialPhysicsState: 1;
94+
std::uint8_t replicateUsingRegisteredSubObjectList: 1;
95+
std::uint8_t hasFinishedSpawning: 1;
96+
std::uint8_t actorInitialized: 1;
97+
std::uint8_t actorBeginningPlayFromLevelStreaming: 1;
98+
std::uint8_t tickFunctionsRegistered: 1;
99+
std::uint8_t hasDeferredComponentRegistration: 1;
100+
std::uint8_t runningUserConstructionScript: 1;
101+
std::uint8_t hasRegisteredAllComponents: 1;
102+
std::uint8_t actorEnableCollision: 1;
103+
std::uint8_t actorIsBeingDestroyed: 1;
104+
std::uint8_t actorWantsDestroyDuringBeginPlay: 1;
105+
EActorBeginPlayState actorHasBegunPlay: 2;
106+
std::uint8_t actorIsBeingConstructed: 1;
107+
std::uint8_t asyncPhysicsTickEnabled: 1;
108+
EActorUpdateOverlapsMethod updateOverlapsMethodDuringLevelStreaming;
109+
EActorUpdateOverlapsMethod defaultUpdateOverlapsMethodDuringLevelStreaming;
110+
float initialLifeSpan;
111+
float customTimeDilation;
112+
TEnumAsByte<ENetRole> remoteRole;
113+
std::int32_t rayTracingGroupId;
114+
FRepAttachment attachmentReplication;
115+
FRepMovement replicatedMovement;
116+
TObjectPtr<AActor> owner;
117+
FName netDriverName;
118+
TEnumAsByte<ENetRole> role;
119+
TEnumAsByte<ENetDormancy> netDormancy;
120+
ESpawnActorCollisionHandlingMethod spawnCollisionHandlingMethod;
121+
TEnumAsByte<EAutoReceiveInput> autoReceiveInput;
122+
std::int32_t inputPriority;
123+
float creationTime;
124+
TObjectPtr<UInputComponent> inputComponent;
125+
float netCullDistanceSquared;
126+
std::int32_t netTag;
127+
float netUpdateFrequency;
128+
float minNetUpdateFrequency;
129+
float netPriority;
130+
EPhysicsReplicationMode physicsReplicationMode;
131+
float lastRenderTime;
132+
TObjectPtr<APawn> instigator;
133+
TArray<TObjectPtr<AActor>> children;
134+
TObjectPtr<USceneComponent> rootComponent;
135+
FTimerHandle timerHandle_LifeSpanExpired;
136+
TArray<FName> layers;
137+
TWeakObjectPtr<UChildActorComponent> parentComponent;
138+
TArray<FName> tags;
139+
std::uint8_t onTakeAnyDamage; // - FTakeAnyDamageSignature
140+
std::uint8_t onTakePointDamage; // - FTakePointDamageSignature
141+
std::uint8_t onTakeRadialDamage; // - FTakeRadialDamageSignature
142+
std::uint8_t onActorBeginOverlap; // - FActorBeginOverlapSignature
143+
std::uint8_t onActorEndOverlap; // - FActorEndOverlapSignature
144+
std::uint8_t onBeginCursorOver; // - FActorBeginCursorOverSignature
145+
std::uint8_t onEndCursorOver; // - FActorEndCursorOverSignature
146+
std::uint8_t onClicked; // - FActorOnClickedSignature
147+
std::uint8_t onReleased; // - FActorOnReleasedSignature
148+
std::uint8_t onInputTouchBegin; // - FActorOnInputTouchBeginSignature
149+
std::uint8_t onInputTouchEnd; // - FActorOnInputTouchEndSignature
150+
std::uint8_t onInputTouchEnter; // - FActorBeginTouchOverSignature
151+
std::uint8_t onInputTouchLeave; // - FActorEndTouchOverSignature
152+
std::uint8_t onActorHit; // - FActorHitSignature
153+
std::uint8_t onDestroyed; // - FActorDestroyedSignature
154+
std::uint8_t onEndPlay; // - FActorEndPlaySignature
155+
std::byte replicatedSubObjects[0x10]; // - Net::FSubObjectRegistry
156+
TArray<Net::FReplicatedComponentInfo> replicatedComponentsInfo;
157+
TArray<UActorComponent*> replicatedComponents;
158+
TSet<TObjectPtr<UActorComponent>> ownedComponents;
159+
TArray<TObjectPtr<UActorComponent>> instanceComponents;
160+
TArray<TObjectPtr<UActorComponent>> blueprintCreatedComponents;
161+
FRenderCommandFence detachFence;
162+
};
163+
static_assert(sizeof(AActor) == 0x298);
164+
}

include/UE/B/BaseKeyFuncs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace UE
44
{
5-
template <class T, class U, std::size_t N>
5+
template <class T, class U, bool D>
66
class BaseKeyFuncs
77
{
88
public:
99
};
10-
static_assert(std::is_empty_v<BaseKeyFuncs<void*, void*, 0>>);
10+
static_assert(std::is_empty_v<BaseKeyFuncs<void*, void*, false>>);
1111
}

include/UE/D/DefaultKeyFuncs.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
namespace UE
66
{
7-
template <class T, std::size_t N>
7+
template <class T, bool D = false>
88
class DefaultKeyFuncs :
9-
public BaseKeyFuncs<T, T, N>
9+
public BaseKeyFuncs<T, T, D>
1010
{
1111
public:
1212
};
13-
static_assert(std::is_empty_v<DefaultKeyFuncs<void*, 0>>);
13+
static_assert(std::is_empty_v<DefaultKeyFuncs<void*>>);
1414
}

include/UE/E/EAutoReceiveInput.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
namespace UE
4+
{
5+
enum class EAutoReceiveInput : std::int32_t
6+
{
7+
Disabled,
8+
Player0,
9+
Player1,
10+
Player2,
11+
Player3,
12+
Player4,
13+
Player5,
14+
Player6,
15+
Player7,
16+
};
17+
}

include/UE/E/EClassFlags.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#pragma once
2+
3+
namespace UE
4+
{
5+
enum class EClassFlags : std::uint32_t
6+
{
7+
None = 0x00000000u,
8+
Abstract = 0x00000001u,
9+
DefaultConfig = 0x00000002u,
10+
Config = 0x00000004u,
11+
Transient = 0x00000008u,
12+
Optional = 0x00000010u,
13+
MatchedSerializers = 0x00000020u,
14+
ProjectUserConfig = 0x00000040u,
15+
Native = 0x00000080u,
16+
NoExport = 0x00000100u,
17+
NotPlaceable = 0x00000200u,
18+
PerObjectConfig = 0x00000400u,
19+
ReplicationDataIsSetUp = 0x00000800u,
20+
EditInlineNew = 0x00001000u,
21+
CollapseCategories = 0x00002000u,
22+
Interface = 0x00004000u,
23+
CustomConstructor = 0x00008000u,
24+
Const = 0x00010000u,
25+
NeedsDeferredDependencyLoading = 0x00020000u,
26+
CompiledFromBlueprint = 0x00040000u,
27+
MinimalAPI = 0x00080000u,
28+
RequiredAPI = 0x00100000u,
29+
DefaultToInstanced = 0x00200000u,
30+
TokenStreamAssembled = 0x00400000u,
31+
HasInstancedReference = 0x00800000u,
32+
Hidden = 0x01000000u,
33+
Deprecated = 0x02000000u,
34+
HideDropDown = 0x04000000u,
35+
GlobalUserConfig = 0x08000000u,
36+
Intrinsic = 0x10000000u,
37+
Constructed = 0x20000000u,
38+
ConfigDoNotCheckDefaults = 0x40000000u,
39+
NewerVersionExists = 0x80000000u,
40+
};
41+
REX_DEFINE_ENUM_CLASS_FLAGS(EClassFlags);
42+
}

include/UE/E/ELevelTick.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
namespace UE
4+
{
5+
enum class ELevelTick : std::int32_t
6+
{
7+
TimeOnly = 0,
8+
ViewportsOnly = 1,
9+
All = 2,
10+
PauseTick = 3,
11+
};
12+
}

include/UE/E/ENamedThreads.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
namespace UE
4+
{
5+
enum class ENamedThreads : std::int32_t;
6+
}

include/UE/E/ENetDormancy.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
namespace UE
4+
{
5+
enum class ENetDormancy : std::int32_t
6+
{
7+
Never,
8+
Awake,
9+
DormantAll,
10+
DormantPartial,
11+
Initial,
12+
13+
MAX,
14+
};
15+
}

0 commit comments

Comments
 (0)