-
Автор темы
- #1
Недавно( точнее вчера) , я решил написать скрипт для автобхопа, но шото пошло не так, так что смотрите ниже
main.cpp
processAttach
main.cpp
#include <iostream> #include <windows.h> #include "ProcessAttach.h" using namespace std; #pragma region Offsets DWORD Client; DWORD dwLocalPlayer = 0xD3FC5C; DWORD FFlags = 0x104; #pragma endregion struct Player_T { DWORD LocalPlayer; int Flag; void Reading() { ReadProcessMemory(pGame, (DWORD*)(Client + dwLocalPlayer), &LocalPlayer, sizeof(DWORD), 0); ReadProcessMemory(pGame, (DWORD*)(LocalPlayer + FFlags), &Flag, sizeof(int), 0); } }PlayeR; void bHop() { if (GetAsyncKeyState(0x20)) { if (PlayeR.Flag == 257 || PlayeR.Flag == 263) { keybd_event(MapVirtualKey(0x20, 0), 0x39, KEYEVENTF_EXTENDEDKEY, 0); keybd_event(MapVirtualKey(0x20, 0), 0x39, KEYEVENTF_KEYUP, 0); Sleep(1); } } } int main() { GetProcess("csgo.exe"); Client = GetModule("client.dll"); while (true) { PlayeR.Reading(); bHop(); Sleep(1); } return 0; } |
processAttach
#include <windows.h> #include <TlHelp32.h> using namespace std; DWORD __pId; HANDLE pGame; void GetProcess(const char* Process) { PROCESSENTRY32 EntryP; EntryP.dwSize = sizeof(PROCESSENTRY32); HANDLE pSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); while (Process32Next(pSnap, &EntryP)) { if (!strcmp(EntryP.szExeFile, Process)) { CloseHandle(pSnap); __pId = EntryP.th32ProcessID; pGame = OpenProcess(PROCESS_ALL_ACCESS, false, __pId); return; } } CloseHandle(pSnap); cout << "Process not found" << endl; system("pause"); exit(1); } DWORD GetModule(LPCSTR Module) { MODULEENTRY32 EntryM; EntryM.dwSize = sizeof(MODULEENTRY32); HANDLE pSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, __pId); while (Module32Next(pSnap, &EntryM)) { cout << EntryM.szModule << endl; if (!strcmp(EntryM.szModule, Module)) { CloseHandle(pSnap); return(DWORD)EntryM.modBaseAddr; } } CloseHandle(pSnap); cout << "Module not found :3 " << endl; system("pause"); exit(2); } |