Skip to content

Commit 83b746a

Browse files
MoneyWastedRegynate
authored andcommitted
Cleaning Up Patterns and Code
1 parent 1714467 commit 83b746a

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

ChaosMod/Memory/Hooks/ApplyChangeSetEntryHook.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct ChangeSetEntry
1313
int type;
1414
// ...
1515
};
16+
1617
void (*OG_ApplyChangeSetEntryStub)(ChangeSetEntry *entry);
1718
void HK_ApplyChangeSetEntryStub(ChangeSetEntry *entry)
1819
{
@@ -85,4 +86,4 @@ static bool OnHook()
8586
return true;
8687
}
8788

88-
static RegisterHook registerHook(OnHook, nullptr, "_ApplyChangeSetEntryStub");
89+
static RegisterHook registerHook(OnHook, nullptr, "_ApplyChangeSetEntryStub");

ChaosMod/Memory/Hooks/AudioSettingsHook.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void _HK_rage__audSound__CombineBuffers(void *_this, __int64 combineBuffer)
5252

5353
static bool OnHook()
5454
{
55-
auto handle = Memory::FindPattern("E8 ?? ?? ?? ?? 48 8B CE 44 89 7E 54", "E8 ?? ?? ?? ?? 44 89 77 54");
55+
auto handle = Memory::FindPattern("E8 ? ? ? ? 48 8B CE 44 89 7E 54", "E8 ? ? ? ? 44 89 77 54");
5656
if (!handle.IsValid())
5757
return false;
5858

@@ -91,6 +91,7 @@ namespace Hooks
9191
ms_OverrideLPFCutoff.doOverride = true;
9292
ms_OverrideLPFCutoff.targetValue = value;
9393
}
94+
9495
void ResetAudioLPFCutoff()
9596
{
9697
ms_OverrideLPFCutoff.doOverride = false;
@@ -101,6 +102,7 @@ namespace Hooks
101102
ms_OverrideHPFCutoff.doOverride = true;
102103
ms_OverrideHPFCutoff.targetValue = value;
103104
}
105+
104106
void ResetAudioHPFCutoff()
105107
{
106108
ms_OverrideHPFCutoff.doOverride = false;
@@ -111,6 +113,7 @@ namespace Hooks
111113
ms_OverrideVolume.doOverride = true;
112114
ms_OverrideVolume.targetValue = static_cast<int>(value);
113115
}
116+
114117
void ResetAudioVolume()
115118
{
116119
ms_OverrideVolume.doOverride = false;

ChaosMod/Memory/Hooks/GetLabelTextHook.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const char *HK_GetLabelText(void *text, Hash hash)
2222
static bool OnHook()
2323
{
2424
auto handle =
25-
Memory::FindPattern("48 8B CB 8B D0 E8 ? ? ? ? 48 85 C0 0F 95 C0", "48 83 EC 28 E8 ?? ?? ?? ?? 48 85 C0 75");
25+
Memory::FindPattern("48 8B CB 8B D0 E8 ? ? ? ? 48 85 C0 0F 95 C0", "48 83 EC 28 E8 ? ? ? ? 48 85 C0 75");
2626
if (!handle.IsValid())
2727
return false;
2828

@@ -58,4 +58,4 @@ namespace Hooks
5858
ms_CustomLabels.clear();
5959
ms_CustomLabelHashes = std::queue<Hash>();
6060
}
61-
}
61+
}

ChaosMod/Memory/Hooks/MiscHooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static bool OnHook()
2020
{
2121
Handle handle;
2222

23-
handle = Memory::FindPattern("E8 ? ? ? ? 4D 03 F5 48", "E8 ?? ?? ?? ?? 0F 28 06 0F 28 8C 24 F0 00 00 00");
23+
handle = Memory::FindPattern("E8 ? ? ? ? 4D 03 F5 48", "E8 ? ? ? ? 41 F6 47 54 08");
2424
if (!handle.IsValid())
2525
LOG("crSkeleton::GetGlobalMtx not found!");
2626
else

ChaosMod/Memory/Hooks/ShaderHook.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ static bool OnHook()
5353
}
5454
});
5555

56-
Handle handle;
57-
58-
//
59-
60-
handle = Memory::FindPattern("E8 ? ? ? ? 48 89 83 28 02 00 00 8B 44 24 30 89 83 30 02 00 00 EB 0F");
56+
Handle handle = Memory::FindPattern("E8 ? ? ? ? 48 89 83 28 02 00 00 8B 44 24 30 89 83 30 02 00 00 EB 0F");
6157
if (!handle.IsValid())
6258
return false;
6359

ChaosMod/Memory/Memory.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ namespace Memory
247247
{
248248
static auto globalPtr = []() -> DWORD64 **
249249
{
250-
auto handle =
251-
FindPattern("4C 8D 05 ? ? ? ? 4D 8B 08 4D 85 C9 74 11", "48 8D 3D ?? ?? ?? ?? 31 ED 4C 8D 25");
250+
auto handle = FindPattern("4C 8D 05 ? ? ? ? 4D 8B 08 4D 85 C9 74 11", "48 8D 3D ? ? ? ? 31 ED 4C 8D 25");
252251
if (!handle.IsValid())
253252
return nullptr;
254253

@@ -301,7 +300,8 @@ namespace Memory
301300
{
302301
static auto gameBuild = []() -> std::string
303302
{
304-
auto handle = Memory::FindPattern("80 3D ? ? ? ? 00 0F 57 C0 48", "48 8D 0D ?? ?? ?? ?? 48 8D 15 ?? ?? ?? ?? 4C 8D 44 24 2C E8");
303+
auto handle = Memory::FindPattern("80 3D ? ? ? ? 00 0F 57 C0 48",
304+
"48 8D 0D ? ? ? ? 48 8D 15 ? ? ? ? 4C 8D 44 24 2C E8");
305305
if (!handle.IsValid())
306306
return {};
307307

0 commit comments

Comments
 (0)