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

Request CS2 reversing

L_auberginee

Skilled HvHer
User ID:
58825
Messages:
63
Reactions:
85
Badges:
7
REP:
−0/0+
Level:
79
trying to make a simple internal esp for cs2 but i cannot find GetEntityByIndex, xrefing "(missing)" dosent work anymore
 
xref: "Worldspace Render Bounds: [%.2f %.2f %.2f] -> [%.2f %.2f %.2f]\n"

inside double __fastcall sub_180372760(__int64 a1, __int64 a2, __int64 a3) (the function from the xref)

you have

v7 = sub_180A64220(v6);

sub_180A64220 is GetEntityByIndex

v7 is entity v6 is entity index.

Enjoy

You can also use the rebuilt function

thisptr is GameEntitySystem

C++:
Expand Collapse Copy
void* GetEntityFromIndex(int iIndex) {

    int64_t v2 = reinterpret_cast< int64_t >(this) + 16;

    if (iIndex <= 0x7FFE) {
        int64_t v3 = iIndex >> 9;
        if (v3 <= 0x3F) {
            int64_t v4 = *reinterpret_cast< int64_t* >(v2 + 8LL * v3);
            if (v4 != 0) {
                int64_t v5 = v4 + 112LL * (iIndex & 0x1FF);
                if (v5 != 0) {
                    int32_t id = *reinterpret_cast< int32_t* >(v5 + 0x10);
                    if ((id & 0x7FFF) == iIndex)
                        return reinterpret_cast< void* >(*reinterpret_cast< int64_t* >(v4 + 112LL * (iIndex & 0x1FF)));
                }
            }
        }
    }
    return nullptr;
}
 
xref: "Worldspace Render Bounds: [%.2f %.2f %.2f] -> [%.2f %.2f %.2f]\n"

inside double __fastcall sub_180372760(__int64 a1, __int64 a2, __int64 a3) (the function from the xref)

you have

v7 = sub_180A64220(v6);

sub_180A64220 is GetEntityByIndex

v7 is entity v6 is entity index.

Enjoy

You can also use the rebuilt function

thisptr is GameEntitySystem

C++:
Expand Collapse Copy
void* GetEntityFromIndex(int iIndex) {

    int64_t v2 = reinterpret_cast< int64_t >(this) + 16;

    if (iIndex <= 0x7FFE) {
        int64_t v3 = iIndex >> 9;
        if (v3 <= 0x3F) {
            int64_t v4 = *reinterpret_cast< int64_t* >(v2 + 8LL * v3);
            if (v4 != 0) {
                int64_t v5 = v4 + 112LL * (iIndex & 0x1FF);
                if (v5 != 0) {
                    int32_t id = *reinterpret_cast< int32_t* >(v5 + 0x10);
                    if ((id & 0x7FFF) == iIndex)
                        return reinterpret_cast< void* >(*reinterpret_cast< int64_t* >(v4 + 112LL * (iIndex & 0x1FF)));
                }
            }
        }
    }
    return nullptr;
}
thanks i lot i managed to find it 👍
 

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