Guest User

scpspeedhack

a guest
Apr 7th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.83 KB | None | 0 0
  1. #include <iostream>
  2. #include "stdafx.h"
  3. #include "Tools.h"
  4.  
  5.  
  6. HANDLE processHandle;
  7. DWORD processIdentifier;
  8. uintptr_t BaseAddress;
  9. uintptr_t Inventorydisplay, InventoryDisplayStaticFields, Inventory, CharacterClassManager, Classes, Entity, FirstPersonController;
  10. HWND hwndCstrikeWindow;
  11. int CurClass;
  12. float walkspeed, runspeed, jumpspeed;
  13. bool speedboost = false;
  14. bool jumpboost = false;
  15.  
  16. int main()
  17. {
  18.     hwndCstrikeWindow = NULL;
  19.  
  20.     do {
  21.         hwndCstrikeWindow = FindWindowA(0, "SCPSL");
  22.     } while (hwndCstrikeWindow == NULL);
  23.     cout << "Found Process!" << endl;
  24.  
  25.     GetWindowThreadProcessId(hwndCstrikeWindow, &processIdentifier);
  26.  
  27.     processHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, processIdentifier);
  28.  
  29.     BaseAddress = GetModuleBaseAddress((LPSTR)"GameAssembly.dll", processIdentifier);
  30.     cout << "Got baseaddress!\n" << to_string(BaseAddress) << endl;
  31.  
  32.     ReadProcessMemory(processHandle, (LPVOID)(BaseAddress + 0x1D59AB0), &Inventorydisplay, sizeof(Inventorydisplay), NULL);
  33.     cout << "Got inventory display!\n" << to_string(Inventorydisplay) << endl;
  34.  
  35.     if (Inventorydisplay != 0)
  36.     {
  37.         ReadProcessMemory(processHandle, (LPVOID)(Inventorydisplay + 0xB8), &InventoryDisplayStaticFields, sizeof(InventoryDisplayStaticFields), NULL);
  38.         cout << "Got inventorydisplaystaticfields!\n" << to_string(InventoryDisplayStaticFields) << endl;
  39.  
  40.         if (InventoryDisplayStaticFields != 0)
  41.         {
  42.             ReadProcessMemory(processHandle, (LPVOID)(InventoryDisplayStaticFields + 0x8), &Inventory, sizeof(Inventory), NULL);
  43.             cout << "Got Inventory\n" << to_string(InventoryDisplayStaticFields) << endl;
  44.  
  45.             if (Inventory != 0)
  46.             {
  47.                 ReadProcessMemory(processHandle, (LPVOID)(Inventory + 0x80), &CharacterClassManager, sizeof(CharacterClassManager), NULL);
  48.                 cout << "Got CharacterClassManager\n" << to_string(CharacterClassManager) << endl;
  49.  
  50.                 if (CharacterClassManager != 0)
  51.                 {
  52.                     //Classes
  53.                     ReadProcessMemory(processHandle, (LPVOID)(CharacterClassManager + 0x58), &Classes, sizeof(Classes), NULL);
  54.                     cout << "Got classes!\n" << to_string(Classes) << endl;
  55.  
  56.                     //Curclass
  57.                     ReadProcessMemory(processHandle, (LPVOID)(CharacterClassManager + 0x58), &CurClass, sizeof(CurClass), NULL);
  58.                     cout << "Got CurClass\n" << to_string(CurClass) << endl;
  59.  
  60.                     //Entity
  61.                     ReadProcessMemory(processHandle, (LPVOID)(Classes + 0x20 + (CurClass * 8)), &Entity, sizeof(Entity), NULL);
  62.                     cout << "Got Entity\n" << to_string(Entity) << endl;
  63.  
  64.                     //Getting base walkspeed
  65.                     ReadProcessMemory(processHandle, (LPVOID)(Entity + 0x74), &walkspeed, sizeof(walkspeed), NULL);
  66.                     cout << to_string(walkspeed) << endl;
  67.  
  68.                     //Getting base runspeed
  69.                     ReadProcessMemory(processHandle, (LPVOID)(Entity + 0x78), &runspeed, sizeof(runspeed), NULL);
  70.                     cout << to_string(runspeed) << endl;
  71.  
  72.                     //Getting base jumpspeed
  73.                     ReadProcessMemory(processHandle, (LPVOID)(Entity + 0x7C), &jumpspeed, sizeof(jumpspeed), NULL);
  74.                     cout << to_string(jumpspeed) << endl;
  75.  
  76.                     cout << "Saved speeds\n" << runspeed << endl;
  77.  
  78.                     int pWalkspeed = walkspeed * 0.4;
  79.                     int pRunspeed = runspeed * 0.4;
  80.                     int pJumpspeed = jumpspeed * 0.4;
  81.  
  82.  
  83.  
  84.                     ReadProcessMemory(processHandle, (LPVOID)(CharacterClassManager + 0x90), &FirstPersonController, sizeof(FirstPersonController), NULL);
  85.                     cout << "Got FirstPersonController\n" << to_string(FirstPersonController) << endl;
  86.                     cout << "Intitialized!";
  87.                     while (FirstPersonController != 0)
  88.                     {
  89.                         if (GetAsyncKeyState(0x6B))
  90.                         {
  91.                             speedboost = !speedboost;
  92.                             if (speedboost) {
  93.                                 cout << "Speedhack on" << endl;
  94.                                 WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x18), &pRunspeed, sizeof(pRunspeed), NULL);
  95.                                 WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x1C), &pWalkspeed, sizeof(pWalkspeed), NULL);
  96.                             }
  97.                             else
  98.                             {
  99.                                 cout << "Speedhack off" << endl;
  100.                                 WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x18), &walkspeed, sizeof(walkspeed), NULL);
  101.                                 WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x1C), &runspeed, sizeof(runspeed), NULL);
  102.                             }
  103.                         }
  104.                        
  105.                         if (GetAsyncKeyState(0x6C))
  106.                         {
  107.                             jumpboost = !jumpboost;
  108.                             if (jumpboost) {
  109.                                 cout << "Jumpboost on" << endl;
  110.                                 WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x20), &pJumpspeed, sizeof(pJumpspeed), NULL);
  111.                             }
  112.                             else
  113.                             {
  114.                                 cout << "Jumpboost off" << endl;
  115.                                 WriteProcessMemory(processHandle, (LPVOID)(FirstPersonController + 0x20), &jumpspeed, sizeof(jumpspeed), NULL);
  116.                             }
  117.                         }
  118.                     }
  119.                 }
  120.             }
  121.         }
  122.     }
  123.  
  124.  
  125.  
  126.  
  127. }
Add Comment
Please, Sign In to add comment