Skip to content

Commit

Permalink
feat: aim assist, dumper updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stdNullPtr committed Dec 15, 2024
1 parent dbaba65 commit b4d819a
Show file tree
Hide file tree
Showing 34 changed files with 148 additions and 40 deletions.
13 changes: 8 additions & 5 deletions um-client/src/controller/Aim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ namespace cheat::aim

while (!stop_token.stop_requested())
{
if (aim_target && g::toggles::aim_hack && (GetAsyncKeyState(VK_MBUTTON) & 0x8000))
if (aim_target && g::toggles::aim_hack && !g::toggles::show_menu)
{
const float delta_x{aim_target->x - crosshair.x};
const float delta_y{aim_target->y - crosshair.y};
if (GetAsyncKeyState(VK_MBUTTON) & 0x8000 || (g::toggles::aim_assist && GetAsyncKeyState(VK_LBUTTON) & 0x8000))
{
const float delta_x{aim_target->x - crosshair.x};
const float delta_y{aim_target->y - crosshair.y};

move_mouse(delta_x, delta_y);
sleep_for(10us);
move_mouse(delta_x, delta_y);
sleep_for(10us);
}
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions um-client/src/controller/Cs2CheatController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ namespace cheat
std::optional<entity::Entity> Cs2CheatController::get_entity_from_list(const driver::Driver& driver, const int& index) const
{
const auto controller{get_entity_controller(driver, index)};
if (!controller.has_value())
if (!controller)
{
return std::nullopt;
}

const auto entity_pawn{get_entity_pawn(driver, controller.value())};
if (!entity_pawn.has_value())
const auto entity_pawn{get_entity_pawn(driver, *controller)};
if (!entity_pawn)
{
return std::nullopt;
}

return entity::Entity{controller.value(), entity_pawn.value()};
return entity::Entity{*controller, *entity_pawn};
}

entity::Entity Cs2CheatController::get_local_player(const driver::Driver& driver) const
Expand Down
12 changes: 12 additions & 0 deletions um-client/src/controller/Entity.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Entity.hpp"

#include "../sdk/dumper/offsets.hpp"
#include "../util/BoneMatrix.hpp"

namespace cheat::entity
{
Expand Down Expand Up @@ -104,6 +105,17 @@ namespace cheat::entity
return driver.read<util::Vec3>(entity_pawn_ + client_dll::C_BaseModelEntity::m_vecViewOffset) + get_vec_origin(driver);
}

util::Vec3 Entity::get_head_bone_pos(const driver::Driver& driver) const
{
constexpr auto bone_head{6};

const auto game_scene_node{get_game_scene_node(driver)};
const auto bone_array{driver.read<uintptr_t>(game_scene_node + client_dll::CPlayer_MovementServices_Humanoid::m_groundNormal)};
const auto head{driver.read<util::Vec3>(bone_array + bone_head * 32)};

return head;
}

void Entity::set_spotted(const driver::Driver& driver, const bool& spotted) const
{
const auto p_entity_spotted_state{entity_pawn_ + client_dll::C_CSPlayerPawn::m_entitySpottedState};
Expand Down
1 change: 1 addition & 0 deletions um-client/src/controller/Entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace cheat::entity
[[nodiscard]] util::Vec3 get_forward_vector(const driver::Driver& driver) const;
[[nodiscard]] util::Vec3 get_vec_origin(const driver::Driver& driver) const;
[[nodiscard]] util::Vec3 get_eye_pos(const driver::Driver& driver) const;
[[nodiscard]] util::Vec3 get_head_bone_pos(const driver::Driver& driver) const;

void set_spotted(const driver::Driver& driver, const bool& spotted) const;
void disable_flash(const driver::Driver& driver) const;
Expand Down
2 changes: 2 additions & 0 deletions um-client/src/global.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace g
static bool no_flash_hack{false};
static bool esp_hack{false};
static bool aim_hack{false};
static bool aim_assist{false};

inline void reset_toggles()
{
Expand All @@ -46,6 +47,7 @@ namespace g
no_flash_hack = false;
esp_hack = false;
aim_hack = false;
aim_assist = false;
}
}
}
7 changes: 6 additions & 1 deletion um-client/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ int main()
<< XORW(L"Visible on Radar: ") << (entity_spotted ? "yes" : "no") << '\n';
#endif

aim_targets.emplace_back(entity_eyes_pos_screen);
const auto head_bone_pos_world{entity->get_head_bone_pos(driver)};
const auto head_bone_pos_screen{render::utils::world_to_screen(view_matrix, head_bone_pos_world)};
const auto aim_position{head_bone_pos_screen};
aim_targets.emplace_back(aim_position);

if (glow_hack)
{
Expand All @@ -205,11 +208,13 @@ int main()
if (esp_hack && (render::utils::is_in_screen(entity_eyes_pos_screen) || render::utils::is_in_screen(entity_feet_pos_screen)))
{
const auto esp_player{util::esp::build_player_esp(entity_eyes_pos_screen, entity_feet_pos_screen)};
const auto esp_bones{util::esp::build_bone_esp(head_bone_pos_screen)};
const auto esp_health{util::esp::build_health_esp(esp_player.get_top_left(), esp_player.get_bottom_right(), player_health)};
const auto esp_player_bottom{util::esp::build_player_bottom_esp(entity_name, entity_eyes_pos_screen, esp_player.get_bottom_right(), weapon_name)};
const auto esp_player_top{util::esp::build_player_top_esp(is_scoped, entity_eyes_pos_screen, esp_player.get_top_left())};

draw_items.emplace_back(esp_player);
draw_items.emplace_back(esp_bones);
draw_items.append_range(esp_health);
draw_items.append_range(esp_player_bottom);
draw_items.append_range(esp_player_top);
Expand Down
12 changes: 12 additions & 0 deletions um-client/src/render/DrawCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,16 @@ namespace render

return cache;
}

DrawCache DrawCache::build_circle(const ImVec2& position, const ImVec4& col, const float& radius)
{
DrawCache cache;

cache.type_ = RenderObjectType::circle;
cache.position_ = position;
cache.color_ = col;
cache.radius_ = radius;

return cache;
}
}
2 changes: 2 additions & 0 deletions um-client/src/render/DrawCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ namespace render
static DrawCache build_rect(const ImVec2& top_left, const ImVec2& bottom_right, const bool& filled = false, const ImVec4& col = {255.0f, 0.0f, 0.0f, 255.0f}, const float& thick = 2.0f);

static DrawCache build_text(const std::string& text, const ImVec2& position, const ImVec4& col, const int& line_position);

static DrawCache build_circle(const ImVec2& position, const ImVec4& col, const float& radius);
};
}
36 changes: 28 additions & 8 deletions um-client/src/render/Render.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,22 @@ namespace render

if (GetAsyncKeyState(VK_F4) & 0x1)
{
esp_hack = !esp_hack;
no_flash_hack = !no_flash_hack;
}

if (GetAsyncKeyState(VK_F5) & 0x1)
{
aim_hack = !aim_hack;
esp_hack = !esp_hack;
}

if (GetAsyncKeyState(VK_F6) & 0x1)
{
no_flash_hack = !no_flash_hack;
aim_hack = !aim_hack;
}

if (GetAsyncKeyState(VK_F7) & 0x1 && aim_hack)
{
aim_assist = !aim_assist;
}

if (GetAsyncKeyState(VK_INSERT) & 0x1)
Expand Down Expand Up @@ -158,23 +163,38 @@ namespace render
ImGui::TextUnformatted(ICON_FA_EXCLAMATION_TRIANGLE);
ImGui::PopStyleColor();

ImGui::Checkbox(XOR("[F4] ESP "), &esp_hack);
ImGui::Checkbox(XOR("[F4] No flash (Unsafe)"), &no_flash_hack);
ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.5f, 0.0f, 1.0f));
ImGui::TextUnformatted(ICON_FA_EXCLAMATION_TRIANGLE);
ImGui::PopStyleColor();

ImGui::Checkbox(XOR("[F5] ESP "), &esp_hack);
ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.0f, 1.0f, 0.0f, 1.0f));
ImGui::TextUnformatted(ICON_FA_EYE);
ImGui::PopStyleColor();

ImGui::Checkbox(XOR("[F5] AIM "), &aim_hack);
ImGui::Checkbox(XOR("[F6] AIM "), &aim_hack);
ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
ImGui::TextUnformatted(ICON_FA_CROSSHAIRS);
ImGui::PopStyleColor();

ImGui::Checkbox(XOR("[F6] No flash (Unsafe)"), &no_flash_hack);
if (!aim_hack)
{
ImGui::BeginDisabled();
}
ImGui::Checkbox(XOR("[F7] AIM assist (just shoot) "), &aim_assist);
ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.5f, 0.0f, 1.0f));
ImGui::TextUnformatted(ICON_FA_EXCLAMATION_TRIANGLE);
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
ImGui::TextUnformatted(ICON_FA_CROSSHAIRS);
ImGui::PopStyleColor();
if (!aim_hack)
{
ImGui::EndDisabled();
}

if (is_paused)
{
ImGui::EndDisabled();
Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/animationsystem_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/buttons.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/client_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/engine2_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/host_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"build_number": 14055,
"timestamp": "2024-12-15T18:32:25.062878900+00:00"
"timestamp": "2024-12-15T21:31:09.733383900+00:00"
}
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/interfaces.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/materialsystem2_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/networksystem_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/offsets.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/panorama_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/particles_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/pulse_system_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/rendersystemdx11_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/resourcesystem_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/scenesystem_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/schemasystem_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/server_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/soundsystem_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/vphysics2_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
2 changes: 1 addition & 1 deletion um-client/src/sdk/dumper/worldrenderer_dll.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-12-15 18:32:25.062878900 UTC
// 2024-12-15 21:31:09.733383900 UTC

#pragma once

Expand Down
Loading

0 comments on commit b4d819a

Please sign in to comment.