diff --git a/config.json b/config.json index 7ea05d5..77f1fc6 100644 --- a/config.json +++ b/config.json @@ -79,7 +79,7 @@ { "name": "dwForceCrouch", "module": "client.dll", - "pattern": "48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 4C 6B E3", + "pattern": "48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 83 C4 ? E9 ? ? ? ? CC CC CC CC CC CC CC CC CC CC 48 83 EC ? 66 C7 44 24", "operations": [ { "type": "rip" @@ -93,7 +93,7 @@ { "name": "dwForceForward", "module": "client.dll", - "pattern": "48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 48 8D 05 ? ? ? ? 48 89 45 ? 4C 6B E3", + "pattern": "48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 83 C4 ? E9 ? ? ? ? CC CC CC CC CC CC CC CC CC CC 48 81 EC", "operations": [ { "type": "rip" @@ -149,7 +149,7 @@ { "name": "dwGameEntitySystem", "module": "client.dll", - "pattern": "48 8B 1D ? ? ? ? 48 89 1D", + "pattern": "48 89 0D ? ? ? ? E9 ? ? ? ? CC", "operations": [ { "type": "rip" @@ -181,7 +181,7 @@ { "name": "dwGameTypes", "module": "matchmaking.dll", - "pattern": "48 8D 0D ? ? ? ? E9 ? ? ? ? CC CC CC CC 48 8D 0D ? ? ? ? E9 ? ? ? ? CC CC CC CC 48 83 EC ? F0 81 0D", + "pattern": "48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 33 D2", "operations": [ { "type": "rip" @@ -191,7 +191,7 @@ { "name": "dwGameTypes_mapName", "module": "matchmaking.dll", - "pattern": "48 8D 0D ? ? ? ? E9 ? ? ? ? CC CC CC CC 48 8D 0D ? ? ? ? E9 ? ? ? ? CC CC CC CC 48 83 EC ? F0 81 0D", + "pattern": "48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 33 D2", "operations": [ { "type": "rip" @@ -205,7 +205,7 @@ { "name": "dwGlobalVars", "module": "client.dll", - "pattern": "48 89 0D ? ? ? ? 48 89 41", + "pattern": "48 89 15 ? ? ? ? 48 8D 05 ? ? ? ? 48 85 D2", "operations": [ { "type": "rip" @@ -245,7 +245,7 @@ { "name": "dwLocalPlayerController", "module": "client.dll", - "pattern": "48 8B 05 ? ? ? ? 48 85 C0 74 4F", + "pattern": "48 8B 05 ? ? ? ? 48 85 C0 74 ? 8B 88", "operations": [ { "type": "rip" @@ -339,7 +339,7 @@ { "name": "dwSensitivity", "module": "client.dll", - "pattern": "48 8B 05 ? ? ? ? 48 8B 40 ? F3 0F 10 00 F3 0F 59 86", + "pattern": "48 8B 05 ? ? ? ? 48 8B 40 ? F3 41 0F 59 F4", "operations": [ { "type": "rip" diff --git a/src/builder/cpp_file_builder.rs b/src/builder/cpp_file_builder.rs index f59c7ba..38ad065 100644 --- a/src/builder/cpp_file_builder.rs +++ b/src/builder/cpp_file_builder.rs @@ -11,7 +11,10 @@ impl FileBuilder for CppFileBuilder { } fn write_top_level(&mut self, output: &mut dyn Write) -> Result<()> { - write!(output, "#pragma once\n\n#include \n\n") + writeln!(output, "#pragma once\n")?; + writeln!(output, "#include \n")?; + + Ok(()) } fn write_namespace( diff --git a/src/config.rs b/src/config.rs index f8a56c4..78d12e7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -27,6 +27,11 @@ pub enum Operation { }, } +#[derive(Debug, Deserialize, Serialize)] +pub struct Config { + pub signatures: Vec, +} + #[derive(Debug, Deserialize, Serialize)] pub struct Signature { pub name: String, @@ -34,8 +39,3 @@ pub struct Signature { pub pattern: String, pub operations: Vec, } - -#[derive(Debug, Deserialize, Serialize)] -pub struct Config { - pub signatures: Vec, -} diff --git a/src/main.rs b/src/main.rs index 27d59d1..a3c63f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -119,8 +119,8 @@ fn main() -> Result<()> { Ok(()) } -fn map_file_extension_to_builder(ext: &str) -> Result { - match ext { +fn map_file_extension_to_builder(extension: &str) -> Result { + match extension { ".cs" => Ok(FileBuilderEnum::CSharpFileBuilder(CSharpFileBuilder)), ".hpp" => Ok(FileBuilderEnum::CppFileBuilder(CppFileBuilder)), ".json" => Ok(FileBuilderEnum::JsonFileBuilder(JsonFileBuilder::default())),