Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Гайд How to change world color after game update

Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.



C++:
Expand Collapse Copy
namespace sceneSDK
{
    inline HMODULE scenesystem = nullptr;

    inline c_scene_system* scene_system = nullptr;
    template <typename T = void*>
    T find_interface(HMODULE module_handle, const char* name)
    {
        using fn = T(*)(const char*, int*);
        const auto func = reinterpret_cast<fn>((GetProcAddress)(module_handle, ("CreateInterface")));
        if (!func)
            return nullptr;

        return func(name, nullptr);
    }

    inline bool initialize()
    {
        scenesystem = GetModuleHandleA("scenesystem.dll");
        
        if (scenesystem)
        {
            std::string str = "SceneSystem_002";
            scene_system = find_interface<c_scene_system*>(scenesystem, str.c_str());
            if (scene_system)
                __log(str + " is loaded!", false);
            return true;
        }

        return false;
    }
}


сам хук:
Expand Collapse Copy
__int64 __fastcall hkLight(__int64 a1, __int64 a2, c_aggregate_object_array* a3)
{
    __int64 original = oLight(a1, a2, a3);

    for (int i = 0; i < a3->data->count; i++)
    {
        int index = (a3->data->index + i) << 5;
        *reinterpret_cast<c_color*>(static_cast<char*>(sceneSDK::scene_system->light_data_queue->light_data) + index) = G::__light.color;

    }
    return original;
}
 
Назад
Сверху Снизу