Add first offsets config for linux

This commit is contained in:
Albert24GG 2024-03-06 10:35:48 +02:00
parent 6a1600d432
commit 7e573bdcb6
4 changed files with 142 additions and 4 deletions

132
config_linux.json Normal file
View File

@ -0,0 +1,132 @@
{
"signatures": [
{
"name": "dwBuildNumber",
"module": "libengine2.so",
"pattern": "89 15 ? ? ? ? 48 83 ? ? 48 8D 3D ? ? ? ?",
"operations": [
{
"type": "rip",
"offset": 2,
"length": 6
}
]
},
{
"name": "dwNetworkGameClient_deltaTick",
"module": "libengine2.so",
"pattern": "89 83 ? ? ? ? B8 01",
"operations": [
{
"type": "slice",
"start": 2,
"end": 4
}
]
},
{
"name": "dwEntityList",
"module": "libclient.so",
"pattern": "48 8B 3D ? ? ? ? 44 89 E3 45 89 E6 C1 ? 0E",
"operations": [
{
"type": "rip"
}
]
},
{
"name": "dwForceAttack",
"module": "libclient.so",
"pattern": "4c 8d ? ? ? ? ? 4d 89 ? 48 89 ? ? ? ? ? eb",
"operations": [
{
"type": "rip"
},
{
"type": "add",
"value": 48
}
]
},
{
"name": "dwForceAttack2",
"module": "libclient.so",
"pattern": "4c 8d ? ? ? ? ? 48 8d ? ? ? ? ? 48 89 ? ? ? ? ? e8 ? ? ? ? 49 ? ? ? 31 d2 48 c7 ? ? ? ? ? ? 08",
"operations": [
{
"type": "rip"
},
{
"type": "add",
"value": 48
}
]
},
{
"name": "dwGameEntitySystem",
"module": "libclient.so",
"pattern": "48 89 3d ? ? ? ? e9 ? ? ? ? 55",
"operations": [
{
"type": "rip"
}
]
},
{
"name": "dwGameEntitySystem_getHighestEntityIndex",
"module": "libclient.so",
"pattern": "8b 87 ? ? ? ? c3 66 ? ? ? ? ? ? ? ? 8b 97",
"operations": [
{
"type": "slice",
"start": 2,
"end": 4
}
]
},
{
"name": "dwGameRules",
"module": "libclient.so",
"pattern": "48 89 3d ? ? ? ? 8b",
"operations": [
{
"type": "rip"
}
]
},
{
"name": "dwLocalPlayerController",
"module": "libclient.so",
"pattern": "48 8B 15 ? ? ? ? 31 C0 48 85 D2 74 5C",
"operations": [
{
"type": "rip"
}
]
},
{
"name": "dwLocalPlayerPawn",
"module": "libclient.so",
"pattern": "48 8D 05 ? ? ? ? C3 ? ? ? 00 00 00 00 00 C7 47 40",
"operations": [
{
"type": "rip"
},
{
"type": "add",
"value": 56
}
]
},
{
"name": "dwViewMatrix",
"module": "libclient.so",
"pattern": "4c 8d 05 ? ? ? ? 48 ? ? 48 8d ? ? ? ? ? e8 ? ? ? ? 8b",
"operations": [
{
"type": "rip"
}
]
}
]
}

View File

@ -72,3 +72,9 @@ pub const PROC_NAME: &str = "cs2.exe";
#[cfg(target_os = "linux")]
pub const PROC_NAME: &str = "cs2";
#[cfg(target_os = "windows")]
pub const OFFSETS_CONF: &str = "config.json";
#[cfg(target_os = "linux")]
pub const OFFSETS_CONF: &str = "config_linux.json";

View File

@ -7,8 +7,8 @@ use simplelog::{debug, error, info};
use super::{generate_files, Entries, Entry};
use crate::builder::FileBuilderEnum;
use crate::config::Config;
use crate::config::Operation::*;
use crate::config::{self, Config};
use crate::os::Process;
pub fn dump_offsets(
@ -17,7 +17,7 @@ pub fn dump_offsets(
file_path: &str,
indent: usize,
) -> Result<()> {
let file = File::open("config.json")?;
let file = File::open(config::OFFSETS_CONF)?;
let config: Config = serde_json::from_reader(file)?;

View File

@ -86,8 +86,8 @@ fn main() -> Result<()> {
TermLogger::init(log_level, config, TerminalMode::Mixed, ColorChoice::Auto)?;
if !Path::new("config.json").exists() {
bail!("Missing config.json file");
if !Path::new(config::OFFSETS_CONF).exists() {
bail!("Missing {} file", config::OFFSETS_CONF);
}
// Create the output directory if it doesn't exist.