Results 1 to 8 of 8
  1. #1
    verideth_01's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    5
    My Mood
    Amazed

    Post Revolutionary: CreateMove Hook (Coded in RUST!!)

    Yo guys, I'm releasing this as a project to learn Rust. The programming language. Its actually been quite great, and I must say, its really interesting!!! The way they handle pointers, the way they manage memory, gives me a whole different feel from programming in C++.

    Too much people coding in C++ is the reason I gave rust a go.


    Anyways heres the code:

    Code:
    /*
        Rust code explaining how direct function detours work
        Copyright: 6-27-2017 
        credits: UC for teaching me how hooks work
    */ 
    
    #![feature(const_fn)]
    #![feature(libc)]
     
    extern crate winapi;
    extern crate kernel32;
    #[macro_use] extern crate detour;
    #[macro_use] extern crate lazy_static;
    extern crate libc;
    
    use detour::*;
    use winapi::{HWND, LPCSTR, UINT, c_int};
    
    type createmove_fn = fn(f32, *mut UserCmd) -> bool;
    
    struct UserCmd {
        /* dscode here */
    }
    
    struct FunctionPtrAddress {
        addy: createmove_fn
    }
    
    lazy_static! {
        static ref fn_ptrs: FunctionPtrAddress = FunctionPtrAddress {
            addy: unsafe {
                std::mem::transmute::<usize, createmove_fn>(0xFFFF) // createmove address here
                                          // I would reverse it, but the game I reversed was gmod :{
            }
        };
    }
    
    static_detours! {
        struct CreateMoveDetour: fn(f32, *mut UserCmd) -> bool;
    }
    
    // entry point
    #[no_mangle]
    #[allow(non_snake_case, unused_variables)]
    pub extern "system" fn DllMain(
        dll_module: winapi::HINSTANCE,
        call_reason: winapi::DWORD,
        reserved: winapi::LPVOID)
        -> winapi::BOOL
    {
        const DLL_PROCESS_ATTACH: winapi::DWORD = 1;
        const DLL_PROCESS_DETACH: winapi::DWORD = 0;
    
        match call_reason {
            DLL_PROCESS_ATTACH => init(),
            DLL_PROCESS_DETACH => (),
            _ => ()
        }
    
        return winapi::TRUE;
    }
        
    // init
    fn init() {
        unsafe { 
            kernel32::AllocConsole() 
        };
    
        println!("Initializing...");
    
        let closure_for_createmove = |input_sample_time, cmd| {
            println!("fuck weebs, heres the detour. put your code in here");
        
            return (fn_ptrs.addy)(input_sample_time, cmd);
        };  
    
        let mut hook = unsafe { 
            CreateMoveDetour.initialize(createmove_hook, closure_for_createmove).unwrap() 
        };
    
        unsafe {
            hook.enable().unwrap();
        }
    
        createmove_hook(1.0, std::ptr::null_mut()); // call this so hook.call works
        hook.call(100.0, std::ptr::null_mut());
    }
    
    fn createmove_hook(input_sample_time: f32, cmd: *mut UserCmd) -> bool {
        println!("original function");
    
        return (fn_ptrs.addy)(input_sample_time, cmd);
    }
    Honestly, one of the more fun projects I've done.

    Shouts out to snip

    Enjoy, thank me, and reply what you think!! '

    Add me on steam!! If you need any reversing or coding help: id/probablycoding/
    Last edited by verideth_01; 06-27-2017 at 08:07 AM.

  2. #2
    Zaczero's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    localhost
    Posts
    3,288
    Reputation
    1517
    Thanks
    14,262
    My Mood
    Angelic
    umm.. wrong section?
    . . . malsignature.com . . .



    [ global rules ] [ scam report ] [ image title ] [ name change ] [ anime force ]
    [ league of legends marketplace rules ] [ battlefield marketplace rules ]

    "because everytime you post a picture of anime in here
    your virginity's time increases by 1 month"
    ~Smoke 2/18/2018


    Former Staff 09-29-2018
    Battlefield Minion 07-21-2018
    Premium Seller 03-04-2018
    Publicist 12-10-2017
    League of Legends Minion 05-31-2017
    Premium 02-05-2017
    Member 10-13-2013

  3. #3
    verideth_01's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    5
    My Mood
    Amazed
    Well, not really. Its a release.

  4. #4
    knochenx's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Location
    Cologne
    Posts
    75
    Reputation
    10
    Thanks
    15
    For what specifically?
    println!("fuck weebs, heres the detour. put your code in here");
    If I helped you in anyway, or provided useful information, please 'Thank' me!
    - Project XNS -

  5. #5
    verideth_01's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    5
    My Mood
    Amazed
    Quote Originally Posted by knochenx View Post
    For what specifically?
    jokesssss

  6. #6
    csgoezranks's Avatar
    Join Date
    May 2017
    Gender
    male
    Posts
    26
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by knochenx View Post
    For what specifically?
    because weebs are fags lul

  7. #7
    certmemer's Avatar
    Join Date
    Feb 2016
    Gender
    female
    Location
    Southampton
    Posts
    2,511
    Reputation
    104
    Thanks
    25,994
    cool, but detours get you banned
    my steam acc: click
    donate me a few cents: click

  8. #8
    verideth_01's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    5
    My Mood
    Amazed
    Quote Originally Posted by certmemer View Post
    cool, but detours get you banned
    yes... with ms detours. This is a completely new detours library available from cargo.

Similar Threads

  1. [Steam] Steam code for Rust
    By Cinodor in forum Giveaways
    Replies: 91
    Last Post: 03-18-2017, 05:34 PM
  2. [WTT] Giving Guild Wars 2 account + Enclave steam code for Rust steam gift.
    By DevilKeller in forum Trade Accounts/Keys/Items
    Replies: 0
    Last Post: 01-23-2014, 08:19 PM
  3. Replies: 10
    Last Post: 02-16-2010, 12:54 AM
  4. hook code for WALLHACK
    By undergroundhack in forum C++/C Programming
    Replies: 9
    Last Post: 07-11-2009, 05:35 PM
  5. Pro Code D3D Public Hook
    By lukazuki in forum Operation 7 Hacks
    Replies: 10
    Last Post: 06-19-2009, 05:54 PM