-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
main.cpp
хук
В свмый верх
ниже приведущего
так же можно делать с смоком
menu
хук
Код:
static auto GetPartice = (DWORD)(util::FindSignature("client.dll", "55 8B EC 83 EC 18 56 8B F1 C7 45")); OriginalPartice = (NewParticeFN)DetourFunction((PBYTE)GetPartice, (PBYTE)InitNewParticlesScalar);
Код:
class CParticleCollection;
class C_INIT_RandomColor {
BYTE pad_0[92];
public:
Vector m_flNormColorMin;
Vector m_flNormColorMax;
};
using NewParticeFN = void(__thiscall*)(C_INIT_RandomColor*, CParticleCollection*, int, int, int, void*);
NewParticeFN OriginalPartice;
Код:
constexpr uint32_t offsetBasis_for_main = 0x811c9dc5;
constexpr uint32_t prime_for_main = 0x1000193;
constexpr uint32_t hash_for_main(const char* str, const uint32_t value = offsetBasis_for_main) noexcept
{
return *str ? hash_for_main(str + 1, (value ^ *str) * static_cast<unsigned long long>(prime_for_main)) : value;
}
constexpr uint32_t hashRuntime_for_main(const char* str) noexcept
{
auto value = offsetBasis_for_main;
while (*str)
{
value ^= *str++;
value *= prime_for_main;
}
return value;
}
Код:
void __fastcall InitNewParticlesScalar(C_INIT_RandomColor* thisPtr, void* edx, CParticleCollection* pParticles, int start_p, int nParticleCount, int nAttributeWriteMask, void* pContext) {
Vector o_min = thisPtr->m_flNormColorMin;
Vector o_max = thisPtr->m_flNormColorMax;
const char* mat_name = *(char**)(*(uintptr_t*)((uintptr_t)pParticles + 0x48) + 0x40);
assert(mat_name);
if (g_cfg.player.enable && g_cfg.esp.modulate_fire)
{
switch (hashRuntime_for_main(mat_name))
{
case hash_for_main("particle\\fire_burning_character\\fire_env_fire.vmt"):
case hash_for_main("particle\\fire_burning_character\\fire_env_fire_depthblend.vmt"):
case hash_for_main("particle\\fire_burning_character\\fire_burning_character_depthblend.vmt"):
case hash_for_main("particle\\fire_burning_character\\fire_burning_character.vmt"):
case hash_for_main("particle\\fire_burning_character\\fire_burning_character_nodepth.vmt"):
case hash_for_main("particle\\particle_flares\\particle_flare_001.vmt"):
case hash_for_main("particle\\particle_flares\\particle_flare_004.vmt"):
case hash_for_main("particle\\particle_flares\\particle_flare_004b_mod_ob.vmt"):
case hash_for_main("particle\\particle_flares\\particle_flare_004b_mod_z.vmt"):
case hash_for_main("particle\\fire_explosion_1\\fire_explosion_1_bright.vmt"):
case hash_for_main("particle\\fire_explosion_1\\fire_explosion_1b.vmt"):
case hash_for_main("particle\\fire_particle_4\\fire_particle_4.vmt"):
case hash_for_main("particle\\fire_explosion_1\\fire_explosion_1_oriented.vmt"):
thisPtr->m_flNormColorMin = thisPtr->m_flNormColorMax = Vector(g_cfg.esp.fire_color.r() / 255.0f, g_cfg.esp.fire_color.g() / 255.0f, g_cfg.esp.fire_color.b() / 255);
break;
}
}
OriginalPartice(thisPtr, pParticles, start_p, nParticleCount, nAttributeWriteMask, pContext);
thisPtr->m_flNormColorMin = o_min;
thisPtr->m_flNormColorMax = o_max;
}
Код:
bool modulate_fire;
Color fire_color;
ImGui::Checkbox(crypt_str("Modulate fire"), &g_cfg.esp.modulate_fire);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##firecolor"), &g_cfg.esp.fire_color, NOALPHA);