Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // csgo_bhop.cpp : Defines the entry point for the console application.
- //
- #include <Windows.h>
- #include <stdio.h>
- #include <cstdint>
- #include <algorithm>
- #include <iostream>
- #include <vector>
- #include <chrono>
- #include <deque>
- #include <random>
- #include <Psapi.h>
- #include <atomic>
- #include <array>
- #include <chrono>
- #include <iomanip>
- #include <iphlpapi.h>
- #include <locale>
- #include <stdlib.h>
- #include <string>
- #include <iostream>
- #include <sstream>
- #include <fstream>
- #include <thread>
- #include <assert.h>
- #include <cstddef>
- #include <thread>
- #include <TlHelp32.h>
- uint32_t client_dll;
- uint32_t m_fFlags = 0x100;;
- uint32_t dwLocalPlayer = 0xC5E87C;
- uint32_t dwForceJump = 0x50DE048;
- HANDLE h_csgo;
- uint32_t pid_csgo;
- auto get_process_id(std::string process) ->uint32_t {
- HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
- PROCESSENTRY32 entry;
- entry.dwSize = sizeof(entry);
- do
- {
- if (process == entry.szExeFile)
- {
- DWORD pid = entry.th32ProcessID;
- CloseHandle(hSnap);
- return pid;
- }
- } while (Process32Next(hSnap, &entry));
- CloseHandle(hSnap);
- return 0;
- }
- auto attach(std::string process) ->void {
- while (true)
- {
- pid_csgo = get_process_id(process);
- if (pid_csgo != 0)
- {
- h_csgo = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid_csgo);
- return;
- }
- Sleep(400);
- }
- }
- auto get_module(const char* modName) ->uint32_t
- {
- HANDLE handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid_csgo);
- MODULEENTRY32 entry;
- entry.dwSize = sizeof(entry);
- do
- {
- if (!strcmp(entry.szModule, (LPSTR)modName))
- {
- CloseHandle(handle);
- return (DWORD)entry.modBaseAddr;
- }
- } while (Module32Next(handle, (LPMODULEENTRY32)&entry));
- return NULL;
- }
- template <class T>
- auto read(uint32_t adr) -> T {
- T ret;
- ReadProcessMemory(h_csgo, reinterpret_cast<LPVOID>(adr), &ret, sizeof(T), NULL);
- return ret;
- }
- template <class T>
- auto write(uint32_t adr, T buf) -> void {
- WriteProcessMemory(h_csgo, reinterpret_cast<LPVOID>(adr), &buf, sizeof(T), NULL);
- }
- uint32_t main()
- {
- attach("csgo.exe");
- std::this_thread::sleep_for(std::chrono::milliseconds(400));
- client_dll = get_module("client_panorama.dll");
- std::this_thread::sleep_for(std::chrono::milliseconds(400));
- do {
- auto local_player = read<uint32_t>(client_dll + dwLocalPlayer);
- auto flags = read<int>(local_player + m_fFlags);
- if (GetAsyncKeyState(32)) {
- if (flags < 263 && flags != 257)
- write<uint32_t>(client_dll + dwForceJump, 4);
- else
- write<uint32_t>(client_dll + dwForceJump, 5);
- }
- if (GetAsyncKeyState(4)) {
- printf_s("Client dll: 0x%x \n", client_dll);
- auto hp = read<int>(local_player + 0xFC);
- printf_s("Local Player: 0x%x \n", local_player);
- printf_s("Health: %d", hp);
- }
- } while (true);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement