Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // THIS HACK NO LONGER WORKS, AND MAY GET YOU B& !!!
- /***************************************************************
- * HEROES AND GENERALS - NO RECOIL HACK 28. MAY 2015 *
- ***************************************************************
- * COMPILING: Create a Win32 C++ command line program in *
- * Visual Studio, set character set to Multi-Byte and compile. *
- * USAGE: Run the program AS ADMINISTRATOR while you are on *
- * the respawn screen in a H&G action-game battle. *
- ***************************************************************/
- #include <windows.h>
- #include <stdio.h>
- #include <tlhelp32.h>
- #include <tchar.h>
- #include <string>
- HWND hwnd;
- DWORD pid;
- HANDLE handle;
- DWORD playerDLL;
- DWORD getPlayer(DWORD pid) {
- HANDLE hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);
- MODULEENTRY32 me32;
- me32.dwSize = sizeof(MODULEENTRY32);
- for (;;) {
- Module32Next(hModuleSnap, &me32);
- std::string compare = me32.szModule;
- printf("\n%s", me32.szModule);
- if (compare == "player.dll") {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN);
- printf(" <-- PLAYER.DLL found!\n");
- break;
- }
- }
- return (DWORD)me32.modBaseAddr;
- }
- char pressanykey( const char *prompt ) {
- DWORD mode;
- HANDLE hstdin;
- INPUT_RECORD inrec;
- DWORD count;
- char default_prompt[] = "\n[Press any key to exit]\n";
- char result = '\0';
- /* Set the console mode to no-echo, raw input, */
- /* and no window or mouse events. */
- hstdin = GetStdHandle( STD_INPUT_HANDLE );
- if (hstdin == INVALID_HANDLE_VALUE
- || !GetConsoleMode( hstdin, &mode )
- || !SetConsoleMode( hstdin, 0 ))
- return result;
- if (!prompt) prompt = default_prompt;
- /* Instruct the user */
- WriteConsole(
- GetStdHandle( STD_OUTPUT_HANDLE ),
- prompt,
- lstrlen( prompt ),
- &count,
- NULL
- );
- FlushConsoleInputBuffer( hstdin );
- /* Wait for and get a single key PRESS */
- do ReadConsoleInput( hstdin, &inrec, 1, &count );
- while ((inrec.EventType != KEY_EVENT) || !inrec.Event.KeyEvent.bKeyDown);
- /* Remember which key the user pressed */
- result = inrec.Event.KeyEvent.uChar.AsciiChar;
- /* Wait for and get a single key RELEASE */
- do ReadConsoleInput( hstdin, &inrec, 1, &count );
- while ((inrec.EventType != KEY_EVENT) || inrec.Event.KeyEvent.bKeyDown);
- /* Restore the original console mode */
- SetConsoleMode( hstdin, mode );
- return result;
- }
- int main() {
- HANDLE w32out = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(w32out, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- puts("HEROES AND GENERALS NO-RECOIL HACK\nOriginal program by flowing_around, updated & compiled by Electroduck");
- SetConsoleTextAttribute(w32out, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- puts("https://www.youtube.com/channel/UCORHlCc9y18DYBMRd-Br3ZA\n");
- SetConsoleTextAttribute(w32out, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- hwnd = FindWindowA(0, "H&G");
- GetWindowThreadProcessId(hwnd, &pid);
- handle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, 0, pid);
- if (handle) {
- playerDLL = getPlayer(pid);
- WriteProcessMemory(handle, (LPVOID)(playerDLL + 0x001F5C71), &"\x90\x90\x90\x90\x90", 5, 0);
- SetConsoleTextAttribute(w32out, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
- puts("HACK ACTIVATED!");
- } else {
- SetConsoleTextAttribute(w32out, FOREGROUND_RED | FOREGROUND_INTENSITY);
- puts("Hack failed! Make sure that:\n * The H&G action game is running, i.e. you are actually in a battle\n * This program is run as administrator");
- }
- SetConsoleTextAttribute(w32out, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
- pressanykey(0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement