Начинающий
- Статус
- Оффлайн
- Регистрация
- 21 Дек 2024
- Сообщения
- 54
- Реакции
- 0
крч нашел сурсы чита от траура и хотел пофиксить там пропадание ESP но не очень понимаю в чем проблема и как фиксануть
код еспов
void Cheat::RenderESP() {
if (!hProcess || !cheat.enableESP) return;
auto draw = ImGui::GetBackgroundDrawList();
std::vector<uintptr_t> current_poslist;
uintptr_t current_mtxpointer_addr = 0;
{
std::lock_guard<std::mutex> lock(data_mutex);
current_poslist = poslist;
current_mtxpointer_addr = mtxpointer_addr;
}
if (current_mtxpointer_addr == 0) return;
c_matrix view_matrix;
if (!ReadProcessMemory(hProcess, (LPCVOID)current_mtxpointer_addr, &view_matrix, sizeof(view_matrix), NULL)) {
return;
}
std::vector<Vector2> potentialTargets;
for (const auto& addr : current_poslist) {
TMatrix player_matrix{};
if (!ReadProcessMemory(hProcess, (LPCVOID)addr, &player_matrix, sizeof(player_matrix), NULL)) continue;
if (player_matrix.scale.x == 1.f && player_matrix.rotation.x == 0) {
Vector2 feet_screen, head_screen;
if (view_matrix.WorldToScreen({ player_matrix.position.x, player_matrix.position.y, player_matrix.position.z }, feet_screen) &&
view_matrix.WorldToScreen({ player_matrix.position.x, player_matrix.position.y + 1.8f, player_matrix.position.z }, head_screen)) {
float height = fabsf(head_screen.y - feet_screen.y);
float width = height * 0.5f;
float left = feet_screen.x - width / 2;
float right = feet_screen.x + width / 2;
float top = head_screen.y;
float bottom = feet_screen.y;
ImColor boxColor(
(int)(cheat.espBoxColor[0] * 255),
(int)(cheat.espBoxColor[1] * 255),
(int)(cheat.espBoxColor[2] * 255),
(int)(cheat.espBoxColor[3] * 255)
);
ImColor outlineColor(0, 0, 0, 200);
if (cheat.espbox) {
draw->AddRect(ImVec2(left - 1, top - 1), ImVec2(right + 1, bottom + 1), outlineColor, 0.0f, 15, 3.0f);
draw->AddRect(ImVec2(left, top), ImVec2(right, bottom), boxColor, 0.0f, 15, 2.0f);
}
if (cheat.espfill) {
ImColor fillColor(
(int)(cheat.espFillColor[0] * 255),
(int)(cheat.espFillColor[1] * 255),
(int)(cheat.espFillColor[2] * 255),
(int)(cheat.espFillColor[3] * 255)
);
draw->AddRectFilled(ImVec2(left, top), ImVec2(right, bottom), fillColor, 0.0f, 15);
}
код еспов
void Cheat::RenderESP() {
if (!hProcess || !cheat.enableESP) return;
auto draw = ImGui::GetBackgroundDrawList();
std::vector<uintptr_t> current_poslist;
uintptr_t current_mtxpointer_addr = 0;
{
std::lock_guard<std::mutex> lock(data_mutex);
current_poslist = poslist;
current_mtxpointer_addr = mtxpointer_addr;
}
if (current_mtxpointer_addr == 0) return;
c_matrix view_matrix;
if (!ReadProcessMemory(hProcess, (LPCVOID)current_mtxpointer_addr, &view_matrix, sizeof(view_matrix), NULL)) {
return;
}
std::vector<Vector2> potentialTargets;
for (const auto& addr : current_poslist) {
TMatrix player_matrix{};
if (!ReadProcessMemory(hProcess, (LPCVOID)addr, &player_matrix, sizeof(player_matrix), NULL)) continue;
if (player_matrix.scale.x == 1.f && player_matrix.rotation.x == 0) {
Vector2 feet_screen, head_screen;
if (view_matrix.WorldToScreen({ player_matrix.position.x, player_matrix.position.y, player_matrix.position.z }, feet_screen) &&
view_matrix.WorldToScreen({ player_matrix.position.x, player_matrix.position.y + 1.8f, player_matrix.position.z }, head_screen)) {
float height = fabsf(head_screen.y - feet_screen.y);
float width = height * 0.5f;
float left = feet_screen.x - width / 2;
float right = feet_screen.x + width / 2;
float top = head_screen.y;
float bottom = feet_screen.y;
ImColor boxColor(
(int)(cheat.espBoxColor[0] * 255),
(int)(cheat.espBoxColor[1] * 255),
(int)(cheat.espBoxColor[2] * 255),
(int)(cheat.espBoxColor[3] * 255)
);
ImColor outlineColor(0, 0, 0, 200);
if (cheat.espbox) {
draw->AddRect(ImVec2(left - 1, top - 1), ImVec2(right + 1, bottom + 1), outlineColor, 0.0f, 15, 3.0f);
draw->AddRect(ImVec2(left, top), ImVec2(right, bottom), boxColor, 0.0f, 15, 2.0f);
}
if (cheat.espfill) {
ImColor fillColor(
(int)(cheat.espFillColor[0] * 255),
(int)(cheat.espFillColor[1] * 255),
(int)(cheat.espFillColor[2] * 255),
(int)(cheat.espFillColor[3] * 255)
);
draw->AddRectFilled(ImVec2(left, top), ImVec2(right, bottom), fillColor, 0.0f, 15);
}