Merge branch 'experimental' into main

This commit is contained in:
IMXNOOBX
2023-11-04 22:06:10 +01:00
committed by GitHub
3 changed files with 34 additions and 4 deletions
+11
View File
@@ -3,6 +3,17 @@
namespace render
{
void DrawCircle(HDC hdc, int x, int y, int radius, COLORREF color)
{
HBRUSH hBrush = CreateSolidBrush(color);
HBRUSH hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
Ellipse(hdc, x - radius, y - radius, x + radius, y + radius);
SelectObject(hdc, hOldBrush);
DeleteObject(hBrush);
}
void DrawBorderBox(HDC hdc, int x, int y, int w, int h, COLORREF borderColor)
{
HBRUSH hBorderBrush = CreateSolidBrush(borderColor);
+22 -3
View File
@@ -125,21 +125,40 @@ namespace hack {
const Vector3 origin = process->read<Vector3>(pCSPlayerPawn + updater::offsets::m_vecOrigin);
const Vector3 head = { origin.x, origin.y, origin.z + 75.f };
if (origin.x == localOrigin.x && origin.y == localOrigin.y && origin.z == localOrigin.z)
continue;
const uintptr_t gamescene = process->read<uint64_t>(pCSPlayerPawn + 0x310);
const uintptr_t bonearray = process->read<uint64_t>(gamescene + 0x160 + 0x80);
const Vector3 headPos = process->read<Vector3>(bonearray + 6 * 32);
if (config::render_distance != -1 && (localOrigin - origin).length2d() > config::render_distance)
continue;
if (origin.x == 0 && origin.y == 0)
continue;
const Vector3 screenPos = origin.world_to_screen(view_matrix);
const Vector3 screenHead = head.world_to_screen(view_matrix);
const Vector3 screenHeadPos = headPos.world_to_screen(view_matrix);
if (screenPos.z >= 0.01f) {
const float height = screenPos.y - screenHead.y;
const float width = height / 2.4f;
const float head_height = (screenPos.y - screenHead.y) / 8;
const float head_width = (height / 2.4f) / 4;
const float head_height = (screenHeadPos.y - screenHeadPos.y) / 8;
const float head_width = (head_height / 2.4f) / 4;
float distance = localOrigin.calculate_distance(origin);
int roundedDistance = std::round(distance / 10.f);
render::DrawCircle(
g::hdcBuffer,
screenHeadPos.x,
screenHeadPos.y,
5,
config::esp_box_color_enemy
);
render::DrawBorderBox(
g::hdcBuffer,
screenHead.x - width / 2,
@@ -293,7 +312,7 @@ namespace hack {
}
}
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
// std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
+1 -1
View File
@@ -22,4 +22,4 @@
"m_sSanitizedPlayerName": 1824,
"m_iTeamNum": 959,
"m_vecOrigin": 4644
}
}