Skip to content

Commit

Permalink
优化自瞄
Browse files Browse the repository at this point in the history
  • Loading branch information
yinleiCoder committed Feb 28, 2024
1 parent 189a3a0 commit 9446c0b
Show file tree
Hide file tree
Showing 26 changed files with 259 additions and 134 deletions.
26 changes: 21 additions & 5 deletions CS2CheatCpp/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pos=60,60
Size=121,98

[Window][Dear ImGui Demo]
Pos=718,30
Pos=716,29
Size=493,792

[Window][Hello, world!]
Expand Down Expand Up @@ -45,15 +45,15 @@ Size=353,858

[Window][Dear ImGui Demo/ResizableChild_D5443E47]
IsChild=1
Size=446,136
Size=442,136

[Window][Dear ImGui Demo/Red_1D4E05CE]
IsChild=1
Size=200,100

[Window][Delete?]
Pos=614,380
Size=307,103
Pos=636,372
Size=264,120

[Window][Stacked 1]
Pos=565,347
Expand Down Expand Up @@ -100,9 +100,17 @@ Pos=652,179
Size=600,500

[Window][CS2外挂]
Pos=51,138
Pos=1021,92
Size=600,500

[Window][Example: Simple layout]
Pos=60,60
Size=500,440

[Window][Example: Simple layout/left pane_AED60EF8]
IsChild=1
Size=150,380

[Table][0xD181190E,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Expand Down Expand Up @@ -179,3 +187,11 @@ Column 3 Width=68
Column 4 Weight=1.0000
Column 5 Width=-1

[Table][0x8DFA6E86,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000

[Table][0xFABAAEF7,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000

3 changes: 3 additions & 0 deletions CS2CheatCpp/src/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ class Entity
std::string name;
uintptr_t pawnAddress;
uintptr_t controllerAddress;
uintptr_t cameraServices;
int health;
int team;
float flashDuration;
unsigned int fFlag;
unsigned int lifeState;
int entIndex;
bool spotted;
Vector3 head;
Vector3 origin;
Vector3 viewOffset;
Vector3 aimPunch;
Vector3 velocity;
float distance;
};
51 changes: 37 additions & 14 deletions CS2CheatCpp/src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,14 @@ void gui::Render() noexcept
if (no_background) window_flags |= ImGuiWindowFlags_NoBackground;
if (no_bring_to_front) window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus;
if (unsaved_document) window_flags |= ImGuiWindowFlags_UnsavedDocument;
//bool show_demo_window = true;

// 更新当前玩家最大速度
if (speed > maxSpeed) {
maxSpeed = speed;
}

if (menutoggle) {
//static bool show_demo_window = true;
//ImGui::ShowDemoWindow(&show_demo_window);
ImGui::SetNextWindowSize({ 600.f,500.f }, ImGuiCond_FirstUseEver);
ImGui::Begin(_S("CS2外挂"), 0, window_flags);
Expand All @@ -262,10 +267,10 @@ void gui::Render() noexcept
ImGui::EndMenuBar();
}

ImGui::Text(_S("提示: ImGui (%s) (%d)"), IMGUI_VERSION, IMGUI_VERSION_NUM);
ImGui::Text(_S("运行环境: ImGui (%s) (%d)"), IMGUI_VERSION, IMGUI_VERSION_NUM);
ImGui::Spacing();

if (ImGui::CollapsingHeader(_S("帮助")))
if (ImGui::CollapsingHeader(_S("使用前必看")))
{
ImGui::SeparatorText(_S("使用说明"));
ImGui::TextWrapped(_S("显示和隐藏本菜单请按键盘上的"));
Expand All @@ -277,17 +282,10 @@ void gui::Render() noexcept

ImGui::SeparatorText(_S("软件下载地址"));
ImGui::TextWrapped("https://github.com/yinleiCoder/cs2-cheat-cpp/releases");

ImGui::SeparatorText(_S("免责声明"));
ImGui::TextWrapped(_S("此项目仅供C++、逆向工程爱好者代码参考和学习交流,请勿运行本程序在真实的匹配对局破坏游戏公平,且不要将此软件运用于商业目的进行盈利,与作者无关,后果请自行承担!!!"));
}
ImGui::Checkbox(_S("方框透视"), &boxEsp);
ImGui::Checkbox(_S("人物发光"), &playerBodyGlow);
ImGui::Checkbox(_S("玩家剩余血量"), &playerHealth);
ImGui::Checkbox(_S("自瞄锁头射击"), &aimbot);
ImGui::SetItemTooltip(_S("请按键盘上的E键"));
ImGui::Checkbox(_S("RCS后座力补偿"), &rcs);
ImGui::Checkbox(_S("雷达"), &radar);
ImGui::Checkbox(_S("抗闪光"), &flash);
ImGui::Checkbox(_S("连跳"), &bhop);
ImGui::SetItemTooltip(_S("请连续按住键盘上的空格键"));

if (ImGui::CollapsingHeader(_S("窗口选项")))
{
Expand All @@ -306,7 +304,32 @@ void gui::Render() noexcept
ImGui::EndTable();
}
}


ImGui::Text(_S("玩家当前移动速度: %d"), speed);
ImGui::Text(_S("玩家最大移动速度: %d"), maxSpeed);
ImGui::Checkbox(_S("方框透视"), &boxEsp);
ImGui::Checkbox(_S("人物发光"), &playerBodyGlow);
ImGui::Checkbox(_S("玩家剩余血量"), &playerHealth);
ImGui::SetItemTooltip(_S("血量会在敌人旁边实时绘制成绿色矩形"));
ImGui::Checkbox(_S("自瞄锁头"), &aimbot);
ImGui::SetItemTooltip(_S("此选项需要玩家自己开枪,或者配合打开自动开枪选项,本选项配合雷达选项可实现敌人与墙体的遮挡可见性检测"));
ImGui::Checkbox(_S("雷达"), &radar);
ImGui::SetItemTooltip(_S("此选项会在地图上一直显示敌人的雷达,但会屏蔽敌人可见性检测自瞄锁头"));
ImGui::Checkbox(_S("自动开枪"), &autoAttack);
ImGui::SetItemTooltip(_S("此选项配合需要同时打开自瞄锁头和本选项"));
ImGui::Checkbox(_S("RCS后座力补偿"), &rcs);
ImGui::Checkbox(_S("抗闪光"), &flash);
ImGui::Checkbox(_S("连跳"), &bhop);
ImGui::SetItemTooltip(_S("连续按住键盘上的空格键"));
ImGui::SliderInt(_S("视野角度"), &fov, 0, 180);
if (bombPlanted) {
ImGui::Text(_S("土匪已将炸弹安放,距离爆炸还剩 %d 秒"), bombTimeLeft);
}
else
{
ImGui::Text(_S("土匪目前还没安装炸弹,快去剿灭他们!"));
}

ImGui::End();
SetWindowLong(overlay, GWL_EXSTYLE, WS_EX_TOPMOST | WS_EX_LAYERED);
}
Expand Down
8 changes: 7 additions & 1 deletion CS2CheatCpp/src/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ namespace gui
inline bool boxEsp = true;// 方框透视
inline bool playerBodyGlow = true;// 玩家身体发光
inline bool playerHealth = true;// 玩家血量
inline bool aimbot = false;// 自瞄并锁头
inline bool aimbot = false;// 自瞄锁头
inline bool autoAttack = false;// 自瞄锁头并开枪
inline bool rcs = false; // 后座力补偿
inline bool radar = false;// 雷达
inline bool flash = true; // 防闪光
inline bool bhop = false;// 连跳
inline int fov = 0;// 视野角度
inline int speed = 0;// 当前速度
inline int maxSpeed = 0;// 最大速度
inline bool bombPlanted = false; // 炸弹是否已安放
inline int bombTimeLeft = -1; // 炸弹爆炸倒计时

// win32api window相关变量
inline HWND overlay = nullptr;
Expand Down
Loading

0 comments on commit 9446c0b

Please sign in to comment.