BTF-Kabir-2020/CS-1.6-Tool-v2

GitHub: BTF-Kabir-2020/CS-1.6-Tool-v2

一个用 Rust 编写的 CS 1.6 外部内存读写教育工具,通过多策略指针链解析并修改游戏运行时数据。

Stars: 0 | Forks: 0

# CS 1.6 Tool v2 (Rust) — v2.0.2 [![CI](https://static.pigsec.cn/wp-content/uploads/repos/cas/ad/ad5834178f7599af9fdda11629d49cae07f2997beec49821b2920eff5bfd50e7.svg)](https://github.com/BTF-Kabir-2020/CS-1.6-Tool-v2/actions/workflows/ci.yml) [![Release](https://img.shields.io/github/v/release/BTF-Kabir-2020/CS-1.6-Tool-v2?label=release)](https://github.com/BTF-Kabir-2020/CS-1.6-Tool-v2/releases/latest) [![License](https://img.shields.io/github/license/BTF-Kabir-2020/CS-1.6-Tool-v2)](LICENSE) [![Rust](https://img.shields.io/badge/rust-1.82%2B-orange?logo=rust)](https://www.rust-lang.org/) **EN:** 对 `cs16-rust` 的完全重写 —— 架构更清晰,支持多策略内存读取。 **FA:** بازنویسی کامل پروژه `cs16-rust` — با معماری تمیزتر و روش‌های متعدد خواندن حافظه. 📺 **YouTube (Tekoya):** https://www.youtube.com/@Tekoya-learn ## 下载 / دانلود 预编译的 Windows 二进制文件(无需 Rust): **[最新发布 — `cs16-tool.exe`](https://github.com/BTF-Kabir-2020/CS-1.6-Tool-v2/releases/latest)** ## 快速开始 / شروع سریع ``` # 以管理员身份运行 PowerShell / 以 Run as Administrator 身份打开 PowerShell cd cs16-tool-v2 cargo run --release ``` 1. 打开 CS 1.6 / CS 1.6 را باز کن 2. **进入一场比赛**(New Game / 服务器) / **وارد match شو** (New Game / سرور) 3. Overlay 和控制台应显示金钱/弹药 / overlay و کنسول باید پول/ammo را نشان دهند ## 功能 / ویژگی‌ها | 部分 | 状态 | 描述 | |---------|--------|-------------| | 连接到 `hl.exe` 的外部进程 | ✅ | OpenProcess + Toolhelp32 | | 读写内存 | ✅ | ReadProcessMemory / WriteProcessMemory | | 金钱 (hw + client + entity) | ✅ | 3 种 fallback 策略 | | 弹匣 / 备弹 | ✅ | 多条指针链 + pick_best | | HP / 护甲 | ⚙️ | 在 config 中手动指定 offset | | 游戏 Overlay | ✅ | Win32 GDI 透明窗口 | | 位置 (XYZ) | ⚙️ | 6 种查找策略 | | 自动重连 | ✅ | 掉线 / 换地图 | | sw.dll fallback | ✅ | 软件渲染器 | ## Offsets / 偏移量 **原始来源:** `1_cs16` / `2_cs16` — 你已测试过的指针链。 | 字段 | RVA / 指针链 | |-------|-------------| | 备弹 | `hw+0x7AF55C` → `74,5C0,A4,5E8` | | 金钱 hw | `hw+0x6E92AC` → `1CC,320,4,7C,21C` | | 金钱 client | `client+0x1213C4` | | 弹匣 ×3 | 与 C++ 中的 `CLIP_CHAINS` 相同 | `config.toml` 中的目标值:**金钱 15000** — 弹匣/备弹取决于你的构建版本(见文件)。 ## 金钱读取优先级 / اولویت خواندن پول 1. `hw.dll + RVA` → 本地玩家 → `+0xE4` (金钱) 2. `[chains.money_hw]` 中的指针链 3. `client.dll + direct_rva` fallback 4. 本地玩家的 `entity + money_offset` ## 项目结构 / ساختار پروژه ``` src/ ├── main.rs # Entry point — 3 threads ├── lib.rs # Library crate root ├── config.rs # AppConfig + parse helpers ├── error.rs # AppError + MemoryError ├── bin/ │ └── dump.rs # cs16-dump — validate offsets/chains ├── win/ │ ├── process.rs # ProcessHandle, find_pid │ ├── memory.rs # MemoryReader/Writer, resolve_chain │ └── window.rs # find_game_window, get_game_rect ├── game/ │ ├── engine.rs # GameEngine — main logic │ ├── state.rs # GameState, format_status │ ├── local_player.rs # Local Player discovery │ └── position.rs # Position (vec3) discovery ├── overlay/ │ └── overlay.rs # Win32 GDI overlay └── debug/ └── mod.rs # DebugConsole ``` **线程模型 / مدل thread:** - **内存线程** — 每隔 N 毫秒:读/写 + GameState - **Overlay 线程** — 约 60 FPS,在游戏窗口上使用 GDI - **主线程** — 按键 + 控制台状态 ## 快捷键 / کلیدها | 按键 | 动作 | |-----|--------| | Q / End | 退出 | | Insert | 切换 Overlay | | F7 | 切换调试控制台 | ## CLI ``` # 普通模式 / Normal mode cargo run --release # 只读(无写入) / Read only (no writing) cargo run --release -- --read-only # 无 overlay / No overlay cargo run --release -- --no-overlay # 完全 debug / Full debug cargo run --release -- --debug # 自定义 config / Custom config cargo run --release -- -c config.local.toml # 验证 offsets/chains(dump CLI) cargo run --release --bin cs16-dump cargo run --release --bin cs16-dump -- -c config.local.toml ``` ## config.toml 请查看仓库根目录下的 **`config.toml`** 以获取完整的指针链、entity RVA 和 overlay 设置。 ``` [process] name = "hl.exe" [modules] hw = "hw.dll" sw = "sw.dll" client = "client.dll" [targets] money = 15000 clip = 1030 # example — tune for your build reserve = 1090 [features] write_enabled = true overlay_enabled = true money_enabled = true clip_enabled = true reserve_enabled = true hp_enabled = true armor_enabled = true position_enabled = true # clip_write_enabled / reserve_write_enabled — 参见 config.toml [timing] memory_loop_ms = 50 overlay_loop_ms = 16 ``` 请参阅 **`config.toml`** 中的 `[chains]`、`[entity]` 和 `[overlay.*]` —— 此处不再赘述。 ## 依赖项 / وابستگی‌ها | Crate | 版本 | 用途 | |-------|---------|---------| | `windows` | 0.58 | Win32 API | | `clap` | 4 | CLI | | `parking_lot` | 0.12 | RwLock | | `crossbeam-channel` | 0.5 | Channel | | `tracing` | 0.1 | 日志记录 | | `serde` + `toml` | 1.1 | 配置 | | `thiserror` + `anyhow` | 1.x | 错误处理 | ## 构建 / ساخت ``` # Release(推荐) / Release (recommended) cargo build --release # Debug cargo build # 测试 / Tests cargo test ``` ## 网络资源 / منابع اینترنتی - [UnknownCheats — CS1.6 Finding Offsets](https://www.unknowncheats.me/forum/counterstrike-1-5-1-6-and-mods/125661-cs1-6-finding-offsets.html) - [BLASTHACK CS 1.6 Dumper](https://www.blast.hk/threads/225183/) - [ReadProcessMemory WinAPI](https://codingvision.net/c-read-write-another-process-memory) - [ReClass.NET](https://github.com/ReClassNET/ReClass.NET) - [x64dbg / x32dbg](https://x64dbg.com/) ## 相关文档 / مستندات مرتبط | 文件 | 内容 | |------|---------| | `ARCHITECTURE.md` | 完整架构 + 流程 / معماری کامل + flow | | `RUST_SYNTAX.md` | Rust 语法指南 (`&`, `mut`, `clone`, `*`, `_` 等) / راهنمای نحو Rust | | `SECURITY.md` | 安全与负责任地使用 / امنیت و استفاده مسئولانه | | `LICENSE` | 非商业许可证 / لایسنس غیرتجاری | ## 免责声明 / سلب مسئولیت ## 许可证 **版权所有 © 2026 BTF Kabir** — 仅限非商业和教育用途。请参阅 [LICENSE](LICENSE)。
标签:CS 1.6, Rust, Windows API, 内存读写, 可视化界面, 游戏外挂工具, 游戏辅助, 网络流量审计, 通知系统