Skip to content

Commit

Permalink
fixed offsets and imgui theme
Browse files Browse the repository at this point in the history
  • Loading branch information
yinleiCoder committed May 1, 2024
1 parent fafacad commit b24603e
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 145 deletions.
18 changes: 12 additions & 6 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## Changes📣

最新更新于2024年4月29日 21:56,现有功能如下:
最近更新于2024年05月01日 10:50

- fixed 5月1日cs2官方游戏更新后的offsets
- 优化ImGui的主题UI、添加时间水印

## Features

- 方框透视
- 骨骼透视
Expand All @@ -16,11 +21,12 @@

## Usage👌

1. 打开`CS2`游戏,并进入游戏房间
2. 进入游戏房间后,此时鼠标双击`CS2CheatCpp.exe`运行外挂程序
3. 运行外挂程序后,会显示外挂程序菜单,可以按`Insert键`进行显示/隐藏
4. 若没有显示外挂程序菜单,则请提交日志文件记录 - 多数可能为offsets与CS2官方更新不同步,可clone代码后自行构建
5. 每局结束后,建议先退出外挂程序,等到再次进入游戏房间后重复上述步骤 - 因为`句柄劫持`有时候效果不是非常好,至少我没有被封过
1. 确保您的windows电脑上安装了`Directx` - 因为cs2游戏使用的是[directx 11](https://www.pcgamingwiki.com/wiki/Counter-Strike_2)
2. 打开`CS2`游戏,并进入游戏房间
3. 进入游戏房间后,此时鼠标双击`CS2CheatCpp.exe`运行外挂程序
4. 运行外挂程序后,会显示外挂程序菜单,可以按`Insert键`进行显示/隐藏
5. 若没有显示外挂程序菜单,则请提交日志文件记录 - 多数可能为offsets与CS2官方更新不同步,可clone代码后自行构建
6. 【可选操作】每局结束后,建议先退出外挂程序,等到再次进入游戏房间后重复上述步骤 - 因为`句柄劫持`有时候效果不是非常好,至少我目前没有被封过

> 该演戏就演戏,被封号后果自负,后续会更新内部外挂实现ESP外挂不能实现的功能

Expand Down
4 changes: 2 additions & 2 deletions CS2CheatCpp/CS2_Cheat_Log.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Tip]: After running this program, please make sure to read the software usage instructions. If it doesn't work, please copy this log file record to the GitHub repository and submit an issue, or directly contact the author via WeChat at yl1099129793. The author has limited capacity and cannot synchronously update CS2 game patch. If urgently needed, you can fork this repository and modify offsets to build with the latest value.

[2024/04/29 22:36:00] cs2.exe's process id located at11308
[2024/04/29 22:36:00] client.dll -> 0x7fffb69a0000
[2024/05/01 10:59:41] cs2.exe's process id located at7172
[2024/05/01 10:59:41] client.dll -> 0x7ffc93b70000
34 changes: 17 additions & 17 deletions CS2CheatCpp/SDK/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-04-27 00:03:34.843899 UTC
// 2024-05-01 00:25:27.858971200 UTC

#pragma once

Expand All @@ -8,21 +8,21 @@
namespace cs2_dumper {
// Module: client.dll
namespace buttons {
constexpr std::ptrdiff_t attack = 0x1733230;
constexpr std::ptrdiff_t attack2 = 0x17332C0;
constexpr std::ptrdiff_t back = 0x1733500;
constexpr std::ptrdiff_t duck = 0x17337D0;
constexpr std::ptrdiff_t forward = 0x1733470;
constexpr std::ptrdiff_t jump = 0x1733740;
constexpr std::ptrdiff_t left = 0x1733590;
constexpr std::ptrdiff_t lookatweapon = 0x192EE70;
constexpr std::ptrdiff_t reload = 0x17331A0;
constexpr std::ptrdiff_t right = 0x1733620;
constexpr std::ptrdiff_t showscores = 0x192ED50;
constexpr std::ptrdiff_t sprint = 0x1733110;
constexpr std::ptrdiff_t turnleft = 0x1733350;
constexpr std::ptrdiff_t turnright = 0x17333E0;
constexpr std::ptrdiff_t use = 0x17336B0;
constexpr std::ptrdiff_t zoom = 0x192EDE0;
constexpr std::ptrdiff_t attack = 0x1736410;
constexpr std::ptrdiff_t attack2 = 0x17364A0;
constexpr std::ptrdiff_t back = 0x17366E0;
constexpr std::ptrdiff_t duck = 0x17369B0;
constexpr std::ptrdiff_t forward = 0x1736650;
constexpr std::ptrdiff_t jump = 0x1736920;
constexpr std::ptrdiff_t left = 0x1736770;
constexpr std::ptrdiff_t lookatweapon = 0x19329E0;
constexpr std::ptrdiff_t reload = 0x1736380;
constexpr std::ptrdiff_t right = 0x1736800;
constexpr std::ptrdiff_t showscores = 0x19328C0;
constexpr std::ptrdiff_t sprint = 0x17362F0;
constexpr std::ptrdiff_t turnleft = 0x1736530;
constexpr std::ptrdiff_t turnright = 0x17365C0;
constexpr std::ptrdiff_t use = 0x1736890;
constexpr std::ptrdiff_t zoom = 0x1932950;
}
}
2 changes: 1 addition & 1 deletion CS2CheatCpp/SDK/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-04-27 00:03:34.843899 UTC
// 2024-05-01 00:25:27.858971200 UTC

#pragma once

Expand Down
46 changes: 23 additions & 23 deletions CS2CheatCpp/SDK/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-04-27 00:03:34.843899 UTC
// 2024-05-01 00:25:27.858971200 UTC

#pragma once

Expand All @@ -9,43 +9,43 @@ namespace cs2_dumper {
namespace offsets {
// Module: client.dll
namespace client_dll {
constexpr std::ptrdiff_t dwCSGOInput = 0x192EF50;
constexpr std::ptrdiff_t dwEntityList = 0x18C6268;
constexpr std::ptrdiff_t dwGameEntitySystem = 0x19E3B60;
constexpr std::ptrdiff_t dwCSGOInput = 0x1932AC0;
constexpr std::ptrdiff_t dwEntityList = 0x18C9E78;
constexpr std::ptrdiff_t dwGameEntitySystem = 0x19E7560;
constexpr std::ptrdiff_t dwGameEntitySystem_getHighestEntityIndex = 0x1510;
constexpr std::ptrdiff_t dwGameRules = 0x1923360;
constexpr std::ptrdiff_t dwGlobalVars = 0x172DD50;
constexpr std::ptrdiff_t dwGlowManager = 0x1923778;
constexpr std::ptrdiff_t dwLocalPlayerController = 0x1915C08;
constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x173A3B8;
constexpr std::ptrdiff_t dwPlantedC4 = 0x192C3F8;
constexpr std::ptrdiff_t dwPrediction = 0x173A280;
constexpr std::ptrdiff_t dwSensitivity = 0x19240A8;
constexpr std::ptrdiff_t dwGameRules = 0x1926D80;
constexpr std::ptrdiff_t dwGlobalVars = 0x1730F20;
constexpr std::ptrdiff_t dwGlowManager = 0x19271A0;
constexpr std::ptrdiff_t dwLocalPlayerController = 0x1919588;
constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x173D5A8;
constexpr std::ptrdiff_t dwPlantedC4 = 0x192FF68;
constexpr std::ptrdiff_t dwPrediction = 0x173D470;
constexpr std::ptrdiff_t dwSensitivity = 0x1927AC8;
constexpr std::ptrdiff_t dwSensitivity_sensitivity = 0x40;
constexpr std::ptrdiff_t dwViewAngles = 0x19342E0;
constexpr std::ptrdiff_t dwViewMatrix = 0x19278A0;
constexpr std::ptrdiff_t dwViewRender = 0x19280A0;
constexpr std::ptrdiff_t dwWeaponC4 = 0x18C9830;
constexpr std::ptrdiff_t dwViewAngles = 0x1937E50;
constexpr std::ptrdiff_t dwViewMatrix = 0x192B2C0;
constexpr std::ptrdiff_t dwViewRender = 0x192BAC0;
constexpr std::ptrdiff_t dwWeaponC4 = 0x18CD2D0;
}
// Module: engine2.dll
namespace engine2_dll {
constexpr std::ptrdiff_t dwBuildNumber = 0x516574;
constexpr std::ptrdiff_t dwNetworkGameClient = 0x515AC8;
constexpr std::ptrdiff_t dwBuildNumber = 0x518744;
constexpr std::ptrdiff_t dwNetworkGameClient = 0x517AF8;
constexpr std::ptrdiff_t dwNetworkGameClient_deltaTick = 0x258;
constexpr std::ptrdiff_t dwNetworkGameClient_getLocalPlayer = 0xF0;
constexpr std::ptrdiff_t dwNetworkGameClient_getMaxClients = 0x250;
constexpr std::ptrdiff_t dwNetworkGameClient_signOnState = 0x240;
constexpr std::ptrdiff_t dwWindowHeight = 0x5CEE4C;
constexpr std::ptrdiff_t dwWindowWidth = 0x5CEE48;
constexpr std::ptrdiff_t dwWindowHeight = 0x5D1084;
constexpr std::ptrdiff_t dwWindowWidth = 0x5D1080;
}
// Module: inputsystem.dll
namespace inputsystem_dll {
constexpr std::ptrdiff_t dwInputSystem = 0x367A0;
constexpr std::ptrdiff_t dwInputSystem = 0x377C0;
}
// Module: matchmaking.dll
namespace matchmaking_dll {
constexpr std::ptrdiff_t dwGameTypes = 0x1D21E0;
constexpr std::ptrdiff_t dwGameTypes_mapName = 0x1D2300;
constexpr std::ptrdiff_t dwGameTypes = 0x1D2290;
constexpr std::ptrdiff_t dwGameTypes_mapName = 0x1D23B0;
}
}
}
10 changes: 7 additions & 3 deletions CS2CheatCpp/imgui.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Window][Debug##Default]
Pos=60,60
Size=400,400
Size=296,50

[Window][CS2 ESP Cheat]
Pos=619,218
Size=670,488
Pos=547,160
Size=712,545

[Window][CS2]
Pos=60,61
Expand All @@ -15,3 +15,7 @@ Collapsed=1
Pos=267,100
Size=550,676

[Window][watermark]
Pos=10,10
Size=211,32

58 changes: 56 additions & 2 deletions CS2CheatCpp/src/gui.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define _CRT_SECURE_NO_WARNINGS

#include <corecrt_math.h>
#include "gui.h"
#include "../dependencies/ImGui/imgui.h"
Expand Down Expand Up @@ -177,6 +179,47 @@ void gui::CreateImGui() noexcept

ImGui_ImplWin32_Init(overlay);
ImGui_ImplDX11_Init(device, device_context);

ImGuiStyle& style = ImGui::GetStyle();
style.Alpha = 1.0;
style.WindowRounding = 3;
style.GrabRounding = 1;
style.GrabMinSize = 20;
style.FrameRounding = 3;

style.Colors[ImGuiCol_Text] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.00f, 0.40f, 0.41f, 1.00f);
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
style.Colors[ImGuiCol_Border] = ImVec4(0.00f, 1.00f, 1.00f, 0.65f);
style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
style.Colors[ImGuiCol_FrameBg] = ImVec4(0.44f, 0.80f, 0.80f, 0.18f);
style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.44f, 0.80f, 0.80f, 0.27f);
style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.44f, 0.81f, 0.86f, 0.66f);
style.Colors[ImGuiCol_TitleBg] = ImVec4(0.14f, 0.18f, 0.21f, 0.73f);
style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.54f);
style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.00f, 1.00f, 1.00f, 0.27f);
style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.20f);
style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.22f, 0.29f, 0.30f, 0.71f);
style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.00f, 1.00f, 1.00f, 0.44f);
style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.00f, 1.00f, 1.00f, 0.74f);
style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_CheckMark] = ImVec4(0.00f, 1.00f, 1.00f, 0.68f);
style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.00f, 1.00f, 1.00f, 0.36f);
style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.00f, 1.00f, 1.00f, 0.76f);
style.Colors[ImGuiCol_Button] = ImVec4(0.00f, 0.65f, 0.65f, 0.46f);
style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.01f, 1.00f, 1.00f, 0.43f);
style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.00f, 1.00f, 1.00f, 0.62f);
style.Colors[ImGuiCol_Header] = ImVec4(0.00f, 1.00f, 1.00f, 0.33f);
style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.00f, 1.00f, 1.00f, 0.42f);
style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.00f, 1.00f, 1.00f, 0.54f);
style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 1.00f, 1.00f, 0.54f);
style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.00f, 1.00f, 1.00f, 0.74f);
style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_PlotLines] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 1.00f, 1.00f, 0.22f);
}

void gui::DestroyImGui() noexcept
Expand Down Expand Up @@ -224,6 +267,16 @@ void gui::EndRender() noexcept

void gui::Render() noexcept
{
// 水印
auto start = std::chrono::system_clock::now();
auto end = std::chrono::system_clock::now();
auto elasped_seconds = end - start;
auto end_time = std::chrono::system_clock::to_time_t(end);
ImGui::SetNextWindowPos({ 10, 10 });
ImGui::SetWindowSize(ImVec2(296, 50));
ImGui::Begin("watermark", 0, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar);
ImGui::Text("yinlei | %s", std::ctime(&end_time));
ImGui::End();
if (menuToggle) {
// 更新当前玩家最大速度
if (speed > maxSpeed) {
Expand All @@ -233,7 +286,8 @@ void gui::Render() noexcept
ImGui::ShowDemoWindow(&show_demo_window);*/
ImGuiWindowFlags window_flags = 0;
window_flags |= ImGuiWindowFlags_MenuBar;
ImGui::SetNextWindowSize({ 600.f,500.f }, ImGuiCond_FirstUseEver);
window_flags |= ImGuiWindowFlags_NoCollapse;
ImGui::SetNextWindowSize(ImVec2(900, 450), ImGuiCond_FirstUseEver);
ImGui::Begin("CS2 ESP Cheat", 0, window_flags);
if (ImGui::BeginMenuBar())
{
Expand Down Expand Up @@ -312,7 +366,7 @@ void gui::Render() noexcept
ImGui::Text("Maximum movement speed: %d", maxSpeed);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("About"))
if (ImGui::BeginTabItem("Misc"))
{
ImGui::SeparatorText("Github Homepage");
ImGui::TextWrapped("https://github.com/yinleiCoder/cs2-cheat-cpp");
Expand Down
1 change: 1 addition & 0 deletions CS2CheatCpp/src/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <dwmapi.h>
#include <windowsx.h>
#include <Windows.h>
#include <chrono>

namespace gui
{
Expand Down
Loading

0 comments on commit b24603e

Please sign in to comment.