Add entity overflow patch
This commit is contained in:
parent
f8de50193f
commit
17d4e4d35a
@ -16,6 +16,29 @@ namespace security
|
|||||||
utils::hook::invoke<void>(0x61A9D0_b, localclient, index1, index2);
|
utils::hook::invoke<void>(0x61A9D0_b, localclient, index1, index2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void remap_cached_entities(game::mp::cachedSnapshot_t& snapshot)
|
||||||
|
{
|
||||||
|
static bool printed = false;
|
||||||
|
if (snapshot.num_clients > 1200 && !printed)
|
||||||
|
{
|
||||||
|
printed = true;
|
||||||
|
printf("Too many entities (%d)... remapping!\n", snapshot.num_clients);
|
||||||
|
}
|
||||||
|
|
||||||
|
snapshot.num_clients = std::min(snapshot.num_clients, 1200);
|
||||||
|
}
|
||||||
|
|
||||||
|
void remap_cached_entities_stub(utils::hook::assembler& a)
|
||||||
|
{
|
||||||
|
a.pushad64();
|
||||||
|
|
||||||
|
a.mov(rcx, rbx);
|
||||||
|
a.call_aligned(remap_cached_entities);
|
||||||
|
|
||||||
|
a.popad64();
|
||||||
|
a.jmp(0x55E4D8_b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class component final : public component_interface
|
class component final : public component_interface
|
||||||
@ -30,6 +53,9 @@ namespace security
|
|||||||
|
|
||||||
// Patch vulnerability in PlayerCards_SetCachedPlayerData
|
// Patch vulnerability in PlayerCards_SetCachedPlayerData
|
||||||
utils::hook::call(0xF4632_b, set_cached_playerdata_stub);
|
utils::hook::call(0xF4632_b, set_cached_playerdata_stub);
|
||||||
|
|
||||||
|
// Patch entity overflow
|
||||||
|
utils::hook::jump(0x55E4C7_b, assemble(remap_cached_entities_stub), true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user