Skip to content

Commit

Permalink
Add correct CSCZDS speed scaling pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo authored and YaLTeR committed Dec 30, 2022
1 parent 81a4e30 commit fa3c627
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions BunnymodXT/modules/ClientDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,15 +1298,25 @@ void ClientDLL::SetSpeedScaling(bool scaled)
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling + 19), 1, reinterpret_cast<const byte*>("\x75"));
else if (pCS_SpeedScaling_Linux
&& *reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 2) == 0xE9
&& *reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 3) == 0x62)
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling_Linux + 2), 4, reinterpret_cast<const byte*>("\x0F\x86\x61\xFE"));
&& *reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 3) == 0x62) {
if (*reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 4) == 0xFE)
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling_Linux + 2), 4, reinterpret_cast<const byte*>("\x0F\x86\x61\xFE"));
else // csczds byte
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling_Linux + 2), 4, reinterpret_cast<const byte*>("\x0F\x86\x5D\xFD"));
}

} else {
if (pCS_SpeedScaling && *reinterpret_cast<byte*>(pCS_SpeedScaling + 19) == 0x75)
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling + 19), 1, reinterpret_cast<const byte*>("\xEB"));
else if (pCS_SpeedScaling_Linux
&& *reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 2) == 0x0F
&& *reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 3) == 0x86)
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling_Linux + 2), 4, reinterpret_cast<const byte*>("\xE9\x62\xFE\xFF"));
&& *reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 3) == 0x86) {
if (*reinterpret_cast<byte*>(pCS_SpeedScaling_Linux + 4) == 0x61)
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling_Linux + 2), 4, reinterpret_cast<const byte*>("\xE9\x62\xFE\xFF"));
else
MemUtils::ReplaceBytes(reinterpret_cast<void*>(pCS_SpeedScaling_Linux + 2), 4, reinterpret_cast<const byte*>("\xE9\x5E\xFD\xFF"));
}

}
}

Expand Down

0 comments on commit fa3c627

Please sign in to comment.