Welcome to hackvshack.net Forum!
Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, and More!
Register

C++ Sound ESP

  • Thread starter Thread starter Kryx
  • Start date Start date

Kryx

packrunner
Forum Contributor
User ID:
25934
Messages:
381
Reactions:
421
Badges:
23
REP:
−0/0+
Level:
572
By Rushensky

Code:
Expand Collapse Copy
    // client.dll 48 8B C4 4C 89 40 18 48 89 48 08 55 53 57
    
    class origin_wrapper
    {
    public:
        Vector origin; //0x0000
    };
    
    class sound_data
    {
    public:
        char pad_0000[8]; //0x0000
        char *sound_name; //0x0008
        char pad_0010[16]; //0x0010
        class origin_wrapper *get_origin; //0x0020
    };
    
    using sound_t = DWORD * (__fastcall*)(void *, DWORD *, int, int, sound_data*);
    
    DWORD *__fastcall hooked_sound(void *sound_patch, DWORD *a2, int a3, int a4, sound_data *data)
    {
            auto ret = ((sound_t)hooks[hook::sound].m_orig)(sound_patch, a2, a3, entity_index, data);
    
        if (data)
        {
            auto get_origin = data->get_origin;
    
            if (get_origin)
            {
                my_sound_t sound;
                sound.origin = get_origin->origin;
                sound.timestamp = g_game->m_globalvars->m_curtime;
                g_game->m_my_sound.push_back(sound);
            }
        }
    
        return ret;
    }

Code:
Expand Collapse Copy
    struct my_sound_t
    {
        Vector origin;
        const char* name;
        float timestamp;
    };
    using my_sound_deq = std::deque<my_sound_t>;
    ...
    my_sound_deq m_my_sound;

Render part:
Expand Collapse Copy
    while (g_game->m_my_sound.size() && static_cast<float>(g_game->m_globalvars->m_curtime) -
            g_game->m_my_sound.front().timestamp >= 1.0f)
            g_game->m_my_sound.pop_front();
    
        for (auto& sound : g_game->m_my_sound)
        {
            if (!strstr(sound.name, "Step"))
                continue;
    
            if (sound.origin.IsZero())
                continue;
    
            static auto step = IM_PI * 0.075f;
    
            auto prev_point = Vector();
    
            for (float lat = 0.f; lat <= IM_PI * 3.f; lat += step)
            {
                const auto sin1 = sinf(lat);
                const auto cos1 = cosf(lat);
                const auto sin3 = sinf(0);
                const auto cos3 = cosf(0);
    
                const auto point1 = Vector(sin1 * cos3, cos1, sin1 * sin3) * 15.0f;
                const auto point3 = sound.origin + point1;
    
                Vector point, prev;
    
                if (world_to_screen(point3, point) && world_to_screen(prev_point, prev) && lat > 0.f)
                    g_renderer->add_line(ImVec2(prev[0], prev[1]), ImVec2(point[0], point[1]), IM_COL32_WHITE);
    
                prev_point = point3;
            }
        }


 

Who has read this thread (Total: 0) in last 1 hours View details