Skip to content

Commit

Permalink
Move ClientPatterns::gameRules() to GameRulesPatterns
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed May 31, 2024
1 parent 179a85c commit d55cf6c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Source/FeatureHelpers/FeatureHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct FeatureHelpers {
, worldtoClipSpaceConverter{memoryPatterns.clientPatterns()}
, viewToProjectionMatrix{memoryPatterns.clientPatterns()}
, stylePropertiesSymbolsAndVMTs{StylePropertySymbolMap{memoryPatterns.panelStylePatterns().stylePropertiesSymbols()}, panoramaVmtFinder}
, gameRules{memoryPatterns.clientPatterns().gameRules()}
, gameRules{memoryPatterns.gameRulesPatterns().gameRules()}
, mainMenuProvider{memoryPatterns.clientPatterns()}
, localPlayerController{memoryPatterns.clientPatterns().localPlayerController()}
, entitiesVMTs{clientVmtFinder}
Expand Down
5 changes: 0 additions & 5 deletions Source/MemoryPatterns/Linux/ClientPatternsLinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ struct ClientPatterns {
return patternFinders.clientPatternFinder("FF 10 49 89 C5 48 85 C0 0F 84"_pat).add(2).template as<ReturnAddress>();
}

[[nodiscard]] cs2::C_CSGameRules** gameRules() const noexcept
{
return patternFinders.clientPatternFinder("4C 8D ? ? ? ? ? 49 8B ? 48 85 FF 0F 84 ? ? ? ? 41 80 BC 24"_pat).add(3).abs().template as<cs2::C_CSGameRules**>();
}

[[nodiscard]] const void* transformTranslate3dVMT() const noexcept
{
return patternFinders.clientPatternFinder("48 8D 0D ? ? ? ? 48 89 08 48 89 50 08 48 8B 53 10"_pat).add(3).abs().template as<const void*>();
Expand Down
6 changes: 6 additions & 0 deletions Source/MemoryPatterns/Linux/GameRulesPatternsLinux.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#pragma once

#include <CS2/Classes/C_CSGameRules.h>
#include <GameClasses/OffsetTypes/GameRulesOffset.h>
#include <MemorySearch/BytePatternLiteral.h>

template <typename PatternFinders>
struct GameRulesPatterns {
const PatternFinders& patternFinders;

[[nodiscard]] cs2::C_CSGameRules** gameRules() const noexcept
{
return patternFinders.clientPatternFinder("4C 8D ? ? ? ? ? 49 8B ? 48 85 FF 0F 84 ? ? ? ? 41 80 BC 24"_pat).add(3).abs().template as<cs2::C_CSGameRules**>();
}

[[nodiscard]] RoundStartTimeOffset roundStartTimeOffset() const noexcept
{
return patternFinders.clientPatternFinder("F3 0F 10 43 ? F3 0F 5C C1 66 0F EF C9 F3 0F 2A"_pat).add(4).template readOffset<RoundStartTimeOffset>();
Expand Down
5 changes: 0 additions & 5 deletions Source/MemoryPatterns/Windows/ClientPatternsWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ struct ClientPatterns {
return patternFinders.clientPatternFinder("FF 10 ? 8B F0 48 85 C0 0F 84"_pat).add(2).template as<ReturnAddress>();
}

[[nodiscard]] cs2::C_CSGameRules** gameRules() const noexcept
{
return patternFinders.clientPatternFinder("48 8B 0D ? ? ? ? 48 85 C9 0F 84 ? ? ? ? 80 BE"_pat).add(3).abs().template as<cs2::C_CSGameRules**>();
}

[[nodiscard]] const void* transformTranslate3dVMT() const noexcept
{
return patternFinders.clientPatternFinder("48 8D 05 ? ? ? ? 48 C7 42 ? 00"_pat).add(3).abs().template as<const void*>();
Expand Down
6 changes: 6 additions & 0 deletions Source/MemoryPatterns/Windows/GameRulesPatternsWindows.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#pragma once

#include <CS2/Classes/C_CSGameRules.h>
#include <GameClasses/OffsetTypes/GameRulesOffset.h>
#include <MemorySearch/BytePatternLiteral.h>

template <typename PatternFinders>
struct GameRulesPatterns {
const PatternFinders& patternFinders;

[[nodiscard]] cs2::C_CSGameRules** gameRules() const noexcept
{
return patternFinders.clientPatternFinder("48 8B 0D ? ? ? ? 48 85 C9 0F 84 ? ? ? ? 80 BE"_pat).add(3).abs().template as<cs2::C_CSGameRules**>();
}

[[nodiscard]] RoundStartTimeOffset roundStartTimeOffset() const noexcept
{
return patternFinders.clientPatternFinder("F3 0F 10 43 ? 0F 5B C9"_pat).add(4).template readOffset<RoundStartTimeOffset>();
Expand Down

0 comments on commit d55cf6c

Please sign in to comment.