Compare commits
6 Commits
developmen
...
triggerbot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01beb3b180 | ||
|
|
2e48662644 | ||
|
|
d7a6d9d8ab | ||
|
|
1d5f11538c | ||
|
|
7d9dce645f | ||
|
|
ae10303376 |
557
Cargo.lock
generated
557
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
36
Cargo.toml
36
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "radarflow"
|
name = "radarflow"
|
||||||
version = "0.2.5"
|
version = "0.2.4"
|
||||||
authors = ["Janek S <development@superyu.xyz"]
|
authors = ["Janek S <development@superyu.xyz"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -8,39 +8,39 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# memory
|
# memory
|
||||||
memflow = "0.2.3"
|
memflow = "0.2.1"
|
||||||
memflow-native = { git = "https://github.com/memflow/memflow-native" }
|
memflow-native = { git = "https://github.com/memflow/memflow-native" }
|
||||||
dataview = "1.0.1"
|
dataview = "1.0.1"
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
log = "0.4.22"
|
log = "0.4.21"
|
||||||
simple_logger = "5.0.0"
|
simple_logger = "4.3.3"
|
||||||
|
|
||||||
# error handling
|
# error handling
|
||||||
anyhow = "1.0.93"
|
anyhow = "1.0.81"
|
||||||
|
|
||||||
# derive stuff
|
# derive stuff
|
||||||
enum-primitive-derive = "0.3.0"
|
enum-primitive-derive = "0.3.0"
|
||||||
num-traits = "0.2.19"
|
num-traits = "0.2.18"
|
||||||
serde = { version = "1.0.215", features = ["derive"] }
|
serde = { version = "1.0.197", features = ["derive"] }
|
||||||
serde_json = "1.0.133"
|
serde_json = "1.0.115"
|
||||||
clap = { version = "4.5.21", features = ["derive", "string"] }
|
clap = { version = "4.5.4", features = ["derive", "string"] }
|
||||||
|
|
||||||
# tokio
|
# tokio
|
||||||
tokio = { version = "1.37.0", features = ["full"] }
|
tokio = { version = "1.37.0", features = ["full"] }
|
||||||
|
|
||||||
# networking
|
# networking
|
||||||
axum = { version = "0.7.9", features = ["ws"] }
|
axum = { version = "0.7.5", features = ["ws"] }
|
||||||
tower-http = { version = "0.6.2", features = ["fs"] }
|
tower-http = { version = "0.5.2", features = ["fs"] }
|
||||||
tower = "0.5.1"
|
tower = "0.4.13"
|
||||||
local-ip-address = "0.6.3"
|
local-ip-address = "0.6.1"
|
||||||
|
|
||||||
# other
|
# other
|
||||||
itertools = "0.13.0"
|
itertools = "0.12.1"
|
||||||
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
reqwest = { version = "0.12.9", features = ["blocking"] }
|
reqwest = { version = "0.12.2", features = ["blocking"] }
|
||||||
serde = { version = "1.0.215", features = ["derive"] }
|
serde = { version = "1.0.197", features = ["derive"] }
|
||||||
serde_json = "1.0.133"
|
serde_json = "1.0.115"
|
||||||
vergen-gitcl = { version = "1.0.0", features = ["build", "cargo", "rustc",] }
|
vergen = { version = "8.3.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] }
|
||||||
|
|||||||
20
build.rs
20
build.rs
@@ -1,7 +1,7 @@
|
|||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use vergen_gitcl::{Emitter, GitclBuilder};
|
use vergen::EmitBuilder;
|
||||||
|
|
||||||
#[derive(Clone, Deserialize, Serialize)]
|
#[derive(Clone, Deserialize, Serialize)]
|
||||||
struct InfoJson {
|
struct InfoJson {
|
||||||
@@ -36,27 +36,29 @@ fn build_number() -> Result<(), Box<dyn Error>> {
|
|||||||
fn main() -> Result<(), Box<dyn Error>> {
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
|
||||||
download(
|
download(
|
||||||
"https://raw.githubusercontent.com/a2x/cs2-dumper/refs/heads/main/output/client_dll.rs",
|
"https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/client.dll.rs",
|
||||||
"./src/dma/cs2dumper/client_mod.rs"
|
"./src/dma/cs2dumper/client_mod.rs"
|
||||||
).expect("Failed to download build file \"client.dll.rs\"");
|
).expect("Failed to download build file \"client.dll.rs\"");
|
||||||
|
|
||||||
download(
|
download(
|
||||||
"https://raw.githubusercontent.com/a2x/cs2-dumper/refs/heads/main/output/offsets.rs",
|
"https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.rs",
|
||||||
"./src/dma/cs2dumper/offsets_mod.rs"
|
"./src/dma/cs2dumper/offsets_mod.rs"
|
||||||
).expect("Failed to download build file \"offsets.rs\"");
|
).expect("Failed to download build file \"offsets.rs\"");
|
||||||
|
|
||||||
download(
|
download(
|
||||||
"https://raw.githubusercontent.com/a2x/cs2-dumper/refs/heads/main/output/engine2_dll.rs",
|
"https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/engine2.dll.rs",
|
||||||
"./src/dma/cs2dumper/engine2_mod.rs"
|
"./src/dma/cs2dumper/engine2_mod.rs"
|
||||||
).expect("Failed to download build file \"engine2.dll.rs\"");
|
).expect("Failed to download build file \"engine2.dll.rs\"");
|
||||||
|
|
||||||
build_number()?;
|
build_number()?;
|
||||||
|
|
||||||
let gitcl = GitclBuilder::all_git()?;
|
EmitBuilder::builder()
|
||||||
|
.git_sha(true)
|
||||||
|
.git_commit_date()
|
||||||
Emitter::new()
|
.cargo_debug()
|
||||||
.add_instructions(&gitcl)?
|
.cargo_target_triple()
|
||||||
|
.rustc_semver()
|
||||||
|
.rustc_llvm_version()
|
||||||
.emit()?;
|
.emit()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -45,11 +45,7 @@ fn version() -> String {
|
|||||||
avail.join(", ")
|
avail.join(", ")
|
||||||
};
|
};
|
||||||
|
|
||||||
format!(
|
format!(" {pkg_ver} (rev {git_hash})\nCommit Date: {commit_date}\nAvailable Connectors: {avail_cons}")
|
||||||
"{pkg_ver} (rev {git_hash})\n\
|
|
||||||
Commit Date: {commit_date}\n\
|
|
||||||
Available Connectors: {avail_cons}\n"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn port_in_range(s: &str) -> Result<u16, String> {
|
fn port_in_range(s: &str) -> Result<u16, String> {
|
||||||
|
|||||||
10
src/comms.rs
10
src/comms.rs
@@ -77,13 +77,16 @@ pub struct RadarData {
|
|||||||
#[serde(rename(serialize = "entityData"))]
|
#[serde(rename(serialize = "entityData"))]
|
||||||
player_data: Vec<EntityData>,
|
player_data: Vec<EntityData>,
|
||||||
|
|
||||||
|
#[serde(rename = "triggerbot_shoot")]
|
||||||
|
triggerbot_shoot: bool,
|
||||||
|
|
||||||
//#[serde(rename(serialize = "localYaw"))]
|
//#[serde(rename(serialize = "localYaw"))]
|
||||||
//local_yaw: f32,
|
//local_yaw: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RadarData {
|
impl RadarData {
|
||||||
pub fn new(ingame: bool, map_name: String, player_data: Vec<EntityData>, freq: usize, bomb_planted: bool, bomb_cannot_defuse: bool, bomb_defuse_timeleft: f32, bomb_exploded: bool, bomb_being_defused: bool, bomb_defuse_length: f32, bomb_defuse_end: f32) -> RadarData {
|
pub fn new(ingame: bool, map_name: String, player_data: Vec<EntityData>, freq: usize, bomb_planted: bool, bomb_cannot_defuse: bool, bomb_defuse_timeleft: f32, bomb_exploded: bool, bomb_being_defused: bool, bomb_defuse_length: f32, bomb_defuse_end: f32, triggerbot_shoot: bool,) -> RadarData {
|
||||||
RadarData { ingame, map_name, player_data, freq, bomb_planted, bomb_can_defuse: bomb_cannot_defuse, bomb_defuse_timeleft, bomb_exploded, bomb_being_defused, bomb_defuse_length, bomb_defuse_end }
|
RadarData { ingame, map_name, player_data, freq, bomb_planted, bomb_can_defuse: bomb_cannot_defuse, bomb_defuse_timeleft, bomb_exploded, bomb_being_defused, bomb_defuse_length, bomb_defuse_end, triggerbot_shoot }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns empty RadarData, it's also the same data that gets sent to clients when not ingame
|
/// Returns empty RadarData, it's also the same data that gets sent to clients when not ingame
|
||||||
@@ -99,7 +102,8 @@ impl RadarData {
|
|||||||
bomb_exploded: false,
|
bomb_exploded: false,
|
||||||
bomb_being_defused: false,
|
bomb_being_defused: false,
|
||||||
bomb_defuse_length: 0.0,
|
bomb_defuse_length: 0.0,
|
||||||
bomb_defuse_end: 0.0
|
bomb_defuse_end: 0.0,
|
||||||
|
triggerbot_shoot: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ impl DmaCtx {
|
|||||||
let mut team = 0i32;
|
let mut team = 0i32;
|
||||||
let mut clipping_weapon = 0u64;
|
let mut clipping_weapon = 0u64;
|
||||||
let mut is_scoped = 0u8;
|
let mut is_scoped = 0u8;
|
||||||
|
let mut crosshair_id = 0u8;
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut batcher = MemoryViewBatcher::new(&mut self.process);
|
let mut batcher = MemoryViewBatcher::new(&mut self.process);
|
||||||
@@ -106,6 +107,7 @@ impl DmaCtx {
|
|||||||
batcher.read_into(controller + cs2dumper::client::C_BaseEntity::m_iTeamNum, &mut team);
|
batcher.read_into(controller + cs2dumper::client::C_BaseEntity::m_iTeamNum, &mut team);
|
||||||
batcher.read_into(pawn + cs2dumper::client::C_CSPlayerPawnBase::m_pClippingWeapon, &mut clipping_weapon);
|
batcher.read_into(pawn + cs2dumper::client::C_CSPlayerPawnBase::m_pClippingWeapon, &mut clipping_weapon);
|
||||||
batcher.read_into(pawn + cs2dumper::client::C_CSPlayerPawn::m_bIsScoped, &mut is_scoped);
|
batcher.read_into(pawn + cs2dumper::client::C_CSPlayerPawn::m_bIsScoped, &mut is_scoped);
|
||||||
|
batcher.read_into(pawn + cs2dumper::client::C_CSPlayerPawnBase::m_iIDEntIndex, &mut crosshair_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
let team = TeamID::from_i32(team);
|
let team = TeamID::from_i32(team);
|
||||||
@@ -126,7 +128,8 @@ impl DmaCtx {
|
|||||||
team,
|
team,
|
||||||
health,
|
health,
|
||||||
has_awp,
|
has_awp,
|
||||||
is_scoped: is_scoped != 0
|
is_scoped: is_scoped != 0,
|
||||||
|
crosshair_id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,4 +255,5 @@ pub struct BatchedPlayerData {
|
|||||||
pub health: u32,
|
pub health: u32,
|
||||||
pub has_awp: bool,
|
pub has_awp: bool,
|
||||||
pub is_scoped: bool,
|
pub is_scoped: bool,
|
||||||
|
pub crosshair_id: u8,
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,8 @@ pub async fn run(radar_data: ArcRwlockRadarData, connector: Connector, pcileech_
|
|||||||
data.bomb_exploded,
|
data.bomb_exploded,
|
||||||
data.bomb_being_defused,
|
data.bomb_being_defused,
|
||||||
data.bomb_defuse_length,
|
data.bomb_defuse_length,
|
||||||
bomb_defuse_end
|
bomb_defuse_end,
|
||||||
|
local_data.crosshair_id != 0 && local_data.crosshair_id != 255
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
let mut radar = radar_data.write().await;
|
let mut radar = radar_data.write().await;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub struct CsData {
|
|||||||
// Common
|
// Common
|
||||||
pub local: u64,
|
pub local: u64,
|
||||||
pub local_pawn: u64,
|
pub local_pawn: u64,
|
||||||
// pub is_dead: bool, // TODO: Why is this here?
|
pub is_dead: bool,
|
||||||
pub tick_count: i32,
|
pub tick_count: i32,
|
||||||
pub freeze_period: bool,
|
pub freeze_period: bool,
|
||||||
pub round_start_count: u8,
|
pub round_start_count: u8,
|
||||||
@@ -178,7 +178,7 @@ impl CsData {
|
|||||||
let round_start_count_addr = (self.gamerules + cs2dumper::client::C_CSGameRules::m_nRoundStartCount as u64).into();
|
let round_start_count_addr = (self.gamerules + cs2dumper::client::C_CSGameRules::m_nRoundStartCount as u64).into();
|
||||||
|
|
||||||
// Game Entity System
|
// Game Entity System
|
||||||
let highest_index_addr = (self.game_ent_sys + cs2dumper::offsets::client_dll::dwGameEntitySystem_highestEntityIndex as u64).into();
|
let highest_index_addr = (self.game_ent_sys + cs2dumper::offsets::client_dll::dwGameEntitySystem_getHighestEntityIndex as u64).into();
|
||||||
|
|
||||||
let mut batcher = ctx.process.batcher();
|
let mut batcher = ctx.process.batcher();
|
||||||
batcher.read_into(
|
batcher.read_into(
|
||||||
@@ -237,7 +237,7 @@ impl CsData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let map_string = ctx.process.read_utf8_lossy(map_ptr.into(), 32).unwrap_or(String::from("<empty>"));
|
let map_string = ctx.process.read_char_string_n(map_ptr.into(), 32).unwrap_or(String::from("<empty>"));
|
||||||
|
|
||||||
self.map = map_string;
|
self.map = map_string;
|
||||||
self.bomb_dropped = bomb_dropped != 0;
|
self.bomb_dropped = bomb_dropped != 0;
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
"pos_y": 2887.0,
|
"pos_y": 2887.0,
|
||||||
"scale": 7.0,
|
"scale": 7.0,
|
||||||
"rotate": 0,
|
"rotate": 0,
|
||||||
"zoom": 0.0
|
"zoom": 0.0,
|
||||||
|
"altitude_split": -495
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"pos_y": 1762.0,
|
"pos_y": 1762.0,
|
||||||
"scale": 4.0,
|
"scale": 4.0,
|
||||||
"rotate": 0,
|
"rotate": 0,
|
||||||
"zoom": 0.0
|
"zoom": 0.0,
|
||||||
|
"altitude_split": 11700
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
// Colors
|
// Colors
|
||||||
const localColor = "#109856"
|
const localColor = "#109856"
|
||||||
|
const localLowerColor = "#064024"
|
||||||
const teamColor = "#68a3e5"
|
const teamColor = "#68a3e5"
|
||||||
|
const teamLowerColor = "#2c4969"
|
||||||
const enemyColor = "#ec040b"
|
const enemyColor = "#ec040b"
|
||||||
|
const enemyLowerColor = "#4f0002"
|
||||||
const bombColor = "#eda338"
|
const bombColor = "#eda338"
|
||||||
const textColor = "#d1d1d1"
|
const textColor = "#d1d1d1"
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@ if (location.protocol == 'https:') {
|
|||||||
} else {
|
} else {
|
||||||
websocketAddr = `ws://${window.location.host}/ws`
|
websocketAddr = `ws://${window.location.host}/ws`
|
||||||
}
|
}
|
||||||
//websocketAddr = "ws://192.168.0.235:8000/ws"
|
websocketAddr = "ws://192.168.0.235:8000/ws"
|
||||||
|
|
||||||
// Util functions
|
// Util functions
|
||||||
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||||
@@ -154,16 +157,30 @@ function render() {
|
|||||||
if (data.Bomb !== undefined) {
|
if (data.Bomb !== undefined) {
|
||||||
drawBomb(data.Bomb.pos, data.Bomb.isPlanted)
|
drawBomb(data.Bomb.pos, data.Bomb.isPlanted)
|
||||||
} else {
|
} else {
|
||||||
let fillStyle = localColor
|
let fillStyle = localLowerColor
|
||||||
|
|
||||||
switch (data.Player.playerType) {
|
if (map && map.altitude_split && data.Player.pos.z < map.altitude_split) {
|
||||||
case "Team":
|
|
||||||
fillStyle = teamColor
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Enemy":
|
switch (data.Player.playerType) {
|
||||||
fillStyle = enemyColor
|
case "Team":
|
||||||
break;
|
fillStyle = teamLowerColor
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Enemy":
|
||||||
|
fillStyle = enemyLowerColor
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fillStyle = localColor
|
||||||
|
switch (data.Player.playerType) {
|
||||||
|
case "Team":
|
||||||
|
fillStyle = teamColor
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Enemy":
|
||||||
|
fillStyle = enemyColor
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drawEntity(
|
drawEntity(
|
||||||
|
|||||||
Reference in New Issue
Block a user