Skip to content

Commit

Permalink
Different set_rendering_enabled patch method
Browse files Browse the repository at this point in the history
It seems that the previous set_rendering_enabled patch method was causing a crash 🤔
  • Loading branch information
Wolf49406 committed Jan 14, 2025
1 parent b41f118 commit e8a1d75
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
14 changes: 12 additions & 2 deletions Dota2Patcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,23 @@ int main() {
});
}

// #STR: "Error in child list of particle system %s [%p], parent: %p, "m_Children.m_pHead: [%p]\n", "Address of m_Children.m_pHead: [%p]\n"
// CParticleCollection 95'th vfunc (offset 0x5F)
// mov r11, rsp
// push rbp
// push rsi
// push r12
// push r13
// sub rsp, 118h
// movzx eax, byte ptr [rcx+0A64h] <<<< CParticleCollection + 0xA64 -> 0x160.
// On 0xA64 is 1 if set_rendering_enabled is true. But on 0x160 is always 1 :)
if (ConfigManager::set_rendering_enabled) {
Patches::add_patch({
"set_rendering_enabled",
"particles.dll",
Patches::Patterns::set_rendering_enabled,
"85",
1
"60 01",
3
});
}

Expand Down
2 changes: 1 addition & 1 deletion Dota2Patcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Patches {
static inline const std::string CDOTACamera = "48 8D ? ? ? ? ? 48 83 C4 ? 5B C3 48 8D ? ? ? ? ? E8 ? ? ? ? 83 3D 76 B2 98 03";
static inline const std::string sv_cheats = "75 ? 48 8B 56 ? 48 8D 0D";
static inline const std::string fog_enable = "74 ? B0 ? EB ? 32 C0 88 85";
static inline const std::string set_rendering_enabled = "0F 84 ? ? ? ? 4D 89 73";
static inline const std::string set_rendering_enabled = "0F B6 ? ? ? ? ? 45 33 ? C0 E8";
};

struct PatchInfo {
Expand Down
2 changes: 1 addition & 1 deletion MD5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
77ca0e69c7e2a32942a73970346bedc0
a428772eb9e6fabe45c7654abf4d438d
2 changes: 1 addition & 1 deletion SourceSDK/interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static class dota_interfaces {
} vmt;

bool Scanner::find_CDOTACamera() {
// CDOTA_Camera 21 vfunc:
// CDOTA_Camera 21'th vfunc (offset 0xA8):
//
// sub rsp, 48h
// movaps[rsp + 48h + var_18], xmm6
Expand Down

0 comments on commit e8a1d75

Please sign in to comment.