OldSchoolHack

Register / Login English

External BunnyHop [Auto-Update] Fixed

icon Thread: [Release] External BunnyHop [Auto-Update] Fixed

Join Date: Aug 2007

Posts: 8643

User-Rating:

199 positive
33 negative
Kategorie: Counter-Strike: Source
Entwickler: keybode

Beschreibung:
Features:
- BunnyHop
- Auto-updating offsets

Credits:
- Forza (FindPattern)

CPP Code:
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <TlHelp32.h>
  4.  
  5. #define FL_ONGROUND (1<<0)
  6.  
  7. using namespace std;
  8.  
  9. HWND css;
  10. int iFlags;
  11. DWORD dwBasePointer;
  12. HANDLE hProcess;
  13. DWORD m_hClient;
  14. DWORD pID;
  15.  
  16. DWORD GetModuleSize(char* module)
  17. {
  18. HANDLE hSnap;
  19. MODULEENTRY32 xModule;
  20. hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);
  21. xModule.dwSize = sizeof(MODULEENTRY32);
  22. if (Module32First(hSnap, &xModule)) {
  23. while (Module32Next(hSnap, &xModule)) {
  24. if (!strncmp((char*)xModule.szModule, module, 8)) {
  25. CloseHandle(hSnap);
  26. return (DWORD)xModule.modBaseSize;
  27. }
  28. }
  29. }
  30. CloseHandle(hSnap);
  31. return 0;
  32. }
  33.  
  34. DWORD GetModuleBase(LPSTR lpModuleName, DWORD dwProcessId)
  35. {
  36. MODULEENTRY32 lpModuleEntry = {0};
  37. HANDLE hSnapShot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwProcessId);
  38. if(!hSnapShot) return NULL;
  39.  
  40. lpModuleEntry.dwSize = sizeof(lpModuleEntry);
  41. BOOL bModule = Module32First( hSnapShot, &lpModuleEntry );
  42.  
  43. while(bModule)
  44. {
  45. if(!strcmp(lpModuleEntry.szModule, lpModuleName ) )
  46. {
  47. CloseHandle( hSnapShot );
  48. return (DWORD)lpModuleEntry.modBaseAddr;
  49. }
  50.  
  51. bModule = Module32Next( hSnapShot, &lpModuleEntry );
  52. }
  53.  
  54. CloseHandle( hSnapShot );
  55. return NULL;
  56. }
  57.  
  58. void SetDebugPrivilege()
  59. {
  60. HANDLE hProcess=GetCurrentProcess(), hToken;
  61. TOKEN_PRIVILEGES priv;
  62. LUID luid;
  63.  
  64. OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken);
  65. LookupPrivilegeValue(0, "seDebugPrivilege", &luid);
  66. priv.PrivilegeCount = 1;
  67. priv.Privileges[0].Luid = luid;
  68. priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
  69. AdjustTokenPrivileges(hToken, false, &priv, 0, 0, 0);
  70. CloseHandle(hToken);
  71. CloseHandle(hProcess);
  72. }
  73.  
  74. bool bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
  75. {
  76. for(;*szMask;++szMask,++pData,++bMask)
  77. if(*szMask=='x' && *pData!=*bMask )
  78. return false;
  79. return (*szMask) == NULL;
  80. }
  81.  
  82. DWORD dwFindPattern( BYTE* pData, DWORD dwSize, BYTE* bMask, char* szMask )
  83. {
  84. for ( int i = 0; i < dwSize; i ++ )
  85. if ( bDataCompare( (BYTE*)( pData + i ), bMask, szMask ) )
  86. return i;
  87. return NULL;
  88. }
  89.  
  90. DWORD FindPattern( DWORD dwAddress, DWORD dwSize, PBYTE pbSignature, char* pszSignature )
  91. {
  92. DWORD dwTemp = dwAddress;
  93. BYTE pBuf[ 2048 ] = { 0 };
  94.  
  95. do
  96. {
  97. if ( ReadProcessMemory( hProcess, ( PVOID )dwTemp, pBuf, 2048, NULL ) == FALSE )
  98. {
  99. printf("External FindPattern RPM : Error!\n");
  100. return NULL;
  101. }
  102. else
  103. {
  104. DWORD dwDelta = dwFindPattern( pBuf, 2048, pbSignature, pszSignature );
  105.  
  106. if ( dwDelta )
  107. return dwTemp + dwDelta;
  108.  
  109. dwTemp += 2048 - strlen(pszSignature);
  110. }
  111. } while ( true );
  112.  
  113. return NULL;
  114. }
  115.  
  116. DWORD dwBaseEntity;
  117. DWORD dwFlags;
  118. DWORD dwJump;
  119.  
  120. void offset()
  121. {
  122. DWORD client_size = GetModuleSize("client.dll");
  123.  
  124. PBYTE LocalBase_sig = (PBYTE)"\x39\x35\x00\x00\x00\x00\x8B\xCF\x0F\x94\xC2";
  125. char *LocalBase = "xx????xxxxx";
  126. DWORD LocalBase_temp = FindPattern(m_hClient, client_size, LocalBase_sig, LocalBase) + 0x2;
  127. ReadProcessMemory(hProcess, (PBYTE*)LocalBase_temp, &dwBaseEntity, sizeof(DWORD), NULL);
  128.  
  129. PBYTE m_fFlags_sig = (PBYTE)"\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x83\xC4\x30\x68\x00\x00\x00\x00\x6A\x07";
  130. char *m_fFlags = "x????x????x????x????xxxx????xx";
  131. DWORD m_fFlags_temp = 0x0;
  132. m_fFlags_temp = FindPattern(m_hClient, client_size, m_fFlags_sig, m_fFlags) + 0x1;
  133. ReadProcessMemory(hProcess, (PBYTE*)m_fFlags_temp, &dwFlags, 2, NULL);
  134.  
  135. PBYTE jump_sig = (PBYTE)"\x74\x06\x21\x05\x00\x00\x00\x00\xF6\x05\x4C\x13\x31\x51\x03\x74\x03";
  136. char *jump = "xxxx????xxxxxxxxx";
  137. DWORD jump_temp = FindPattern(m_hClient, client_size, jump_sig, jump) + 0x4;
  138. ReadProcessMemory(hProcess, (PBYTE*)jump_temp, &dwJump, sizeof(DWORD), NULL);
  139. }
  140.  
  141. void Read()
  142. {
  143. while(true)
  144. {
  145. Sleep(1);
  146. ReadProcessMemory(hProcess, (PBYTE*)dwBaseEntity, &dwBasePointer, sizeof(DWORD), NULL);
  147. ReadProcessMemory(hProcess, (PBYTE*)(dwBasePointer + dwFlags), &iFlags, sizeof(int), NULL);
  148. }
  149. }
  150. int five = 5;
  151. int four = 4;
  152. void BunnyHop(void)
  153. {
  154. while(true)
  155. {
  156. Sleep(1);
  157.  
  158. if(!GetAsyncKeyState(32))
  159. {
  160. Sleep(10);
  161. continue;
  162. }
  163.  
  164. WriteProcessMemory(hProcess, (PBYTE*)dwJump, &four, sizeof(int), NULL);
  165.  
  166. if(iFlags & FL_ONGROUND) {
  167. WriteProcessMemory(hProcess, (PBYTE*)dwJump, &five, sizeof(int), NULL);
  168. Sleep(10);
  169. }
  170. }
  171. }
  172.  
  173.  
  174.  
  175. DWORD GetProcId(const char* ProcName)
  176. {
  177. PROCESSENTRY32 pe32;
  178. HANDLE hSnapshot = NULL;
  179.  
  180. pe32.dwSize = sizeof( PROCESSENTRY32 );
  181. hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
  182.  
  183. if( Process32First( hSnapshot, &pe32 ) )
  184. {
  185. do{
  186. if( strcmp(pe32.szExeFile, ProcName) == 0 )
  187. break;
  188. }while( Process32Next( hSnapshot, &pe32 ) );
  189. }
  190.  
  191. if( hSnapshot != INVALID_HANDLE_VALUE )
  192. CloseHandle( hSnapshot );
  193.  
  194. return pe32.th32ProcessID;
  195. }
  196.  
  197. int main(HINSTANCE hInstance)
  198. {
  199. SetConsoleTitle("External BunnyHop");
  200.  
  201. while(!FindWindow(NULL, "Counter-Strike Source"))
  202. Sleep(10);
  203.  
  204. while(!pID) { pID = GetProcId("hl2.exe");Sleep(100); }
  205. while(!hProcess) { hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pID);Sleep(100); }
  206. while(!m_hClient) { m_hClient = GetModuleBase("client.dll", pID);Sleep(100); }
  207.  
  208. offset();
  209.  
  210. printf("Scan result:\n");
  211. printf(" [+] LocalBaseEntity: [0x%X]\n", dwBaseEntity - m_hClient);
  212. printf(" [+] m_fFlags: [0x%X]\n", dwFlags);
  213. printf(" [+] Jump State: [0x%X]\n", dwJump - m_hClient);
  214.  
  215. CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Read, NULL, NULL, NULL);
  216. CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)BunnyHop, NULL, NULL, NULL);
  217.  
  218. while(FindWindow(NULL, "Counter-Strike Source"))
  219. Sleep(10);
  220.  
  221. return 1337;
  222. }



Download:
[CSS] External BunnyHop [Auto-Update] Fixed

__________________

Hallo