OldSchoolHack

Registrieren / Anmelden Deutsch

Sv_cheats und r_drawothermodels bypass

icon Thema: Sv_cheats und r_drawothermodels bypass

Anmeldungsdatum: Jun 2011

Beiträge: 490

Benutzer-Bewertung:

12 positiv
0 negativ
Hey Leute, ich vesuche nun schon seit Stunden den Wert von Sv_cheats in C++ mit WriteProcessMemory auf 1 zu setzen. Mit der Cheat Engine klappt alles ohne Probleme, doch ich bekomms in C++ irgendwie nicht hin. Hier mal der Code :
CPP Code:
  1. #include "stdafx.h"
  2.  
  3. #include <windows.h>
  4. #include <iostream>
  5. #include <conio.h>
  6. #include <tlhelp32.h>
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #include <string>
  10. #include <cstdlib>
  11. #include <sstream>
  12. #include <Windows.h>
  13. #pragma comment(lib, "Psapi.lib")
  14. using namespace std;
  15.  
  16.  
  17. int SetSvCheats = 1;
  18. int SetDrawModels = 2;
  19. int SvCheatsValue;
  20. int DrawModelsValue;
  21. DWORD GetModuleBaseExtern(const DWORD dwProcessId, const char *szModuleName)
  22. {
  23. #ifdef _GMBE_CHECK_PARAMS_
  24. if (!dwProcessID) || (!szModuleName) return 0;
  25. #endif
  26.  
  27. HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
  28. if (!hSnap) return 0;
  29.  
  30. MODULEENTRY32 me;
  31. me.dwSize = sizeof(MODULEENTRY32);
  32.  
  33. DWORD dwReturn = 0;
  34.  
  35. if (Module32First(hSnap, &me)) {
  36. while (Module32Next(hSnap, &me)) {
  37. if (lstrcmpi(me.szModule, szModuleName) == 0) {
  38. dwReturn = (DWORD)me.modBaseAddr;
  39. break;
  40. }
  41. }
  42. }
  43.  
  44. CloseHandle(hSnap);
  45.  
  46. return dwReturn;
  47. }
  48.  
  49.  
  50. int main(int argc, char *argv[])
  51. {
  52.  
  53.  
  54. SetConsoleTitle( "Mantas Trigger - Exorbital gut" );
  55. HWND hwnd = NULL;
  56. DWORD pid;
  57. HANDLE hProcess;
  58. DWORD clientbase;
  59. DWORD enginebase;
  60. cout << " Starte jetzt CS:S du Lappen." << endl;
  61. while(hwnd==NULL)
  62. {
  63. hwnd = FindWindow (NULL, "Counter-Strike Source");
  64. cout << " Es ist ja immer noch nicht an ! " << endl;
  65. Sleep(3000);
  66. }
  67. GetWindowThreadProcessId (hwnd, &pid);
  68. hProcess = OpenProcess (PROCESS_ALL_ACCESS, 0, pid);
  69. cout << " Isch hab ihn gefunden ;) " << endl;
  70. cout << " _____ _____ _ " << endl;
  71. cout << " | __|___ _ _ ___ ___ __ | __|_ _ ___| |_ " << endl;
  72. cout << " |__ | . | | | _| _| -_| | __| | | _| '_|" << endl;
  73. cout << " |_____|___|___|_| |___|___| |__| |___|___|_,_|" << endl;
  74. cout << "" << endl;
  75.  
  76. clientbase = GetModuleBaseExtern(pid, "client.dll");
  77. enginebase = GetModuleBaseExtern(pid, "engine.dll");
  78. cout << enginebase << endl;
  79.  
  80. while (true)
  81. {
  82. if(GetKeyState(VK_F1))
  83. {
  84. ReadProcessMemory (hProcess, (LPCVOID)(enginebase + 0x55F170), &SvCheatsValue, sizeof(SvCheatsValue), NULL);
  85. ReadProcessMemory (hProcess, (LPCVOID)(clientbase + 0x566A50), &DrawModelsValue, sizeof(DrawModelsValue), NULL);
  86.  
  87. WriteProcessMemory (hProcess, (LPVOID)(SvCheatsValue), &SetSvCheats, sizeof(SetSvCheats), NULL);
  88. WriteProcessMemory (hProcess, (LPVOID)(DrawModelsValue), &SetDrawModels, sizeof(SetDrawModels), NULL);
  89.  
  90. }
  91.  
  92. }
  93. Sleep(3);
  94. }


__________________

http://www10.pic-upload.de/30.04.12/j9dbc34bxdg.jpg