Skip to content

Commit

Permalink
Add ClientPatterns::worldToProjectionMatrix()
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed Oct 14, 2023
1 parent 2f5ac01 commit 2396324
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/MemoryPatterns/ClientPatterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <CS2/Classes/GlobalVars.h>
#include <CS2/Classes/Panorama.h>
#include <CS2/Classes/CUtlVector.h>
#include <CS2/Classes/VMatrix.h>
#include <Utils/ReturnAddress.h>

namespace cs2
Expand All @@ -25,4 +26,5 @@ struct ClientPatterns {
[[nodiscard]] static ReturnAddress getWorldSessionInClientMode() noexcept;
[[nodiscard]] static cs2::C_CSGameRules** gameRules() noexcept;
[[nodiscard]] static const void* transformTranslate3dVMT() noexcept;
[[nodiscard]] static cs2::VMatrix* worldToProjectionMatrix() noexcept;
};
5 changes: 5 additions & 0 deletions Source/MemoryPatterns/Linux/ClientPatternsLinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ inline const void* ClientPatterns::transformTranslate3dVMT() noexcept
{
return GlobalContext::instance().clientPatternFinder("48 8D 0D ? ? ? ? 48 89 08 48 89 50 08 48 8B 53 10"_pat).add(3).abs().as<const void*>();
}

inline cs2::VMatrix* ClientPatterns::worldToProjectionMatrix() noexcept
{
return GlobalContext::instance().clientPatternFinder("4C 8D 05 ? ? ? ? 48 8B 38 48 8D 0D"_pat).add(3).abs().as<cs2::VMatrix*>();
}
5 changes: 5 additions & 0 deletions Source/MemoryPatterns/Windows/ClientPatternsWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ inline const void* ClientPatterns::transformTranslate3dVMT() noexcept
{
return GlobalContext::instance().clientPatternFinder("48 8D 05 ? ? ? ? 48 C7 42 ? 00"_pat).add(3).abs().as<const void*>();
}

inline cs2::VMatrix* ClientPatterns::worldToProjectionMatrix() noexcept
{
return GlobalContext::instance().clientPatternFinder("48 8D 05 ? ? ? ? 48 8B D3 4C 8D 05"_pat).add(3).abs().as<cs2::VMatrix*>();
}

0 comments on commit 2396324

Please sign in to comment.