Results 1 to 8 of 8
  1. #1
    smore's Avatar
    Join Date
    Nov 2015
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Breezy

    Help needed with inject bhop cheat...

    For starters, I am very new to c++. I picked it up a year ago, but forgot about it until about 2 weeks ago, when I started learning it all over again. I made a very basic bunny hop hack, and no matter how long I took to debug it it still failed. I then decided to polish it up by taking from fleep's counter strike source bhop script and adding a lot of his functionality to my hack, but still no luck.

    I am successfully attaching to the game, but I never get the bhop to work. Here is my source:
    (P.S., I'm using fleep's HackProcess.h , but I updated it to attach to "csgo.exe" and "Counter-Strike: Global Offensive")
    Code:
    #include <iostream>
    #include <Windows.h>
    #include "HackProcess.h"
    
    
    CHackProcess fProcess;
    using namespace std;
    
    
    const DWORD Player_Base = 0x00A844DC; // known as LocalPlayer in CSGO
    const DWORD dw_jump = 0x04F34C68; // actually m_fFLags
    
    const DWORD dw_jumpOffset = 0x3944F424;
    
    #define FL_ONGROUND 257
    #define SPACE_BAR 0x20
    
    #define F6_KEY 0x75
    
    bool b_true = true;
    bool b_false = false;
    bool bhopStatus = false;
    
    
    struct MyPlayer_t
    {
        DWORD ClocalPlayer;
        int m_fFlags;
    
        void ReadInformation()
        {
            ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &ClocalPlayer, sizeof(DWORD), 0);
            
            ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(ClocalPlayer + dw_jumpOffset), &m_fFlags, sizeof(int), 0);
        }
    
    }MyPlayer;
    
    
    void BunnyHop()
    {
        if (GetAsyncKeyState(SPACE_BAR))
        {
            bhopStatus = !bhopStatus;
            Sleep(250);
        }
    
        if (!bhopStatus)
            return;
    
        if (MyPlayer.m_fFlags == FL_ONGROUND)
        {
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_true, sizeof(bool), NULL);
        }
        else if (MyPlayer.m_fFlags != FL_ONGROUND)
        {
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_false, sizeof(bool), NULL);
        }
    
    }
    
    
    
    int main()
    {
        fProcess.RunProcess();
        cout << "Attatched to game..." << endl;
    
    
        while (!GetAsyncKeyState(F6_KEY))
        {
            MyPlayer.ReadInformation();
    
            BunnyHop();
        }
    }
    Update... slightly changed code...

    Code:
    #include <iostream>
    #include <Windows.h>
    #include "HackProcess.h"
    
    
    CHackProcess fProcess;
    using namespace std;
    
    
    const DWORD Player_Base = 0x00A844DC; // known as LocalPlayer in CSGO
    const DWORD dw_jump = 0x04F34C68;
    
    const DWORD dw_jumpOffset = 0x3944F424; //m flags
    
    #define FL_ONGROUND 257
    #define SPACE_BAR 0x20
    
    #define F6_KEY 0x75
    
    bool b_true = true;
    bool b_false = false;
    bool bhopStatus = false;
    
    
    struct MyPlayer_t
    {
        DWORD ClocalPlayer;
        int m_fFlags;
    
        void ReadInformation()
        {
            ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &ClocalPlayer, sizeof(DWORD), 0);
            
            ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(ClocalPlayer + dw_jumpOffset), &m_fFlags, sizeof(int), NULL);
        }
    }MyPlayer;
    
    
    void BunnyHop()
    {
        if (GetAsyncKeyState(SPACE_BAR))
        {
            cout << "AUTOHOP TOGGLED..." << endl;
            bhopStatus = !bhopStatus;
            Sleep(250);
        }
    
        if (!bhopStatus)
            return;
    
        if (MyPlayer.m_fFlags == FL_ONGROUND)
        {
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_true, sizeof(bool), NULL);
        }
        else if (MyPlayer.m_fFlags != FL_ONGROUND)
        {
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_false, sizeof(bool), NULL);
        }
    
    }
    
    
    
    int main()
    {
        fProcess.RunProcess();
        cout << "Attatched to game..." << endl;
    
    
        while (!GetAsyncKeyState(F6_KEY))
        {
            MyPlayer.ReadInformation();
    
            BunnyHop();
        }
    }
    Last edited by Hunter; 05-14-2016 at 01:17 PM.

  2. #2
    Hunter's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Depths Of My Mind.
    Posts
    17,468
    Reputation
    3771
    Thanks
    6,159
    My Mood
    Cheerful
    /Moved to the correct section.

  3. #3
    PhY'z's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    518
    Reputation
    58
    Thanks
    1,310
    My Mood
    Angelic
    Code:
    void BunnyHop()
    {
        if (GetAsyncKeyState(VK_SPACE) & 0x8000 && MyPlayer.m_fFlags & (1 << 0))
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), 6, sizeof(int), NULL);
    }
    Also exec as Admin, you should also consider using Velocity to check if the player is moving so it does not jump while typing or out of game
    Contact with me in any question...


    Hi (:

  4. #4
    Threadstarter
    New Member
    smore's Avatar
    Join Date
    Nov 2015
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Breezy
    Didn't help... in fact it did less than it did last time :/

    With the updated code I posted, it would toggle my ability to jump with other keys (a sign it is writing -jump but not +jump?)

    I think my best bet is to completely recode the whole thing... I noticed a lot of things that I can polish up like the need for defining b_True and b_False, etc.

  5. #5
    PhY'z's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    518
    Reputation
    58
    Thanks
    1,310
    My Mood
    Angelic
    I just look at your code again, check your offsets...

  6. #6
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by smore View Post
    Update... slightly changed code...

    Code:
    #include <iostream>
    #include <Windows.h>
    #include "HackProcess.h"
    
    
    CHackProcess fProcess;
    using namespace std;
    
    
    const DWORD Player_Base = 0x00A844DC; // known as LocalPlayer in CSGO
    const DWORD dw_jump = 0x04F34C68;
    
    const DWORD dw_jumpOffset = 0x3944F424; //m flags
    
    #define FL_ONGROUND 257
    #define SPACE_BAR 0x20
    
    #define F6_KEY 0x75
    
    bool b_true = true;
    bool b_false = false;
    bool bhopStatus = false;
    
    
    struct MyPlayer_t
    {
        DWORD ClocalPlayer;
        int m_fFlags;
    
        void ReadInformation()
        {
            ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &ClocalPlayer, sizeof(DWORD), 0);
            
            ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(ClocalPlayer + dw_jumpOffset), &m_fFlags, sizeof(int), NULL);
        }
    }MyPlayer;
    
    
    void BunnyHop()
    {
        if (GetAsyncKeyState(SPACE_BAR))
        {
            cout << "AUTOHOP TOGGLED..." << endl;
            bhopStatus = !bhopStatus;
            Sleep(250);
        }
    
        if (!bhopStatus)
            return;
    
        if (MyPlayer.m_fFlags == FL_ONGROUND)
        {
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_true, sizeof(bool), NULL);
        }
        else if (MyPlayer.m_fFlags != FL_ONGROUND)
        {
            WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_false, sizeof(bool), NULL);
        }
    
    }
    
    
    
    int main()
    {
        fProcess.RunProcess();
        cout << "Attatched to game..." << endl;
    
    
        while (!GetAsyncKeyState(F6_KEY))
        {
            MyPlayer.ReadInformation();
    
            BunnyHop();
        }
    }
    Code:
    const DWORD dw_jumpOffset = 0x3944F424; //m flags
    m_fFlags is a variable of the player class, it doesn't have a static address, it's stored where ever your LocalPlayer is stored + 0x100.
    Change the offset to 0x100.

    Also, if you already comment that line of code with // m flags, why do you call your offset dw_jumpOffset. It's just confusing.

    Code:
    ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(ClocalPlayer + dw_jumpOffset), &m_fFlags, sizeof(int), NULL);
    It's not an integer, its a BYTE.

    Regarding the GetAsyncKeyState call, you are checking it incorrectly. If you take a look at the MSDN page of GetAsyncKeyState, you'll see the following:

    Quote Originally Posted by MSDN
    If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState.
    This means, that your condition will also be true if you let go of the key inbetween the calls. You can bitmask the return value of GetAsyncKeyState. Check for GetAsyncKeyState( KEY ) & 0x8000 if you want to know whether the key is currently pressed or not.

  7. The Following User Says Thank You to WasserEsser For This Useful Post:

    smore (05-19-2016)

  8. #7
    Threadstarter
    New Member
    smore's Avatar
    Join Date
    Nov 2015
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Breezy
    Thanks for your help! I got the script working well. There will still quite a few big mistakes I made that I had to clean up (not sure if you didn't mention them to see if i was c+p lol), but once I figured it out I finally was able to get it functioning. I think that there are still much better ways to code this script, so I think my next project is to make a much cleaner and more simplistic script with comments.

    Thanks!

    p.s., how do I close this thread?

  9. #8
    Hunter's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Depths Of My Mind.
    Posts
    17,468
    Reputation
    3771
    Thanks
    6,159
    My Mood
    Cheerful
    Quote Originally Posted by smore View Post
    p.s., how do I close this thread?
    You don't. You need to mention one of the current section Minions who are @NormenJaydenFBI, @rwby and myself to close any threads made by you that you wish to be closed.

    /Solved & closed.

Similar Threads

  1. [Help Request] Help Needed with injecting hacks?
    By ShoeStrinqs in forum CrossFire Help
    Replies: 3
    Last Post: 09-01-2011, 07:50 PM
  2. [HELP] Help needed with modding programs
    By Sphearow412 in forum Combat Arms Mod Discussion
    Replies: 0
    Last Post: 01-17-2010, 02:50 PM
  3. Help needed with assaultcube hacking.
    By Lolland in forum C++/C Programming
    Replies: 7
    Last Post: 10-13-2009, 02:01 AM
  4. help needed with winrar passwords
    By luddiw2 in forum General Hacking
    Replies: 0
    Last Post: 07-22-2008, 04:03 AM
  5. Help needed with my WH
    By imn00b in forum C++/C Programming
    Replies: 7
    Last Post: 04-21-2008, 03:59 PM