Skip to content

⚗️ an elegant toolkit for game hacking in pure rust.

License

Notifications You must be signed in to change notification settings

cristeigabriel/toy-arms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚗️ toy-arms

Windows game hack helper utilities in rust. This crate has some useful macros, functions and traits.

Crates.io Docs.rs

Usage | Examples | Document

What's toy-arms?

This is a toolkit for those who are fed up with coding game hack with C++ but still wanna make it in elegant way. Since this wraps many functions which frequently used, you can build hack without having to struggle with Windows-API. By using this, many part of your stress while coding low level fashion won't come in.

Get started

Include toy-arms in your dependencies table in Cargo.toml.

[dependencies]
toy-arms = "0.9.2"

🔥 minimal examples

internal

With this crate, making dll is simple as this:

// A neat macro which defines entry point instead of you.
// Also, you dont have to alloc/free console by yourself, console will show up only when debug compile.
toy_arms::create_entrypoint!(hack_main_thread);

// Main thread
fn hack_main_thread() {
    // YOUR STUNNING CODE'S SUPPOSED TO BE HERE;
    for i in 0..30000 {
        println!("using toy-arms {}", i);
    }
}

external

# You must enable external feature flag
toy-arms = {version = "0.8.0", features = ["external"]}

On the other hand, following code is how tamper with memory externally is like.

Since this one shows some example usage of the crate's features, it looks a bit fancier.

use toy_arms::{MemoryEx, VirtualKeyCode};

fn main() {
    // This offset has to be up to date.
    const DW_FORCE_ATTACK: usize = 0x31EDB20;
    // Getting process information
    let memex = MemoryEx::from_process_name("csgo.exe");
    println!("process id = {}, \nprocess handle = {:?}", memex.process_id, memex.process_handle);

    // You can get module information by using get_module_info
    let module_info = memex.get_module_info("client.dll").unwrap();
    println!("{}", module_info.module_name);

    // read fetches the value at where the address is pointing.
    // U have to specify the type of the value with turbofish
    println!("{:?}", memex.read::<u32>(memex.get_module_base("client.dll").unwrap() + DW_FORCE_ATTACK as usize).unwrap());

    loop {

        // write helps you tamper with the value.
        memex.write::<u32>(memex.get_module_base("client.dll").unwrap() + DW_FORCE_ATTACK as usize, &mut 0x5).unwrap();

        // Exit this loop by pressing INSERT
        if toy_arms::detect_keydown(VirtualKeyCode::VK_INSERT) {
            break;
        }
    }
}

🗃️ Other examples?

Yes we have! Take a look at examples directory, you'll see more examples!

However, you may need to update offsets which some examples contain with your own hands.

Refer to hazedumper as always for latest offsets of CSGO.

To build examples to x86 arch:

cargo build --example EXAMPLE_NAME --target i686-pc-windows-msvc

About

⚗️ an elegant toolkit for game hacking in pure rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%