Информация Полезные функции

DarkP1xel

Сила воли наше всё.
BH Team
3,635
4,987
WallHack для оружия.:
auto weaponWallHack(const bool bStatus) const -> void {
    void *pRenderWeapon{reinterpret_cast<void *>(0x732F3F + 0x1)};
    if (bStatus) {
        std::memset(pRenderWeapon, 0x0, 0x1);
    } else {
        std::memcpy(pRenderWeapon, "\x01", 0x1);
    } return;
}
1589061918911.png
 

imring

Ride the Lightning
Всефорумный модератор
2,365
2,552
WallHack для оружия.:
auto weaponWallHack(const bool bStatus) const -> void {
    void *pRenderWeapon{reinterpret_cast<void *>(0x732F3F + 0x1)};
    if (bStatus) {
        std::memset(pRenderWeapon, 0x0, 0x1);
    } else {
        std::memcpy(pRenderWeapon, "\x01", 0x1);
    } return;
}
C++:
inline void weaponWallHack(bool bStatus) {
    *reinterpret_cast<unsigned char*>(0x732F3F + 0x1) = !bStatus;
}
и та функа точно работает? ибо я пробовал - не работает.
 

Dark_Knight

Me, me and me.
Друг
4,085
2,114
  • Вау
Реакции: imring

DarkP1xel

Сила воли наше всё.
BH Team
3,635
4,987
Ну так это пример, можешь в cheat engine заюзать, а в коде надо будет снять защиту с памяти
чо за нубы
 

p1cador

cerf
Проверенный
221
359
Gets actor struct by handle externally (can be optimized).
(this is actually an analogue of 0A96: $ActorStruct = actor $PLAYER_ACTOR struct cleo opcode)
C++:
uintptr_t   getPedStructByActorHandle(uintptr_t handle)
    {
        /*
        0054FF90 | 8B4C24 04                | mov ecx,dword ptr ss:[esp+4]                       |mov ecx, handle
        0054FF94 | 8B15 9044B700            | mov edx,dword ptr ds:[B74490]                      |mov edx, *0xB74490
        0054FF9A | 53                       | push ebx                                           |push 0
        0054FF9B | 56                       | push esi                                           |push 04600026
        0054FF9C | 8B72 04                  | mov esi,dword ptr ds:[edx+4]                       |mov esi, *(edx+4)
        0054FF9F | 8BC1                     | mov eax,ecx                                        |mov eax, handle
        0054FFA1 | C1F8 08                  | sar eax,8                                          |sar handle, 8
        0054FFA4 | 8A1C30                   | mov bl,byte ptr ds:[eax+esi]                       |mov bl, (eax + esi
        0054FFA7 | 5E                       | pop esi                                            |
        0054FFA8 | 3AD9                     | cmp bl,cl                                          |
        0054FFAA | 5B                       | pop ebx                                            |
        0054FFAB | 75 0B                    | jne gta_sa.54FFB8                                  |
        0054FFAD | 8B0A                     | mov ecx,dword ptr ds:[edx]                         |mov ecx, **0xB74490
        0054FFAF | 69C0 C4070000            | imul eax,eax,7C4                                   |handle *= 0x7c4
        0054FFB5 | 03C1                     | add eax,ecx                                        |eax += ecx
        0054FFB7 | C3                       | ret                                                |
        0054FFB8 | 33C0                     | xor eax,eax                                        |
        0054FFBA | C3                       | ret                                                |
        */
        uintptr_t ecx = handle;
        uintptr_t edx;
        ReadProcessMemory(hProcess, (LPVOID)0xB74490, &edx, sizeof(uintptr_t), 0);
        uintptr_t esi;
        ReadProcessMemory(hProcess, (LPVOID)(edx + 4), &esi, sizeof(uintptr_t), 0);
        uintptr_t eax = ecx;
        eax = eax >> 8;
        unsigned char bl;
        ReadProcessMemory(hProcess, (LPVOID)(eax + esi), &bl, sizeof(unsigned char), 0);
        if (bl == (ecx & 0x000000FF))
        {
            ReadProcessMemory(hProcess, (LPVOID)(edx), &ecx, sizeof(uintptr_t), 0);
            eax *= 0x7c4;
            eax += ecx;
            return eax;
        }
        else
        {
            return 0;
        }
    }

Returns a vector of streamed ped's structures externally:
C++:
std::vector<uintptr_t> getStreamedPeds()
{
    std::vector<uintptr_t> peds;
    uintptr_t v1;
    ReadProcessMemory(hProcess (LPVOID)0xB74490, &v1, sizeof(uintptr_t), 0);
    v1 += 0x4;
    ReadProcessMemory(hProcess, (LPVOID)v1, &v1, sizeof(uintptr_t), 0);

    for (uintptr_t v2 = 0; v2 < 0x8b00; v2 += 0x100)
    {
        uintptr_t handle = 0;
        ReadProcessMemory(hProcess, (LPVOID)v1, &handle, sizeof(unsigned char), 0);
        v1 += 1;
        if (handle >= 0 && handle < 0x80)
        {
            handle += v2;
            peds.push_back(getPedStructByActorHandle(handle));
        }
    }
    return peds;
}
Gets ped bone position externally
A working vartant, but it can and should be optimized.
PS this-> read () is ReadProcessMemory()
C++:
#pragma once

static DWORD CRUTCH_LOCAL_VARIABLE = 0;

RpHAnimHierarchy* GtaSA::RpSkinAtomicGetHAnimHierarchy(const RpAtomic* atomic) // 0x7C7540
{
/*
007C7540 | 8B4424 04                | mov eax,dword ptr ss:[esp+4]       |
007C7544 | 8B0D A478C900            | mov ecx,dword ptr ds:[C978A4]      |
007C754A | 8B0401                   | mov eax,dword ptr ds:[ecx+eax]     |
007C754D | C3                       | ret                                |
*/
    uintptr_t eax = (uintptr_t)atomic;
    uintptr_t ecx = this->read<uintptr_t>(0xC978A4);
    eax = this->read<uintptr_t>(eax + ecx);
    return (RpHAnimHierarchy*)eax;
}


void GtaSA::RpClumpForAllAtomics(RpClump* clump, void* callback, void* data)
{
/*
00749B70 | 8B4424 04                | mov eax,dword ptr ss:[esp+4]       |
00749B74 | 53                       | push ebx                           |
00749B75 | 55                       | push ebp                           |
00749B76 | 56                       | push esi                           |
00749B77 | 57                       | push edi                           |
00749B78 | 8D78 08                  | lea edi,dword ptr ds:[eax+8]       |
00749B7B | 8B40 08                  | mov eax,dword ptr ds:[eax+8]       |
00749B7E | 3BC7                     | cmp eax,edi                        |
00749B80 | 74 1E                    | je gta_sa.749BA0                   |
00749B82 | 8B5C24 1C                | mov ebx,dword ptr ss:[esp+1C]      |
00749B86 | 8B6C24 18                | mov ebp,dword ptr ss:[esp+18]      |
00749B8A | 8B30                     | mov esi,dword ptr ds:[eax]         |
00749B8C | 83C0 C0                  | add eax,FFFFFFC0                   |
00749B8F | 53                       | push ebx                           |
00749B90 | 50                       | push eax                           |
00749B91 | FFD5                     | call ebp                           |
00749B93 | 83C4 08                  | add esp,8                          |
00749B96 | 85C0                     | test eax,eax                       |
00749B98 | 74 06                    | je gta_sa.749BA0                   |
00749B9A | 3BF7                     | cmp esi,edi                        |
00749B9C | 8BC6                     | mov eax,esi                        |
00749B9E | 75 EA                    | jne gta_sa.749B8A                  |
00749BA0 | 8B4424 14                | mov eax,dword ptr ss:[esp+14]      |
00749BA4 | 5F                       | pop edi                            |
00749BA5 | 5E                       | pop esi                            |
00749BA6 | 5D                       | pop ebp                            |
00749BA7 | 5B                       | pop ebx                            |
00749BA8 | C3                       | ret                                |
*/
    uintptr_t eax = (uintptr_t)clump;
    uintptr_t edi = eax + 8;
    eax = this->read<uintptr_t>(eax + 8);
    if (eax == edi)
    {
        eax = (uintptr_t)clump; // 00749BA0 | 8B4424 14                | mov eax,dword ptr ss:[esp+14]      |
    }
    else
    {
        uintptr_t ebx = (uintptr_t)data; // ????    // 00749B82 | 8B5C24 1C    | mov ebx, dword ptr ss: [esp+1C]
        uintptr_t ebp = (uintptr_t)callback;        // 00749B86 | 8B6C24 18    | mov ebp, dword ptr ss: [esp + 18]
        uintptr_t esi = this->read<uintptr_t>(eax);    // 00749B8A | 8B30        | mov esi, dword ptr ds: [eax]
        eax += 0xFFFFFFC0;                            // actually its a minus

        /* callback start */

        /*
        00734A20 | 8B4424 04                | mov eax,dword ptr ss:[esp+4]       |
        00734A24 | 50                       | push eax                           |
        00734A25 | E8 162B0900              | call gta_sa.7C7540                 |
        00734A2A | 8B4C24 0C                | mov ecx,dword ptr ss:[esp+C]       |
        00734A2E | 8901                     | mov dword ptr ds:[ecx],eax         |
        00734A30 | 83C4 04                  | add esp,4                          |
        00734A33 | 33C0                     | xor eax,eax                        |
        00734A35 | C3                       | ret                                |
        */

        eax = (uintptr_t)RpSkinAtomicGetHAnimHierarchy((const RpAtomic*)eax); // 00734A25 | E8 162B0900 | call gta_sa.7C7540 |
        
        CRUTCH_LOCAL_VARIABLE = eax; // the next code - instead of 00734A2A...00734A2E instructions
        eax ^= eax;

        /* callback end */


        if (eax == 0)
        {
            eax = (uintptr_t)clump;
        }
        else
        {
            std::cout << "unreverced block 0x749B9A" << std::endl;
            // 00749B9A | 3BF7 | cmp esi, edi |
            // 00749B9C | 8BC6 | mov eax, esi |
        }
    }
    return; // eax;

}




RpHAnimHierarchy* GtaSA::GetAnimHierarchyFromSkinClump(RpClump* clump)
{
/*
00734A40 | 51                       | push ecx                           |
00734A41 | 8B4C24 08                | mov ecx,dword ptr ss:[esp+8]       |
00734A45 | 8D4424 00                | lea eax,dword ptr ss:[esp]         |
00734A49 | 50                       | push eax                           |
00734A4A | 68 204A7300              | push gta_sa.734A20                 |
00734A4F | 51                       | push ecx                           |
00734A50 | C74424 0C 00000000       | mov dword ptr ss:[esp+C],0         |
00734A58 | E8 13510100              | call gta_sa.749B70                 |
00734A5D | 8B4424 0C                | mov eax,dword ptr ss:[esp+C]       |
00734A61 | 83C4 10                  | add esp,10                         |
00734A64 | C3                       | ret                                |
*/
    uintptr_t ecx = (uintptr_t)clump;
    uintptr_t eax = 0;    // ???
    RpClumpForAllAtomics((RpClump*)ecx,  /* callback addr */ (void*)0x734A20, &eax); // &eax ???
    eax = CRUTCH_LOCAL_VARIABLE;
    return (RpHAnimHierarchy*)eax;
}

//-------------------------------------------------------------------

RwInt32 GtaSA::RpHAnimIDGetIndex(RpHAnimHierarchy* hierarchy, RwInt32 ID) // 0x7C51A0
{
/*
007C51A0 | 8B5424 04                | mov edx,dword ptr ss:[esp+4]       |
007C51A4 | 56                       | push esi                           |
007C51A5 | 83C8 FF                  | or eax,FFFFFFFF                    |
007C51A8 | 8B72 10                  | mov esi,dword ptr ds:[edx+10]      |
007C51AB | 8B52 04                  | mov edx,dword ptr ds:[edx+4]       |
007C51AE | 33C9                     | xor ecx,ecx                        |
007C51B0 | 57                       | push edi                           |
007C51B1 | 85D2                     | test edx,edx                       |
007C51B3 | 7E 15                    | jle gta_sa.7C51CA                  |
007C51B5 | 8B7C24 10                | mov edi,dword ptr ss:[esp+10]      |
007C51B9 | 3B3E                     | cmp edi,dword ptr ds:[esi]         |
007C51BB | 74 0B                    | je gta_sa.7C51C8                   |
007C51BD | 41                       | inc ecx                            |
007C51BE | 83C6 10                  | add esi,10                         |
007C51C1 | 3BCA                     | cmp ecx,edx                        |
007C51C3 | 7C F4                    | jl gta_sa.7C51B9                   |
007C51C5 | 5F                       | pop edi                            |
007C51C6 | 5E                       | pop esi                            |
007C51C7 | C3                       | ret                                |
007C51C8 | 8BC1                     | mov eax,ecx                        |
007C51CA | 5F                       | pop edi                            |
007C51CB | 5E                       | pop esi                            |
007C51CC | C3                       | ret                                |
*/

    uintptr_t edx = (uintptr_t)hierarchy;
    uintptr_t eax = 0xFFFFFFFF;
    uintptr_t esi = this->read<uintptr_t>(edx + 0x10);
    edx = this->read<uintptr_t>(edx + 0x4);
    uintptr_t ecx = 0;
    if (edx == 0)
    {
        // just return
        std::cout << "unreverced block 0x7C51CA" << std::endl; //007C51CA | 5F                       | pop edi                            |
    }
    else
    {
        uintptr_t edi = ID; // esp+0x10

        do
        {
            if (edi != this->read<uintptr_t>(esi))
            {

                ecx++;
                esi += 0x10;

            }
            else
            {
                eax = ecx;
                break;
            }
        } while (ecx != edx);

        
    }
    return eax;
}

RwMatrix* GtaSA::RpHAnimHierarchyGetMatrixArray(RpHAnimHierarchy* hierarchy)
{
    /*
    007C5120 | 8B4424 04                | mov eax,dword ptr ss:[esp+4]       |
    007C5124 | 8B40 08                  | mov eax,dword ptr ds:[eax+8]       |
    007C5127 | C3                       | ret                                |
    */

    uintptr_t eax = (uintptr_t)hierarchy;
    eax = this->read<uintptr_t>(eax + 8);
    return (RwMatrix*)eax;
}

void GtaSA::vectorMult(uintptr_t edx, uintptr_t esi, uintptr_t ecx)
{

    float ecxReaded[3];
    this->readBuf(ecx, 4*3, (void*)ecxReaded);
    uintptr_t eax = (uintptr_t)esi;
    // ecx = ecx;
    float st0 = this->read<float>(eax + 0x20);
    st0 *= ecxReaded[2];
    float st1 = st0;

    st0 = this->read<float>(eax + 0x10);
    st0 *= ecxReaded[1];

    st1 += st0; // ? 0059C8A7 | DEC1                    | faddp st(1),st(0)                  |
    
    st0 = this->read<float>(eax);
    st0 *= ecxReaded[0];
    
    st1 += st0; // ? 0059C8AD | DEC1                    | faddp st(1),st(0)                  |
    st0 = st1;

    st0 += this->read<float>(eax + 0x30); // ? 0059C8AF | D840 30                 | fadd st(0),dword ptr ds:[eax+30]   |

    ((float*)(edx))[0] = st0;




    st0 = this->read<float>(eax + 0x24);
    st0 *= ecxReaded[2];
    st1 = st0;
    st0 = this->read<float>(eax + 0x4);
    st0 *= ecxReaded[0];

    st1 += st0; //    0059C8C5 | DEC1                    | faddp st(1),st(0)                  |
    //st0 = st1; //    0059C8C5 | DEC1                    | faddp st(1),st(0)                  |
    
    st0 = this->read<float>(eax + 0x14);
    st0 *= ecxReaded[1];
    st1 += st0;
    st0 = st1;
    st0 += this->read<float>(eax + 0x34);
    ((float*)(edx))[1] = st0;





    st0 = this->read<float>(eax + 0x28);
    st0 *= ecxReaded[2];
    st1 = st0;
    st0 = this->read<float>(eax + 0x8);
    st0 *= ecxReaded[0];
    st1 += st0; // 0059C8E1 | DEC1                    | faddp st(1),st(0)                  |
    st0 = this->read<float>(eax + 0x18);
    st0 *= ecxReaded[1];
    st1 += st0;
    st0 = st1;
    st0 += this->read<float>(eax + 0x38); // ? 0059C8AF | D840 30                 | fadd st(0),dword ptr ds:[eax+30]   |
    //ecx = eax;
    //this->write<uintptr_t>(ecx, edx); // 0059C8F4 | 8911                    | mov dword ptr ds:[ecx],edx         |
    //edx =
    ((float*)(edx))[2] = st0;

}


//-------------------------------------------------------------------




void GtaSA::getBonePosition(uintptr_t pedStruct, Vector3* buf, unsigned int boneId, bool updateSkinBones)
{
    uintptr_t esi = pedStruct;
    uintptr_t eax = 0; eax = this->read<uintptr_t>(esi + 0x474);
    if (updateSkinBones)
    {
        std::cout << "unreverced block 0x5E4295" << std::endl;
    }
    else
    {
        if ((eax & 0xFF00) == 0x400)                                // 005E42E6 | F6C4 04                  | test ah,4
        {
            uintptr_t ecx = this->read<uintptr_t>(esi + 0x18);        // 005E42A9 | 8B4E 18                  | mov ecx,dword ptr ds:[esi+18]      |
            eax = (uintptr_t)GetAnimHierarchyFromSkinClump((RpClump*)ecx);    // 0x734A40
            uintptr_t edi = eax; // 005E42B2 | 8BF8                     | mov edi,eax                        |
            
            if (edi == 0)
            {
                // 005E42BF | 8B46 14                  | mov eax,dword ptr ds:[esi+14]      |
                std::cout << "unreverced block 005E42BF" << std::endl;
            }
            else
            {
                uintptr_t ecx = boneId; // 005E4347 | 8B4C24 1C                | mov ecx,dword ptr ss:[esp+1C]      |
                eax = RpHAnimIDGetIndex((RpHAnimHierarchy*)edi, ecx); // 005E434D | E8 4E0E1E00              | call gta_sa.7C51A0
                esi = eax;    // 005E4353 | 8BF0                     | mov esi,eax                        |
                eax = (uintptr_t)RpHAnimHierarchyGetMatrixArray((RpHAnimHierarchy*)edi);
                // edx = buf
                esi = esi << 6;
                eax += esi;
                eax += 0x30;
                buf->x = this->read<float>(eax);
                buf->y = this->read<float>(eax + 4);
                buf->z = this->read<float>(eax + 8);
            }

        }
        else
        {
            std::cout << "!unreverced block 0x5E42EB" << std::endl;
            eax = boneId;
            esi = this->read<uintptr_t>(esi + 0x14); // ped struct
            eax = eax + eax * 2;
            uintptr_t ecx = eax * 4 + 0x8D13A8;
            
            
                    
            
            // IM STOPPED HERE

            float res[3];
            //uintptr_t edx = (uintptr_t)(res);

            // push ecx
            // push esi
            // push edx
            // call func 0x0059C890(edx, esi, ecx)
            vectorMult((uintptr_t)res, esi, ecx);
            
            buf->x = res[0];// *(float*)(edx);
            buf->y = res[1];//*(float*)(edx + 4);
            buf->z = res[2];//*(float*)(edx + 8);

            //float* firstMatrix = (float*)this->readBuf(16, edx);
            //edx = LOCAL_VAR_ADDR
            // push esi
            // push edx
            // call matrix multiply // 005E4303 | E8 8885FBFF             | call gta_sa.59C890                 |
            
            
            /*float res[16];


            float arg1[16];
            this->readBuf(ecx, 4 * 4 * 4, arg1);
            ecx = (uintptr_t)arg1;

            float arg2[16];
            this->readBuf(esi, 16*4, arg2);





            ::vec3mx(arg1, arg1, res);
            uintptr_t edx = (uintptr_t)res;

            /*
            buf->x = *(float*)(edx);
            buf->y = *(float*)(edx + 4);
            buf->z = *(float*)(edx + 8);*/




        }
    }
}
 
Последнее редактирование:

loganhackerdff

Известный
868
519
Проверяет на экране ли объект / пикап / 3dтекст
Без проверки на то что этот объект / пикап / 3dтекст существует
C++:
void CalcScreenCoors(D3DXVECTOR3* vecWorld, D3DXVECTOR3* vecScreen)
{

    D3DXMATRIX    m((float*)(0xB6FA2C));
    DWORD* dwLenX = (DWORD*)(0xC17044);
    DWORD* dwLenY = (DWORD*)(0xC17048);

    vecScreen->x = (vecWorld->z * m._31) + (vecWorld->y * m._21) + (vecWorld->x * m._11) + m._41;
    vecScreen->y = (vecWorld->z * m._32) + (vecWorld->y * m._22) + (vecWorld->x * m._12) + m._42;
    vecScreen->z = (vecWorld->z * m._33) + (vecWorld->y * m._23) + (vecWorld->x * m._13) + m._43;

    double    fRecip = (double)1.0 / vecScreen->z;
    vecScreen->x *= (float)(fRecip * (*dwLenX));
    vecScreen->y *= (float)(fRecip * (*dwLenY));
}

bool IsPickOnScreen(int p)
{

    D3DXVECTOR3 vecPos;
    vecPos.x = SF->getSAMP()->getInfo()->pPools->pPickup->pickup[p].fPosition[0];
    vecPos.y = SF->getSAMP()->getInfo()->pPools->pPickup->pickup[p].fPosition[1];
    vecPos.z = SF->getSAMP()->getInfo()->pPools->pPickup->pickup[p].fPosition[2];

    D3DXVECTOR3 screenPos;
    CalcScreenCoors(&vecPos, &screenPos);
    if (screenPos.z < 1.f)
        return false;
    return true;
}

bool IsObjOnScreen(int p)
{
    D3DXVECTOR3 vecPos;
    vecPos.x = SF->getSAMP()->getInfo()->pPools->pObject->object[p]->pGTAEntity->base.matrix[4 * 3];
    vecPos.y = SF->getSAMP()->getInfo()->pPools->pObject->object[p]->pGTAEntity->base.matrix[4 * 3 + 1];
    vecPos.z = SF->getSAMP()->getInfo()->pPools->pObject->object[p]->pGTAEntity->base.matrix[4 * 3 + 2];

    D3DXVECTOR3 screenPos;
    CalcScreenCoors(&vecPos, &screenPos);
    if (screenPos.z < 1.f)
        return false;
    return true;
}

bool Is3dTOnScreen(int p)
{
    D3DXVECTOR3 vecPos;
    vecPos.x = SF->getSAMP()->getInfo()->pPools->pText3D->textLabel[p].fPosition[0];
    vecPos.y = SF->getSAMP()->getInfo()->pPools->pText3D->textLabel[p].fPosition[1];
    vecPos.z = SF->getSAMP()->getInfo()->pPools->pText3D->textLabel[p].fPosition[2];

    D3DXVECTOR3 screenPos;
    CalcScreenCoors(&vecPos, &screenPos);
    if (screenPos.z < 1.f)
        return false;
    return true;
}
 

Const

Потрачен
28
54
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Устанавливает процент разброса пули:
void SetSpreadMultiplier(float fltMultiplier) {
    *reinterpret_cast<float *>(0x008D6114) = fltMultiplier / 20.00F;
}

Примеры:
SetSpreadMultiplier(0.00F); // Установит процент разброса пули на 0 (разброса не будет).
SetSpreadMultiplier(50.00F); // Установит процент разброса пули на 50 (разброс будет в 2 раза меньше обычного).
SetSpreadMultiplier(100.00F); // Установит процент разброса пули на 100 (разброс останется неизмененным).
 

loganhackerdff

Известный
868
519
Функция копирование текста в буффер
C++:
void SetClipboardText(char* txt)
{
    if (OpenClipboard(NULL))
    {
        HGLOBAL clipbuffer;
        char* buffer;
        EmptyClipboard();
        clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(txt) + 1);
        buffer = (char*)GlobalLock(clipbuffer);
        strcpy(buffer, txt);
        GlobalUnlock(clipbuffer);
        SetClipboardData(CF_TEXT, clipbuffer);
        CloseClipboard();
    }
}
Получает путь к корневой папке gta_sa.exe
C++:
void GetPath(char* OutPutBuffer)
{
    GetModuleFileNameA(GetModuleHandleA(NULL), OutPutBuffer, 260);
    memset(OutPutBuffer + (strlen(OutPutBuffer) - strlen("/gta_sa.exe")), 0, 1);
}
Устанавливает позицию ImGui окна посередине экрана (Только для самп)
C++:
void setNextWindowPositionCenter()
{
    ImGui::SetNextWindowPos(ImVec2( *(int*)0xC9C040 / 2,  *(int*)0xC9C044 / 2), ImGuiCond_Once, ImVec2(0.5F, 0.5F));
}
 
Последнее редактирование:

MISTER_GONWIK

Всефорумный гонщик
Всефорумный модератор
1,262
1,752
Функция копирование текста в буффер
C++:
void SetClipboardText(char* txt)
{
    if (OpenClipboard(NULL))
    {
        HGLOBAL clipbuffer;
        char* buffer;
        EmptyClipboard();
        clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(txt) + 1);
        buffer = (char*)GlobalLock(clipbuffer);
        strcpy(buffer, txt);
        GlobalUnlock(clipbuffer);
        SetClipboardData(CF_TEXT, clipbuffer);
        CloseClipboard();
    }
}
Получает путь к корневой папке gta_sa.exe
C++:
void GetPath(char* OutPutBuffer)
{
    GetModuleFileNameA(GetModuleHandleA(NULL), OutPutBuffer, 260);
    memset(OutPutBuffer + (strlen(OutPutBuffer) - strlen("/gta_sa.exe")), 0, 1);
}
Устанавливает позицию ImGui окна посередине экрана (Только для самп)
C++:
void setNextWindowPositionCenter()
{
    ImGui::SetNextWindowPos(ImVec2( *(int*)0xC9C040 / 2,  *(int*)0xC9C044 / 2), ImGuiCond_Once, ImVec2(0.5F, 0.5F));
}
Выводит крутой череп в sf консоль (Только для самп)
C++:
void PrintCHEREP()
{
    char* XXX;
    XXX = (char*)malloc(1980);
    XXX =
        "___________________0000000000000000000____________________\n"
        "_________________000000_____________0000000________________\n"
        "______________0000_______________________0000______________\n"
        "_____________000_____________________________00____________\n"
        "____________00________________________________00___________\n"
        "___________00_________________________________00___________\n"
        "__________00___________________________________00__________\n"
        "__________00_00_____________________________00_00__________\n"
        "__________00_00_____________________________00__0__________\n"
        "__________00_00_____________________________00__0__________\n"
        "__________00__00____________________________00_00__________\n"
        "__________00__00___________________________00__00__________\n"
        "___________00_00___00000000_____00000000___00_00___________\n"
        "____________0000_0000000000_____0000000000_00000___________\n"
        "_____________000_0000000000_____0000000000_000_____________\n"
        "____000_______00__00000000_______000000000__00______0000___\n"
        "___00000_____00___0000000___000___0000000___00_____000000__\n"
        "__00___00____00_____000____00000____000_____00____00___00__\n"
        "_000____0000__00__________0000000__________00__0000____000_\n"
        "00_________00000000_______0000000_______000000000________00\n"
        "000000000_____00000000____0000000____00000000______00000000\n"
        "__0000_00000______00000______________000_00_____000000_000_\n"
        "__________000000__000__00___________00__000__000000________\n"
        "______________000000_00_00000000000_00_000000______________\n"
        "__________________00_00_0_0_0_0_0_0_0_0_00_________________\n"
        "________________0000__0_0_0_0_0_0_0_0___00000______________\n"
        "____________00000_00___0000000000000___00_00000____________\n"
        "____0000000000_____00_________________00______000000000____\n"
        "___00___________0000000_____________00000000__________00___\n"
        "____000_____00000_____000000000000000_____00000_____000____\n"
        "______00___000___________000000000___________000___00______\n"
        "______00__00___________________________________00__00______\n"
        "_______0000_____________________________________0000_______\n";
    SF->LogConsole(XXX);
    free(XXX);
}
ужасно.
 
  • Нравится
Реакции: loganhackerdff и imring

Const

Потрачен
28
54
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
FPS Unlock:
uint32_t dwSAMPHandle = reinterpret_cast<uint32_t>(LoadLibrary("SAMP.dll")); // Instead of this use your variable.

if (!dwSAMPHandle)
    return; // Maybe, samp in this time didn't initialized.

auto PatchFrameLimiter = [&]()
{
    /* Set frame sleep to NULL */

    *reinterpret_cast<uint8_t *>(0x00BAB318) = 0x00;
    *reinterpret_cast<uint8_t *>(0x0053E94C) = 0x00;

    DWORD dwProtection = PAGE_EXECUTE_READWRITE;

    VirtualProtect(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), 6UL, dwProtection, &dwProtection);

    memset(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), 0x90, 6UL); // Nop all instructions (size of jne 6 bytes, not 5, like default jmp).
    memcpy(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), "\x0F\x85", 2UL); // First two bytes it's opcode in jne.

    *reinterpret_cast<uint32_t *>(dwSAMPHandle + 0x9D183 + 2) =
        (dwSAMPHandle + 0x9D2F9) - (dwSAMPHandle + 0x9D183) - 6UL; // Fill another 4 bytes by relative address on epilogue.
   
    VirtualProtect(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), 6UL, dwProtection, &dwProtection);
};

auto RestorePatch = [&]()
{
    /* Restore frame sleep */

    *reinterpret_cast<uint8_t *>(0x00BAB318) = 0x01;
    *reinterpret_cast<uint8_t *>(0x0053E94C) = 0x02;

    DWORD dwProtection = PAGE_EXECUTE_READWRITE;

    VirtualProtect(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), 6UL, dwProtection, &dwProtection);
    memcpy(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), "\x75\x2C\xB8\x00\x80", 6UL); // Restore original instruction.
    VirtualProtect(reinterpret_cast<LPVOID>(dwSAMPHandle + 0x9D183), 6UL, dwProtection, &dwProtection);
};
 

_=Gigant=_

Известный
144
222
drawing imgui on players

sa-mp-010.png


C++:
            for (int iplayers = 0; iplayers < SAMP_MAX_PLAYERS; iplayers++)
            {
                if (g_Players->iIsListed[iplayers] != 1)
                    continue;

                actor_info* info = getGTAPedFromSAMPPlayerID(iplayers);

                if (!info)
                    continue;

                float* pPos = &info->base.matrix[12];

                if (vect3_dist(pPos, &g_Players->pLocalPlayer->pSAMP_Actor->pGTA_Ped->base.matrix[4 * 3]) > 100.0)
                    continue;

                D3DXVECTOR3 draw_getvec, info_toscreen;
                draw_getvec.x = pPos[0];
                draw_getvec.y = pPos[1];
                draw_getvec.z = pPos[2];
                CalcScreenCoors(&draw_getvec, &info_toscreen);

                if (info_toscreen.z < 1.f)
                    continue;

                ImGui::SetNextWindowPos(ImVec2(info_toscreen.x, info_toscreen.y));
                if (ImGui::Begin("##ImGuiMenuOnPlayers", &bEnable, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar))
                {

                    ImGui::Text("%s" getPlayersNameiplayers));

                    ImGui::End();

                }
            }
 

imring

Ride the Lightning
Всефорумный модератор
2,365
2,552
включает курсор (нужен plugin-sdk)
C++:
#ifdef IMGUI_VERSION
void show_cursor(bool show, bool is_imgui = false)
#else
void show_cursor(bool show)
#endif
{
    if (show) {
        patch::Nop(0x541DF5, 5); // don't call CControllerConfigManager::AffectPadFromKeyBoard
        patch::Nop(0x53F417, 5); // don't call CPad__getMouseState
        patch::SetRaw(0x53F41F, "\x33\xC0\x0F\x84", 4); // test eax, eax -> xor eax, eax
                                                        // jl loc_53F526 -> jz loc_53F526
        patch::PutRetn(0x6194A0); // disable RsMouseSetPos (ret)
#ifdef IMGUI_VERSION
        if(is_imgui) ImGui::GetIO().MouseDrawCursor = true; else
#endif
        static_cast<IDirect3DDevice9 *>(RwD3D9GetCurrentD3DDevice())->ShowCursor(TRUE);
    } else {
        patch::SetRaw(0x541DF5, "\xE8\x46\xF3\xFE\xFF", 5); // call CControllerConfigManager::AffectPadFromKeyBoard
        patch::SetRaw(0x53F417, "\xE8\xB4\x7A\x20\x00", 5); // call CPad__getMouseState
        patch::SetRaw(0x53F41F, "\x85\xC0\x0F\x8C", 4); // xor eax, eax -> test eax, eax
                                                        // jz loc_53F526 -> jl loc_53F526
        patch::SetUChar(0x6194A0, 0xE9); // jmp setup
        static_cast<IDirect3DDevice9 *>(RwD3D9GetCurrentD3DDevice())->ShowCursor(FALSE);
#ifdef IMGUI_VERSION
        ImGui::GetIO().MouseDrawCursor = false;
#endif
    }

    CPad::NewMouseControllerState.X = 0;
    CPad::NewMouseControllerState.Y = 0;
    Call<0x541BD0>(); // CPad::ClearMouseHistory
    Call<0x541DD0>(); // CPad::UpdatePads
}
 

AdCKuY_DpO4uLa

Адский дрочер
Друг
317
676
отключает и включает возможность открывать и закрывать таб (0.3.7-R1)
C++:
memcpy((void*)(GetModuleHandleA("samp.dll") + 0x6AD33), (BYTE*)"\x83\x3E\x01", 3);//отключить таб
memcpy((void*)(GetModuleHandleA("samp.dll") + 0x6AD33), (BYTE*)"\x83\x3E\x00", 3);//включить таб