Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit fafacad

Browse files
committed
fix: rcs and autofire
1 parent 40dadff commit fafacad

10 files changed

Lines changed: 75 additions & 58 deletions

File tree

CHANGELOG.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
## Changes📣
22

3-
最新更新于2024年4月28日 16:46,现有功能如下:
3+
最新更新于2024年4月29日 21:56,现有功能如下:
44

55
- 方框透视
66
- 骨骼透视
77
- 自瞄锁头
88
- 枪后座力补偿
9-
- 跳越射击
109
- 连跳
1110
- 防闪光弹
1211
- 地图扫描敌人雷达

CS2CheatCpp/CS2_Cheat_Log.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[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.
22

3-
[2024/04/28 16:34:06] cs2.exe's process id located at18804
4-
[2024/04/28 16:34:06] client.dll -> 0x7ff987440000
3+
[2024/04/29 22:36:00] cs2.exe's process id located at11308
4+
[2024/04/29 22:36:00] client.dll -> 0x7fffb69a0000

CS2CheatCpp/imgui.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Pos=60,60
33
Size=400,400
44

55
[Window][CS2 ESP Cheat]
6-
Pos=0,8
6+
Pos=619,218
77
Size=670,488
88

99
[Window][CS2]

CS2CheatCpp/src/main.cpp

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
7272
std::vector<Entity> entities;
7373
entities.reserve(64);
7474

75-
static auto oldPunch = Vector3{};
75+
static auto oldAngle = Vector3{};
76+
static auto newAngle = Vector3{};
7677
static auto velocity = Vector3{};
7778

7879
while (gui::exit)
@@ -91,12 +92,12 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
9192
gui::EndRender();
9293
continue;
9394
}
95+
9496
// 处理外挂业务逻辑: 获取相关数据的地址
9597
localPlayer.pawnAddress = mem.Read<uintptr_t>(client + offsets::client_dll::dwLocalPlayerPawn);
9698
localPlayer.origin = mem.Read<Vector3>(localPlayer.pawnAddress + schemas::client_dll::C_BasePlayerPawn::m_vOldOrigin);
9799
localPlayer.viewOffset = mem.Read<Vector3>(localPlayer.pawnAddress + schemas::client_dll::C_BaseModelEntity::m_vecViewOffset);
98100
localPlayer.team = mem.Read<int>(localPlayer.pawnAddress + schemas::client_dll::C_BaseEntity::m_iTeamNum);
99-
localPlayer.entIndex = mem.Read<int>(localPlayer.pawnAddress + schemas::client_dll::C_CSPlayerPawnBase::m_iIDEntIndex);// 准星前的玩家id
100101
localPlayer.fFlag = mem.Read<unsigned int>(localPlayer.pawnAddress + schemas::client_dll::C_BaseEntity::m_fFlags);// 玩家的fFlag
101102
localPlayer.flashDuration = mem.Read<float>(localPlayer.pawnAddress + schemas::client_dll::C_CSPlayerPawnBase::m_flFlashBangTime);//玩家遭受闪光的时间
102103
localPlayer.velocity = mem.Read<Vector3>(localPlayer.pawnAddress + schemas::client_dll::C_BaseEntity::m_vecAbsVelocity);// 玩家移动速度
@@ -110,11 +111,11 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
110111
if (!mem.InForeground()) continue;
111112

112113
// 根据entity_list获取第一个入口点
113-
const auto list_entry = mem.Read<uintptr_t>(enity_list + (8 * (playerIndex & 0x7FFF) >> 9) + 16);// 16==0x10
114+
const auto list_entry = mem.Read<uintptr_t>(enity_list + (0x8 * (playerIndex & 0x7FFF) >> 9) + 0x10);
114115
if (!list_entry) continue;
115116

116117
// 获取currentController
117-
const auto currentController = mem.Read<uintptr_t>(list_entry + 120 * (playerIndex & 0x1FF));// 120==0x78
118+
const auto currentController = mem.Read<uintptr_t>(list_entry + 120 * (playerIndex & 0x1FF));
118119
if (!currentController) continue;
119120

120121
// 通过currentController获取pawnHandle
@@ -310,7 +311,7 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
310311
}
311312

312313
// 自瞄锁头并开枪
313-
if (gui::enableAimbot && entities.size() > 0) // && !gui::enableRadar && entities[0].spotted
314+
if (gui::enableAimbot && entities.size() > 0)
314315
{
315316
if (gui::enableTeamMode)
316317
{
@@ -321,6 +322,8 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
321322
std::stable_sort(entities.begin(), entities.end(), [](const Entity& entity1, const Entity& entity2) {
322323
return entity1.pixelDistance < entity2.pixelDistance;
323324
});
325+
326+
324327
// 计算自瞄需要偏移的角度
325328
if (entities[0].pixelDistance < gui::fovAimbot)
326329
{
@@ -331,13 +334,30 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
331334
mem.Write<Vector3>(client + offsets::client_dll::dwViewAngles, newAnglesVec3);
332335
}
333336

334-
// 开枪
337+
// 自动开枪 - 查找准星瞄准的敌人数据
338+
// 枪口准星前的玩家实体index
339+
localPlayer.entIndex = mem.Read<int>(localPlayer.pawnAddress + schemas::client_dll::C_CSPlayerPawnBase::m_iIDEntIndex);
335340
if (gui::enableAutoAttack && localPlayer.entIndex > 0)
336341
{
337-
mem.Write<int>(client + buttons::attack, PLUS_ATTACK);
338-
std::this_thread::sleep_for(std::chrono::milliseconds(2));
339-
mem.Write<int>(client + buttons::attack, MINUS_ATTACK);
340-
std::this_thread::sleep_for(std::chrono::milliseconds(2));
342+
const auto list_entry = mem.Read<uintptr_t>(enity_list + 0x8 * (localPlayer.entIndex >> 9) + 0x10);
343+
const auto entity = mem.Read<uintptr_t>(list_entry + 120 * (localPlayer.entIndex & 0x1FF));
344+
const auto enemyTeam = mem.Read<int>(entity + schemas::client_dll::C_BaseEntity::m_iTeamNum);
345+
bool shouldShoot = false;
346+
if (gui::enableTeamMode)
347+
{
348+
if ( enemyTeam != localPlayer.team)
349+
shouldShoot = true;
350+
}
351+
else
352+
{
353+
shouldShoot = true;
354+
}
355+
if (shouldShoot) {
356+
mem.Write<int>(client + buttons::attack, PLUS_ATTACK);
357+
std::this_thread::sleep_for(std::chrono::milliseconds(2));
358+
mem.Write<int>(client + buttons::attack, MINUS_ATTACK);
359+
std::this_thread::sleep_for(std::chrono::milliseconds(1));
360+
}
341361
}
342362
}
343363

@@ -361,7 +381,7 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
361381
}
362382

363383
// 跳越射击
364-
if (localPlayer.fFlag == INAIR && GetAsyncKeyState(VK_SHIFT))
384+
/*if (localPlayer.fFlag == INAIR && GetAsyncKeyState(VK_SHIFT))
365385
{
366386
std::this_thread::sleep_for(std::chrono::milliseconds(3));
367387
velocity = mem.Read<Vector3>(localPlayer.pawnAddress + schemas::client_dll::C_BaseEntity::m_vecAbsVelocity);
@@ -371,7 +391,7 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
371391
mem.Write<int>(client + buttons::attack, PLUS_ATTACK);
372392
std::this_thread::sleep_for(std::chrono::milliseconds(1));
373393
mem.Write<int>(client + buttons::attack, MINUS_ATTACK);
374-
}
394+
}*/
375395

376396
// fov视野角度(相机Service)
377397
auto desiredFov = static_cast<unsigned int>(gui::fov);
@@ -390,30 +410,25 @@ INT APIENTRY WinMain(HINSTANCE instance, HINSTANCE, PSTR, INT cmd_show)
390410
if (gui::enableRcs)
391411
{
392412
const auto shotsFired = mem.Read<int32_t>(localPlayer.pawnAddress + schemas::client_dll::C_CSPlayerPawn::m_iShotsFired);// 开枪次数
393-
auto sensPointer = mem.Read<uintptr_t>(client + offsets::client_dll::dwSensitivity);
394-
auto sensitivity = mem.Read<float>(sensPointer + offsets::client_dll::dwSensitivity_sensitivity);
395-
auto aimPunchCache = mem.Read<C_UTL_VECTOR>(localPlayer.pawnAddress + schemas::client_dll::C_CSPlayerPawn::m_aimPunchCache);
396-
if (aimPunchCache.data && aimPunchCache.count > 0 && aimPunchCache.count < 0xFFFF)
397-
{
398-
localPlayer.aimPunch = mem.Read<Vector3>(aimPunchCache.data + (aimPunchCache.count - 1) * sizeof(Vector3));
399-
}
400-
else
401-
{
402-
continue;
403-
}
413+
// 如果开枪了,就计算后座力补偿
404414
if (shotsFired > 1)
405-
{// 如果开枪了,就计算后座力补偿
415+
{
416+
float m_pitch = 0.022;
417+
float m_yaw = 0.022;
418+
auto aimPunch = mem.Read<Vector3>(localPlayer.pawnAddress + schemas::client_dll::C_CSPlayerPawn::m_aimPunchAngle);
406419
Vector3 viewAngles = mem.Read<Vector3>(client + offsets::client_dll::dwViewAngles);
407-
Vector3 delta = viewAngles - (viewAngles + (oldPunch - (localPlayer.aimPunch * 2.0f)));
420+
auto sensPointer = mem.Read<uintptr_t>(client + offsets::client_dll::dwSensitivity);
421+
auto sensitivity = mem.Read<float>(sensPointer + offsets::client_dll::dwSensitivity_sensitivity);
422+
newAngle.x = (aimPunch.y - oldAngle.y) * 2.f / (m_pitch * sensitivity) / 1;
423+
newAngle.y = -(aimPunch.x - oldAngle.x) * 2.f / (m_yaw * sensitivity) / 1;
424+
425+
mouse_event(MOUSEEVENTF_MOVE, -newAngle.x * -1, newAngle.y, 0, 0);
408426

409-
int mouse_angle_x = (int)(delta.x / (sensitivity*0.022f));
410-
int mouse_angle_y = (int)(delta.y / (sensitivity*0.022f));
411-
mouse_event(MOUSEEVENTF_MOVE, mouse_angle_x, -mouse_angle_y, 0, 0);
412-
oldPunch = localPlayer.aimPunch * 2.0f;
427+
oldAngle = aimPunch;
413428
}
414429
else
415430
{
416-
oldPunch.x = oldPunch.y = oldPunch.z = 0.f;
431+
oldAngle.x = oldAngle.y = oldAngle.z = 0.f;
417432
}
418433
}
419434

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CS2 Cheat - C++
22

3-
> Latest Update:2024.04.28 16:46
3+
> Latest Update:2024.04.29 21:56
44
55
![esp](./esp.png)
66

@@ -10,7 +10,6 @@
1010
- 骨骼透视
1111
- 自瞄锁头
1212
- 枪后座力补偿
13-
- 跳越射击
1413
- 连跳
1514
- 防闪光弹
1615
- 地图扫描敌人雷达

build/CS2CheatCpp.pdb

0 Bytes
Binary file not shown.
-4.48 KB
Binary file not shown.
-1.17 KB
Binary file not shown.

build/intermediates/CS2CheatCpp.log

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,35 @@ E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\render.h(40,60): warning C42
4444
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\render.h(40,57): warning C4244: “参数”: 从“int”转换到“float”,可能丢失数据
4545
(编译源文件“src/main.cpp”)
4646

47-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(204,15): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
48-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(203,8): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
47+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(205,15): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
48+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(204,8): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
49+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(203,21): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
4950
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(202,21): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
50-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(201,21): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
51-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(217,15): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
52-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(216,8): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
51+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(218,15): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
52+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(217,8): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
53+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(216,21): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
5354
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(215,21): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
54-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(214,21): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
55-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(228,19): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
56-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(227,16): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
57-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(235,19): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
58-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(234,16): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
55+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(229,19): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
56+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(228,16): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
57+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(236,19): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
58+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(235,16): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
59+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(245,20): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
5960
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(244,20): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
60-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(243,20): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
61-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(258,7): warning C4244: “参数”: 从“double”转换到“int”,可能丢失数据
62-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(256,55): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
63-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(254,61): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
64-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(253,20): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
65-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(264,74): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
66-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(263,39): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
67-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(308,50): warning C4244: “参数”: 从“int”转换到“float”,可能丢失数据
68-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(308,32): warning C4244: “参数”: 从“int”转换到“float”,可能丢失数据
69-
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(387,25): warning C4244: “=”: 从“float”转换到“int”,可能丢失数据
61+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(259,7): warning C4244: “参数”: 从“double”转换到“int”,可能丢失数据
62+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(257,55): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
63+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(255,61): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
64+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(254,20): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
65+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(265,74): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
66+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(264,39): warning C4244: “参数”: 从“float”转换到“int”,可能丢失数据
67+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(309,50): warning C4244: “参数”: 从“int”转换到“float”,可能丢失数据
68+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(309,32): warning C4244: “参数”: 从“int”转换到“float”,可能丢失数据
69+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(407,25): warning C4244: “=”: 从“float”转换到“int”,可能丢失数据
70+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(416,19): warning C4305: “初始化”: 从“double”到“float”截断
71+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(417,17): warning C4305: “初始化”: 从“double”到“float”截断
72+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(425,61): warning C4244: “参数”: 从“float”转换到“DWORD”,可能丢失数据
73+
E:\VisualStudioProjects\CS2CheatCpp\CS2CheatCpp\src\main.cpp(425,47): warning C4244: “参数”: 从“float”转换到“DWORD”,可能丢失数据
7074
正在生成代码
71-
4 of 2374 functions ( 0.2%) were compiled, the rest were copied from previous compilation.
75+
1 of 2371 functions (<0.1%) were compiled, the rest were copied from previous compilation.
7276
0 functions were new in current compilation
7377
32 functions had inline decision re-evaluated but remain unchanged
7478
已完成代码的生成

build/intermediates/vc143.pdb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)