• Ну и что вы думаете? Мы взяли и создали свой собственный чат, с блекджеком и шлюхами, теперь все легенды в одном месте: даже те 1000 человек, которых мы забанили в старом чате 🫡 Будем публиковать там очень интересные подробности нового дизайна форума, oh yeah

    Вступай и становись легендой, пока это не стало поздно: жмякай на меня, ток не сильно(

Вопрос Как зделать Model Changer

Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2020
Сообщения
28
Реакции[?]
1
Поинты[?]
1K
Я знаю есть SetModel(); как ее хукнуть и юзать?
 
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2020
Сообщения
28
Реакции[?]
1
Поинты[?]
1K
hook(SetModel);
а если реально попробуй здесь в сурсах чекнуть, там есть
sensical

Код:
void T::SkinsChanger()
{
    ImGui::BeginChild(CS_XOR("misc.settings"), ImVec2(0, ImGui::GetContentRegionAvail().y / 2.f), true, ImGuiWindowFlags_MenuBar);
    {
        if (ImGui::Button(CS_XOR("Refresh list##player_model"), ImVec2(-1, 15 * MENU::flDpiScale))) {
            bNeedToUpdate = true;
        }

        if (bNeedToUpdate) {
            ImGui::EndChild();
            ModelChanger->UpdatePlayerModels();
            bNeedToUpdate = false;
            return;
        }

        // Отрисовка списка
        if (ModelChanger->vecPlayerModels.empty()) {
            ImGui::TextUnformatted("No models found.");
        }
        else {
            ImGui::PushItemWidth(-1);
            if (ImGui::BeginListBox(CS_XOR("##player_model.list"), ImVec2(0, 100))) {
                for (std::size_t i = 0U; i < ModelChanger->vecPlayerModels.size(); i++) {
                    Model_t pModel = ModelChanger->vecPlayerModels[i];

                    if (ImGui::Selectable(pModel.strModelName.c_str(), (ModelChanger->nSelectedPlayerModel == i)))
                        ModelChanger->nSelectedPlayerModel = i;
                }
                ImGui::EndListBox();

               ImGui::Checkbox(CS_XOR("PlayerModelChanger"), &C_GET(bool, Vars.bPlayerModelChanger));
               if (C_GET(bool, Vars.bPlayerModelChanger))
                       ModelChanger->SetPlayerModel();
            }
            ImGui::PopItemWidth();
        }
    }

modelchanger.cpp:
#include "modelchanger.h"

#include <iostream>
#include <filesystem>
#include <algorithm>

#include "../../sdk/interfaces/iresourcesystem.h"
#include "../../sdk/entity.h"
#include "../../core/interfaces.h"
#include "../../utilities/string.h"
#include "../../sdk/interfaces/iengineclient.h"
#include "../../core/sdk.h"
#include "../../core/variables.h"

void CModelChanger::UpdateWeaponModels() {
    std::vector<Model_t> vecWeaponModels;

    std::string strModelsDirectory = STR::GetDirectory(WeaponModels);
    for (const auto& entry : std::filesystem::recursive_directory_iterator(strModelsDirectory)) {
        if (!entry.is_regular_file())
            continue;

        std::string strFileName = entry.path().filename().string();

        if (strFileName.size() < 6)
            continue;

        if (strFileName.substr(strFileName.size() - 7) != ".vmdl_c")
            continue;

        std::string strModelPath = entry.path().string();

        strModelPath = strModelPath.substr(0, strModelPath.size() - 2);
        std::replace(strModelPath.begin(), strModelPath.end(), '\\', '/');

        size_t pos = strModelPath.find("weapons/");
        if (pos != std::string::npos)
            strModelPath = strModelPath.substr(pos);

        Model_t pModel;
        pModel.strModelName = strFileName.substr(0, strFileName.size() - 8);
        pModel.strModelPath = strModelPath;
        vecWeaponModels.push_back(pModel);
    }

    ModelChanger->vecWeaponModels = vecWeaponModels;
}

void CModelChanger::UpdatePlayerModels() {
    std::vector<Model_t> vecPlayerModels;

    std::string strModelsDirectory = STR::GetDirectory(PlayerModels);
    for (const auto& entry : std::filesystem::recursive_directory_iterator(strModelsDirectory)) {
        if (!entry.is_regular_file())
            continue;

        std::string strFileName = entry.path().filename().string();

        if (strFileName.size() < 6)
            continue;

        if (strFileName.substr(strFileName.size() - 7) != ".vmdl_c")
            continue;

        if (strFileName.find("arm") != std::string::npos)
            continue;

        std::string strModelPath = entry.path().string();
        strModelPath = strModelPath.substr(0, strModelPath.size() - 2);
        std::replace(strModelPath.begin(), strModelPath.end(), '\\', '/');

        size_t pos = strModelPath.find("characters/models/");
        if (pos != std::string::npos)
            strModelPath = strModelPath.substr(pos);

        Model_t pModel;
        pModel.strModelName = strFileName.substr(0, strFileName.size() - 8);
        pModel.strModelPath = strModelPath;
        vecPlayerModels.push_back(pModel);
    }

    ModelChanger->vecPlayerModels = vecPlayerModels;
}

bool CModelChanger::SetPlayerModel() {
    if (!I::Engine->IsInGame() || !I::Engine->IsConnected())
        return false;

    if (!SDK::LocalPawn || SDK::LocalPawn->GetHealth() > 0)
        return false;

    if (C_GET(bool, Vars.bPlayerModelChanger)) {
        if (nSelectedPlayerModel == ~1U)
            return false;

        if (vecPlayerModels.size() <= nSelectedPlayerModel)
            return false;

        Model_t pModel = vecPlayerModels[nSelectedPlayerModel];
        const char* szModelPath = pModel.strModelPath.c_str();

        auto uPlayerModelHash = FNV1A::Hash(szModelPath);
        if (ModelChanger->uLastPlayerModelHash == uPlayerModelHash)
            return false;

        ModelChanger->uLastPlayerModelHash = uPlayerModelHash;

        I::ResourceSystem->PreCache(szModelPath);
        SDK::LocalPawn->SetModel(szModelPath);
    }

    return true;
}

SetModel:
void C_BaseModelEntity::SetModel(const char* szModelName) {
    using SetModel_t = void(CS_FASTCALL*)(C_BaseModelEntity* pBaseModelEntity, const char* szModelName);
    static auto fnSetModel = reinterpret_cast<SetModel_t>(MEM::FindPattern(CLIENT_DLL, "40 53 48 83 EC 20 48 8B D9 4C 8B C2 48 8B 0D ? ? ? ? 48 8D 54 24"));
    fnSetModel(this, szModelName);
}

вилетает чит когда обновляю модельки
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
19 Янв 2024
Сообщения
126
Реакции[?]
2
Поинты[?]
2K
Код:
void T::SkinsChanger()
{
    ImGui::BeginChild(CS_XOR("misc.settings"), ImVec2(0, ImGui::GetContentRegionAvail().y / 2.f), true, ImGuiWindowFlags_MenuBar);
    {
        if (ImGui::Button(CS_XOR("Refresh list##player_model"), ImVec2(-1, 15 * MENU::flDpiScale))) {
            bNeedToUpdate = true;
        }

        if (bNeedToUpdate) {
            ImGui::EndChild();
            ModelChanger->UpdatePlayerModels();
            bNeedToUpdate = false;
            return;
        }

        // Отрисовка списка
        if (ModelChanger->vecPlayerModels.empty()) {
            ImGui::TextUnformatted("No models found.");
        }
        else {
            ImGui::PushItemWidth(-1);
            if (ImGui::BeginListBox(CS_XOR("##player_model.list"), ImVec2(0, 100))) {
                for (std::size_t i = 0U; i < ModelChanger->vecPlayerModels.size(); i++) {
                    Model_t pModel = ModelChanger->vecPlayerModels[i];

                    if (ImGui::Selectable(pModel.strModelName.c_str(), (ModelChanger->nSelectedPlayerModel == i)))
                        ModelChanger->nSelectedPlayerModel = i;
                }
                ImGui::EndListBox();
            }
            ImGui::PopItemWidth();
        }
    }

modelchanger.cpp:
#include "modelchanger.h"

#include <iostream>
#include <filesystem>
#include <algorithm>

#include "../../sdk/interfaces/iresourcesystem.h"
#include "../../sdk/entity.h"
#include "../../core/interfaces.h"
#include "../../utilities/string.h"
#include "../../sdk/interfaces/iengineclient.h"
#include "../../core/sdk.h"
#include "../../core/variables.h"

void CModelChanger::UpdateWeaponModels() {
    std::vector<Model_t> vecWeaponModels;

    std::string strModelsDirectory = STR::GetDirectory(WeaponModels);
    for (const auto& entry : std::filesystem::recursive_directory_iterator(strModelsDirectory)) {
        if (!entry.is_regular_file())
            continue;

        std::string strFileName = entry.path().filename().string();

        if (strFileName.size() < 6)
            continue;

        if (strFileName.substr(strFileName.size() - 7) != ".vmdl_c")
            continue;

        std::string strModelPath = entry.path().string();

        strModelPath = strModelPath.substr(0, strModelPath.size() - 2);
        std::replace(strModelPath.begin(), strModelPath.end(), '\\', '/');

        size_t pos = strModelPath.find("weapons/");
        if (pos != std::string::npos)
            strModelPath = strModelPath.substr(pos);

        Model_t pModel;
        pModel.strModelName = strFileName.substr(0, strFileName.size() - 8);
        pModel.strModelPath = strModelPath;
        vecWeaponModels.push_back(pModel);
    }

    ModelChanger->vecWeaponModels = vecWeaponModels;
}

void CModelChanger::UpdatePlayerModels() {
    std::vector<Model_t> vecPlayerModels;

    std::string strModelsDirectory = STR::GetDirectory(PlayerModels);
    for (const auto& entry : std::filesystem::recursive_directory_iterator(strModelsDirectory)) {
        if (!entry.is_regular_file())
            continue;

        std::string strFileName = entry.path().filename().string();

        if (strFileName.size() < 6)
            continue;

        if (strFileName.substr(strFileName.size() - 7) != ".vmdl_c")
            continue;

        if (strFileName.find("arm") != std::string::npos)
            continue;

        std::string strModelPath = entry.path().string();
        strModelPath = strModelPath.substr(0, strModelPath.size() - 2);
        std::replace(strModelPath.begin(), strModelPath.end(), '\\', '/');

        size_t pos = strModelPath.find("characters/models/");
        if (pos != std::string::npos)
            strModelPath = strModelPath.substr(pos);

        Model_t pModel;
        pModel.strModelName = strFileName.substr(0, strFileName.size() - 8);
        pModel.strModelPath = strModelPath;
        vecPlayerModels.push_back(pModel);
    }

    ModelChanger->vecPlayerModels = vecPlayerModels;
}

bool CModelChanger::SetPlayerModel() {
    if (!I::Engine->IsInGame() || !I::Engine->IsConnected())
        return false;

    if (!SDK::LocalPawn || SDK::LocalPawn->GetHealth() > 0)
        return false;

    if (C_GET(bool, Vars.bPlayerModelChanger)) {
        if (nSelectedPlayerModel == ~1U)
            return false;

        if (vecPlayerModels.size() <= nSelectedPlayerModel)
            return false;

        Model_t pModel = vecPlayerModels[nSelectedPlayerModel];
        const char* szModelPath = pModel.strModelPath.c_str();

        auto uPlayerModelHash = FNV1A::Hash(szModelPath);
        if (ModelChanger->uLastPlayerModelHash == uPlayerModelHash)
            return false;

        ModelChanger->uLastPlayerModelHash = uPlayerModelHash;

        I::ResourceSystem->PreCache(szModelPath);
        SDK::LocalPawn->SetModel(szModelPath);
    }

    return true;
}

SetModel:
void C_BaseModelEntity::SetModel(const char* szModelName) {
    using SetModel_t = void(CS_FASTCALL*)(C_BaseModelEntity* pBaseModelEntity, const char* szModelName);
    static auto fnSetModel = reinterpret_cast<SetModel_t>(MEM::FindPattern(CLIENT_DLL, "40 53 48 83 EC 20 48 8B D9 4C 8B C2 48 8B 0D ? ? ? ? 48 8D 54 24"));
    fnSetModel(this, szModelName);
}

вилетает чит когда обновляю модельки
сигнатуру попробуй обнови хззз
 
Начинающий
Статус
Оффлайн
Регистрация
11 Авг 2023
Сообщения
161
Реакции[?]
7
Поинты[?]
8K
Код:
void T::SkinsChanger()
{
    ImGui::BeginChild(CS_XOR("misc.settings"), ImVec2(0, ImGui::GetContentRegionAvail().y / 2.f), true, ImGuiWindowFlags_MenuBar);
    {
        if (ImGui::Button(CS_XOR("Refresh list##player_model"), ImVec2(-1, 15 * MENU::flDpiScale))) {
            bNeedToUpdate = true;
        }

        if (bNeedToUpdate) {
            ImGui::EndChild();
            ModelChanger->UpdatePlayerModels();
            bNeedToUpdate = false;
            return;
        }

        // Отрисовка списка
        if (ModelChanger->vecPlayerModels.empty()) {
            ImGui::TextUnformatted("No models found.");
        }
        else {
            ImGui::PushItemWidth(-1);
            if (ImGui::BeginListBox(CS_XOR("##player_model.list"), ImVec2(0, 100))) {
                for (std::size_t i = 0U; i < ModelChanger->vecPlayerModels.size(); i++) {
                    Model_t pModel = ModelChanger->vecPlayerModels[i];

                    if (ImGui::Selectable(pModel.strModelName.c_str(), (ModelChanger->nSelectedPlayerModel == i)))
                        ModelChanger->nSelectedPlayerModel = i;
                }
                ImGui::EndListBox();

               ImGui::Checkbox(CS_XOR("PlayerModelChanger"), &C_GET(bool, Vars.bPlayerModelChanger));
               if (C_GET(bool, Vars.bPlayerModelChanger))
                       ModelChanger->SetPlayerModel();
            }
            ImGui::PopItemWidth();
        }
    }

modelchanger.cpp:
#include "modelchanger.h"

#include <iostream>
#include <filesystem>
#include <algorithm>

#include "../../sdk/interfaces/iresourcesystem.h"
#include "../../sdk/entity.h"
#include "../../core/interfaces.h"
#include "../../utilities/string.h"
#include "../../sdk/interfaces/iengineclient.h"
#include "../../core/sdk.h"
#include "../../core/variables.h"

void CModelChanger::UpdateWeaponModels() {
    std::vector<Model_t> vecWeaponModels;

    std::string strModelsDirectory = STR::GetDirectory(WeaponModels);
    for (const auto& entry : std::filesystem::recursive_directory_iterator(strModelsDirectory)) {
        if (!entry.is_regular_file())
            continue;

        std::string strFileName = entry.path().filename().string();

        if (strFileName.size() < 6)
            continue;

        if (strFileName.substr(strFileName.size() - 7) != ".vmdl_c")
            continue;

        std::string strModelPath = entry.path().string();

        strModelPath = strModelPath.substr(0, strModelPath.size() - 2);
        std::replace(strModelPath.begin(), strModelPath.end(), '\\', '/');

        size_t pos = strModelPath.find("weapons/");
        if (pos != std::string::npos)
            strModelPath = strModelPath.substr(pos);

        Model_t pModel;
        pModel.strModelName = strFileName.substr(0, strFileName.size() - 8);
        pModel.strModelPath = strModelPath;
        vecWeaponModels.push_back(pModel);
    }

    ModelChanger->vecWeaponModels = vecWeaponModels;
}

void CModelChanger::UpdatePlayerModels() {
    std::vector<Model_t> vecPlayerModels;

    std::string strModelsDirectory = STR::GetDirectory(PlayerModels);
    for (const auto& entry : std::filesystem::recursive_directory_iterator(strModelsDirectory)) {
        if (!entry.is_regular_file())
            continue;

        std::string strFileName = entry.path().filename().string();

        if (strFileName.size() < 6)
            continue;

        if (strFileName.substr(strFileName.size() - 7) != ".vmdl_c")
            continue;

        if (strFileName.find("arm") != std::string::npos)
            continue;

        std::string strModelPath = entry.path().string();
        strModelPath = strModelPath.substr(0, strModelPath.size() - 2);
        std::replace(strModelPath.begin(), strModelPath.end(), '\\', '/');

        size_t pos = strModelPath.find("characters/models/");
        if (pos != std::string::npos)
            strModelPath = strModelPath.substr(pos);

        Model_t pModel;
        pModel.strModelName = strFileName.substr(0, strFileName.size() - 8);
        pModel.strModelPath = strModelPath;
        vecPlayerModels.push_back(pModel);
    }

    ModelChanger->vecPlayerModels = vecPlayerModels;
}

bool CModelChanger::SetPlayerModel() {
    if (!I::Engine->IsInGame() || !I::Engine->IsConnected())
        return false;

    if (!SDK::LocalPawn || SDK::LocalPawn->GetHealth() > 0)
        return false;

    if (C_GET(bool, Vars.bPlayerModelChanger)) {
        if (nSelectedPlayerModel == ~1U)
            return false;

        if (vecPlayerModels.size() <= nSelectedPlayerModel)
            return false;

        Model_t pModel = vecPlayerModels[nSelectedPlayerModel];
        const char* szModelPath = pModel.strModelPath.c_str();

        auto uPlayerModelHash = FNV1A::Hash(szModelPath);
        if (ModelChanger->uLastPlayerModelHash == uPlayerModelHash)
            return false;

        ModelChanger->uLastPlayerModelHash = uPlayerModelHash;

        I::ResourceSystem->PreCache(szModelPath);
        SDK::LocalPawn->SetModel(szModelPath);
    }

    return true;
}

SetModel:
void C_BaseModelEntity::SetModel(const char* szModelName) {
    using SetModel_t = void(CS_FASTCALL*)(C_BaseModelEntity* pBaseModelEntity, const char* szModelName);
    static auto fnSetModel = reinterpret_cast<SetModel_t>(MEM::FindPattern(CLIENT_DLL, "40 53 48 83 EC 20 48 8B D9 4C 8B C2 48 8B 0D ? ? ? ? 48 8D 54 24"));
    fnSetModel(this, szModelName);
}

вилетает чит когда обновляю модельки
че то не правильно сделал тогда. В откладке посмотри где он вылетает через стек вызовов
 
Сверху Снизу