Code Monkey home page Code Monkey logo

easyrw's Introduction

EasyRW

Easy reading and writing memory on rust.

Installation

Run the following command in your project directory:

cargo add easyrw

OR

add the following line to your Cargo.toml:

easyrw = "0.2.2"

Assault Cube R/W Example:

use easyrw::memory::init;

fn main() {
    let proc = init("ac_client.exe", false).expect("Failed to attach to process"); //attach to process with false argument, means it will write memory externally, not internally, if ur making a dll then put it to true r/w internally
    let assault_cube = proc.get_assault_cube(proc.getbase("ac_client.exe")); // get assaultcube offsets, there is only 3 of them in this library just for example

    println!("HP: {}", proc.read::<i32>(assault_cube.hp)); // print hp
    println!("Nades: {}", proc.read::<i32>(assault_cube.nades)); // print grenades
    println!("Armor: {}", proc.read::<i32>(assault_cube.armor)); // print armor
}

Overall R/W Example:

use easyrw::memory::init;

fn main()  {
    let proc = init("ac_client.exe", false).expect("Failed to attach to process"); //attach to process with false argument, means it will write memory externally, not internally, if ur making a dll then put it to true r/w internally
    let base = proc.getbase("ac_client.exe"); // get module base
    proc.write(proc.get_ptr(base + 0x17E0A8, &[0xEC]), 104); // assault cube example: write 104 to hp address
}

a BAD Read Range Example:

use easyrw::memory::init;

fn main()  {
    let proc = init("ac_client.exe", false).expect("Failed to attach to process"); //attach to process with false argument, means it will write memory externally, not internally, if ur making a dll then put it to true r/w internally
    let base = proc.getbase("ac_client.exe"); // get module base
    if let Some(data) = proc.read_range::<i32>(
        proc.get_ptr(base + 0x17E0A8, &[0x108]),
        proc.get_ptr(base + 0x17E0A8, &[0x140]),
    ) {
        println!("data: {:?}", data);
    } else {
        println!("failed to read memory range");
    }
}

a BAD Write Range Example:

use easyrw::memory::init;

fn main()  {
    let proc = init("ac_client.exe", false).expect("Failed to attach to process"); //attach to process with false argument, means it will write memory externally, not internally, if ur making a dll then put it to true r/w internally
    let base = proc.getbase("ac_client.exe"); // get module base
    proc.write_range(proc.get_ptr(base + 0x17E0A8, &[0x108]), &[999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999]); // this is cursed but it will write from base + 0x17E0A8, &[0x108] to base + 0x17E0A8, &[0x140]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.