Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "stdafx.h"
- #include "Tools.h"
- HANDLE processHandle;
- DWORD processIdentifier;
- uintptr_t BaseAddress;
- uintptr_t Inventorydisplay, InventoryDisplayStaticFields, Inventory, CharacterClassManager, Classes, Entity, FirstPersonController;
- HWND hwndCstrikeWindow;
- int CurClass;
- float walkspeed, runspeed, jumpspeed;
- bool speedboost = false;
- bool jumpboost = false;
- int main()
- {
- hwndCstrikeWindow = NULL;
- do {
- hwndCstrikeWindow = FindWindowA(0, "SCPSL");
- } while (hwndCstrikeWindow == NULL);
- cout << "Found Process!" << endl;
- GetWindowThreadProcessId(hwndCstrikeWindow, &processIdentifier);
- processHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, processIdentifier);
- BaseAddress = GetModuleBaseAddress((LPSTR)"GameAssembly.dll", processIdentifier);
- cout << "Got baseaddress!\n" << to_string(BaseAddress) << endl;
- ReadProcessMemory(processHandle, (LPVOID)(BaseAddress + 0x1D59AB0), &Inventorydisplay, sizeof(Inventorydisplay), NULL);
- cout << "Got inventory display!\n" << to_string(Inventorydisplay) << endl;
- if (Inventorydisplay != 0)
- {
- ReadProcessMemory(processHandle, (LPVOID)(Inventorydisplay + 0xB8), &InventoryDisplayStaticFields, sizeof(InventoryDisplayStaticFields), NULL);
- cout << "Got inventorydisplaystaticfields!\n" << to_string(InventoryDisplayStaticFields) << endl;
- if (InventoryDisplayStaticFields != 0)
- {
- ReadProcessMemory(processHandle, (LPVOID)(InventoryDisplayStaticFields + 0x8), &Inventory, sizeof(Inventory), NULL);
- cout << "Got Inventory\n" << to_string(InventoryDisplayStaticFields) << endl;
- if (Inventory != 0)
- {
- ReadProcessMemory(processHandle, (LPVOID)(Inventory + 0x80), &CharacterClassManager, sizeof(CharacterClassManager), NULL);
- cout << "Got CharacterClassManager\n" << to_string(CharacterClassManager) << endl;
- if (CharacterClassManager != 0)
- {
- //Classes
- ReadProcessMemory(processHandle, (LPVOID)(CharacterClassManager + 0x58), &Classes, sizeof(Classes), NULL);
- cout << "Got classes!\n" << to_string(Classes) << endl;
- //Curclass
- ReadProcessMemory(processHandle, (LPVOID)(CharacterClassManager + 0x58), &CurClass, sizeof(CurClass), NULL);
- cout << "Got CurClass\n" << to_string(CurClass) << endl;
- //Entity
- ReadProcessMemory(processHandle, (LPVOID)(Classes + 0x20 + (CurClass * 8)), &Entity, sizeof(Entity), NULL);
- cout << "Got Entity\n" << to_string(Entity) << endl;
- //Getting base walkspeed
- ReadProcessMemory(processHandle, (LPVOID)(Entity + 0x74), &walkspeed, sizeof(walkspeed), NULL);
- cout << to_string(walkspeed) << endl;
- //Getting base runspeed
- ReadProcessMemory(processHandle, (LPVOID)(Entity + 0x78), &runspeed, sizeof(runspeed), NULL);
- cout << to_string(runspeed) << endl;
- //Getting base jumpspeed
- ReadProcessMemory(processHandle, (LPVOID)(Entity + 0x7C), &jumpspeed, sizeof(jumpspeed), NULL);
- cout << to_string(jumpspeed) << endl;
- cout << "Saved speeds\n" << runspeed << endl;
- int pWalkspeed = walkspeed * 0.4;
- int pRunspeed = runspeed * 0.4;
- int pJumpspeed = jumpspeed * 0.4;
- ReadProcessMemory(processHandle, (LPVOID)(CharacterClassManager + 0x90), &FirstPersonController, sizeof(FirstPersonController), NULL);
- cout << "Got FirstPersonController\n" << to_string(FirstPersonController) << endl;
- cout << "Intitialized!";
- while (FirstPersonController != 0)
- {
- if (GetAsyncKeyState(0x6B))
- {
- speedboost = !speedboost;
- if (speedboost) {
- cout << "Speedhack on" << endl;
- WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x18), &pRunspeed, sizeof(pRunspeed), NULL);
- WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x1C), &pWalkspeed, sizeof(pWalkspeed), NULL);
- }
- else
- {
- cout << "Speedhack off" << endl;
- WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x18), &walkspeed, sizeof(walkspeed), NULL);
- WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x1C), &runspeed, sizeof(runspeed), NULL);
- }
- }
- if (GetAsyncKeyState(0x6C))
- {
- jumpboost = !jumpboost;
- if (jumpboost) {
- cout << "Jumpboost on" << endl;
- WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x20), &pJumpspeed, sizeof(pJumpspeed), NULL);
- }
- else
- {
- cout << "Jumpboost off" << endl;
- WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x20), &jumpspeed, sizeof(jumpspeed), NULL);
- }
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment