Skip to content

Commit

Permalink
Fix non-unique patterns after a recent game update on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed Oct 4, 2024
1 parent 8754811 commit 78ffe41
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Source/CS2/Panorama/CUIEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ struct CUIEngine {
#endif
using getPanelPointer = CUIPanel* (*)(CUIEngine* thisptr, const PanelHandle* handle);
using runScript = void (*)(CUIEngine* thisptr, CUIPanel* contextPanel, const char* scriptSource, const char* originFile, std::uint64_t line);
using makeSymbol = CPanoramaSymbol (*)(CUIEngine* thisptr, int type, const char* text);
#if IS_WIN64()
using makeSymbol = CPanoramaSymbol (*)(int type, const char* text);
#elif IS_LINUX()
using makeSymbol = CPanoramaSymbol(*)(CUIEngine* thisptr, int type, const char* text);
#endif
using onDeletePanel = void (*)(CUIEngine* thisptr, PanelHandle* panelHandle);
};

Expand Down
4 changes: 4 additions & 0 deletions Source/GameClasses/PanoramaUiEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class PanoramaUiEngine {
[[nodiscard]] cs2::CPanoramaSymbol makeSymbol(int type, const char* text) noexcept
{
if (deps().makeSymbol && deps().thisptr)
#if IS_WIN64()
return deps().makeSymbol(type, text);
#elif IS_LINUX()
return deps().makeSymbol(*deps().thisptr, type, text);
#endif
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct GameSceneNodePatterns {

[[nodiscard]] OffsetToGameSceneNodeOwner offsetToOwner() const noexcept
{
return patternFinders.clientPatternFinder("39 B9 ? ? ? ? 75 ? 48 8B ? ?"_pat).add(11).template readOffset<OffsetToGameSceneNodeOwner>();
return patternFinders.clientPatternFinder("44 39 B9 ? ? ? ? 75 ? 48 8B ? ?"_pat).add(12).template readOffset<OffsetToGameSceneNodeOwner>();
}

[[nodiscard]] OffsetToChildGameSceneNode offsetToChild() const noexcept
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct PanoramaUiEnginePatterns {

[[nodiscard]] cs2::CUIEngine::makeSymbol makeSymbol() const noexcept
{
return patternFinders.panoramaPatternFinder("8B CA 49 8B D0"_pat).template as<cs2::CUIEngine::makeSymbol>();
return patternFinders.panoramaPatternFinder("C9 E8 ? ? ? ? 4C 63 2E"_pat).add(2).abs().template as<cs2::CUIEngine::makeSymbol>();
}

[[nodiscard]] cs2::CUIEngine::onDeletePanel onDeletePanel() const noexcept
Expand Down

0 comments on commit 78ffe41

Please sign in to comment.