Skip to content

Commit

Permalink
Fix for the latest game update on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed May 27, 2024
1 parent 5126513 commit 1dc1ef9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Source/CS2/Classes/GlobalVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace cs2
{

struct GlobalVars {
PAD(44);
PAD(52); // FIXME: get offset to curtime dynamically
float curtime;
};

Expand Down
6 changes: 3 additions & 3 deletions Source/CS2/Classes/Sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ namespace cs2
{

struct CSfxTable {
PAD(48);
PAD(40); // TODO: get dynamically, was broken: 2024.05.23
FileNameHandle_t fileNameHandle;
};

struct ChannelInfo1 {
CSfxTable* sfx;
int guid;
PAD(116); // TODO: get sizeof dynamically, was broken: 2024.02.07
PAD(60); // TODO: get sizeof dynamically, was broken: 2024.02.07, broken again (reverted to previous) 2024.05.23
};

static_assert(sizeof(ChannelInfo1) == 128);
static_assert(sizeof(ChannelInfo1) == 72);

struct ChannelInfo2 {
Vector origin;
Expand Down
6 changes: 3 additions & 3 deletions Source/MemoryPatterns/Windows/ClientPatternsWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct ClientPatterns {

[[nodiscard]] cs2::GlobalVars** globalVars() const noexcept
{
return patternFinders.clientPatternFinder("48 8B 05 ? ? ? ? 0F 57 C0 8B 48 40"_pat).add(3).abs().template as<cs2::GlobalVars**>();
return patternFinders.clientPatternFinder("48 8B 05 ? ? ? ? 0F 57 C0 8B 48"_pat).add(3).abs().template as<cs2::GlobalVars**>();
}

[[nodiscard]] cs2::CUtlVector<cs2::CPlantedC4*>* plantedC4s() const noexcept
Expand Down Expand Up @@ -69,12 +69,12 @@ struct ClientPatterns {

[[nodiscard]] cs2::VMatrix* worldToProjectionMatrix() const noexcept
{
return patternFinders.clientPatternFinder("48 8D 05 ? ? ? ? 48 8B D3 4C 8D 05"_pat).add(3).abs().template as<cs2::VMatrix*>();
return patternFinders.clientPatternFinder("48 8D 0D ? ? ? ? 48 C1 E0 06"_pat).add(3).abs().template as<cs2::VMatrix*>();
}

[[nodiscard]] cs2::VMatrix* viewToProjectionMatrix() const noexcept
{
return patternFinders.clientPatternFinder("4C 8D 0D ? ? ? ? 48 8D 05 ? ? ? ? 48 8B D3"_pat).add(3).abs().template as<cs2::VMatrix*>();
return patternFinders.clientPatternFinder("48 89 4C 24 ? 4C 8D 0D ? ? ? ? 48 8B 0D"_pat).add(8).abs().template as<cs2::VMatrix*>();
}

[[nodiscard]] cs2::CViewRender** viewRender() const noexcept
Expand Down
2 changes: 1 addition & 1 deletion Source/MemoryPatterns/Windows/EntityPatternsWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ struct EntityPatterns {

[[nodiscard]] OffsetToVData offsetToVData() const noexcept
{
return patternFinders.clientPatternFinder("49 8B 86 ? ? ? ? 48 85 C0 74 ? 48 8B 40"_pat).add(3).template readOffset<OffsetToVData>();
return patternFinders.clientPatternFinder("49 8B 86 ? ? ? ? 48 85 C0 74 ? 48 8B 40 ? 48 85 C0 74 ? 80"_pat).add(3).template readOffset<OffsetToVData>();
}
};
2 changes: 1 addition & 1 deletion Source/MemoryPatterns/Windows/GameRulesPatternsWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ struct GameRulesPatterns {

[[nodiscard]] RoundStartTimeOffset roundStartTimeOffset() const noexcept
{
return patternFinders.clientPatternFinder("F3 0F 5C C8 F3 0F 10 43 ? F3"_pat).add(8).template readOffset<RoundStartTimeOffset>();
return patternFinders.clientPatternFinder("F3 0F 10 43 ? 0F 5B C9"_pat).add(4).template readOffset<RoundStartTimeOffset>();
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ struct PanoramaUiPanelPatterns {

[[nodiscard]] std::int32_t* setVisible() const noexcept
{
return patternFinders.clientPatternFinder("FF 90 ? ? ? ? 45 33 C0 33 D2 ? 8B ? E8"_pat).add(2).template as<std::int32_t*>();
return patternFinders.clientPatternFinder("01 FF 90 ? ? ? ? 45 33 C0 33 D2 ? 8B ? E8"_pat).add(3).template as<std::int32_t*>();
}

[[nodiscard]] std::int32_t* findChildInLayoutFile() const noexcept
{
return patternFinders.clientPatternFinder("48 8B 48 ? 48 8D 15 ? ? ? ? 4C 89 74 24 ? 48 8B 01 FF 90 ? ? ? ? 48"_pat).add(21).template as<std::int32_t*>();
return patternFinders.clientPatternFinder("48 8B 48 ? 48 8D 15 ? ? ? ? 4C 89 74 24 ? 48 8B 01 FF 90 ? ? ? ? 48 85"_pat).add(21).template as<std::int32_t*>();
}

[[nodiscard]] std::int32_t* getAttributeString() const noexcept
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct PlayerControllerPatterns {

[[nodiscard]] OffsetToPlayerPawnHandle offsetToPlayerPawnHandle() const noexcept
{
return patternFinders.clientPatternFinder("C1 48 85 C9 74 ? 8B 89 ? ? ? ?"_pat).add(8).template readOffset<OffsetToPlayerPawnHandle>();
return patternFinders.clientPatternFinder("C1 48 85 C9 74 ? 8B ? ? ? ? ? 83"_pat).add(8).template readOffset<OffsetToPlayerPawnHandle>();
}

[[nodiscard]] OffsetToPlayerColor offsetToPlayerColor() const noexcept
Expand Down
2 changes: 1 addition & 1 deletion Source/MemoryPatterns/Windows/PlayerPawnPatternsWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct PlayerPawnPatterns {

[[nodiscard]] OffsetToPlayerPawnImmunity offsetToPlayerPawnImmunity() const noexcept
{
return patternFinders.clientPatternFinder("0F B6 83 ? ? ? ? 84 C0 75 ? 41"_pat).add(3).template readOffset<OffsetToPlayerPawnImmunity>();
return patternFinders.clientPatternFinder("0F B6 83 ? ? ? ? 84 C0 75 ? ? 80"_pat).add(3).template readOffset<OffsetToPlayerPawnImmunity>();
}

[[nodiscard]] OffsetToWeaponServices offsetToWeaponServices() const noexcept
Expand Down

0 comments on commit 1dc1ef9

Please sign in to comment.