External bhop with comments! [C++]
Credits: @Merccy2 (Did the bitmasked value check and explained it) @jkfauvel (Helped me alot starting out with game hacking.) and Fleep for ProcMem (Think he created itxD)
Try and learn from it, dont just C&P might be detected or not. Haven't tried.
Decided to release my Source since I've learned so much from here
Since im using ProcMem (Think fleep created it?) you will need theese 2 files:
ProcMem.h : http://pastebin.com/cMV6ahKy
ProcMem.cpp : http://pastebin.com/7kcJEx2p
For easier reading (Because of syntax highlighting) you can read the source from pastebin aswell:
http://pastebin.com/mhNHL2Xm
Source:
If there is any spelling misstakes or a wrong explanation somewhere please add me on skype or post here giving me feedback! 
Try and learn from it, dont just C&P might be detected or not. Haven't tried.
Decided to release my Source since I've learned so much from here

Since im using ProcMem (Think fleep created it?) you will need theese 2 files:
ProcMem.h : http://pastebin.com/cMV6ahKy
ProcMem.cpp : http://pastebin.com/7kcJEx2p
For easier reading (Because of syntax highlighting) you can read the source from pastebin aswell:
http://pastebin.com/mhNHL2Xm
Source:
Code:
/* Credits Pscyhobitch @ mpgh.net */
#include "ProcMem.h"
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
ProcMem Mem; // Shortcut for ProcMem.
/* Addresses */
const DWORD playerBase = 0x00A7094C; // localplayer (Is the common names for theese in dumpers etc.)
const DWORD entityBase = 0x04A13264; // entity list. (Same as above...)
const DWORD flagOffset = 0x100; // The flag offset, used in reading memory.
/* Defining Virtual keys */
#define space_bar 0x20 // space bar.
#define KEY9 0x39 // the normal 9 used for hopping.
#define KEY9SC 0x0A // Scan code for 9.
#define insert 0x2D // Insert virtual key code.
#define Del 0x2E // delete virtual key code.
#define pressed 0x8000 // The proper way to use GetAsyncKeyState is to BitAND the return value with 0x8000. credits to some random on the internet.
/* Functions */
void bhopCall(bool * onOff);
void bhop();
void jump();
/* Struct used in reading our games memory! */
struct read_t
{
DWORD ClientDLL; // Declarations.
DWORD localPlayer;
int Flags;
void ReadInfo()
{
Mem.Process("csgo.exe"); //Set process name
ClientDLL = Mem.Module("client.dll"); //Module to read from
localPlayer = Mem.Read<DWORD>(ClientDLL + playerBase); //Get our player's information
Flags = Mem.Read<int>(localPlayer + flagOffset); //Get flag state
}
}read; // shortcut thingy.
/* Main function! */
int main()
{
SetConsoleTitle("hack bhop"); // Sets the title of the hack.
cout << "ALL CREDITS TO PSYCHOBITCH MPGH.NET!\n"; // Prints what is inside of the quotations.
cout << "Press Insert to turn on/off and delete to quick exit!\n\n"; // Same as above.
bool onOff = false; // Our bool to tell if it on or off.
while(!(GetAsyncKeyState(Del) & pressed)) bhopCall(&onOff); /* While loop, this is where we implement our quick exit.
so, While del (delete button) is not pressed do bhopCall and give it the addres of onOff.
Basically a infinite loop untill del is pressed (Defined at top.
*/
}
/* the bhopCall where we have to pass the argument onOff with * as it is a pointer.(Same at top) */
void bhopCall(bool * onOff)
{
if (GetAsyncKeyState(insert) & pressed && !*onOff) // If insert is pressed and onOff is already false do the following lines (Stuff inside curly brackets).
{
*onOff = true; // Sets onOff to true.
cout << "Bhop on.\n"; // Prints "Bhop on" the \n is a endline can also be made like this cout << "text" << endl;
Sleep(100); // Sleeps for a 100 milliseconds.
}
else if (GetAsyncKeyState(insert) & pressed && *onOff) // If insert is pressed and onOff is already true do the following lines (Stuff inside curly brackets).
{
*onOff = false; // Sets onOff to false.
cout << "Bhop off.\n"; // prints "bhop off". See explanation above.
Sleep(100); // Sleeps for a 100 milliseconds.
}
if (*onOff) bhop(); // If onOff is == true do bhop. You dont have to type *onOff == true because the compiler asumes it should be true if not told to search otherwise.
}
/* jump functions */
void jump()
{
Sleep(10); // Sleeps for 10 milliseconds.
keybd_event(KEY9, KEY9SC, 0, 0); // Sends a virtual key press.
Sleep(10); // Sleeps for 10 milliseconds
keybd_event(KEY9, KEY9SC, KEYEVENTF_KEYUP, 0); // Sends a virtual key press.
}
/* Actual bhop function */
void bhop()
{
read.ReadInfo(); // We're gonna be reading from our struct, so we need to read the readInfo function so we can use its variables.
if (GetAsyncKeyState(space_bar) & pressed && read.Flags & 0x1 == 1) jump(); // If user is holding space and flag statement and 0x1 == 1 jump.
// Quoted from Merccy2 why it should be & 0x1 == 1 :)
/*
m_fFlags is a bitmasked value.
The first bit (2 ^ 0 = 1) is the bit that is 1 when you are on the ground.
The second bit (2 ^ 1 = 2) is the bit that is 1 when you are crouching.
If you are checking m_fFlags to 257 it won't work when you are on fire (1 of the bits will change hence changing the complete value).
http://en.wikipedia.org/wiki/Mask_%28computing%29 < Read about it here.
*/
}


