hlsdk

lolz

Jul 14th, 2010
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. /*
  2. ** VAC Bannatron
  3. ** (c) 2010 TEAM METALSLAVE RAGE CO. All rights reserved.
  4. **
  5. ** This is the application version.
  6. */
  7.  
  8.  
  9. #include <stdio.h>
  10. #include <conio.h>
  11. #include <windows.h>
  12. #include <Tlhelp32.h>
  13.  
  14. // The patch code for the decryption function.
  15. // Once the patch hits, all attempts at decryption fail and fgts get detected ok
  16. static UINT8 patchcode[] = { 0x33, 0xc0, 0xc3, };
  17.  
  18. static UINT32 patch_offset = 0x27EE;
  19. static UINT32 patch_done = 0;
  20.  
  21. void FindAndPatchVac( DWORD steamProcId ) {
  22. MODULEENTRY32 modEntry;
  23.  
  24. HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, steamProcId);
  25.  
  26. // return and dont do shit ok
  27. if (!hSnapShot) return;
  28.  
  29. modEntry.dwSize = sizeof(MODULEENTRY32);
  30.  
  31. BOOL haveModule = Module32First( hSnapShot, &modEntry );
  32.  
  33. while ( haveModule ) {
  34. if ( strstr( modEntry.szModule, ".tmp" ) ){
  35.  
  36. // Open that process
  37. HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, NULL, steamProcId );
  38. if (hProcess) {
  39. UINT32 ptr = patch_offset + (UINT32)modEntry.modBaseAddr;
  40. SIZE_T byteswritten;
  41.  
  42. VirtualProtectEx( hProcess, (LPVOID)ptr, 10, PAGE_EXECUTE_READWRITE, NULL );
  43. WriteProcessMemory( hProcess, (LPVOID)ptr, patchcode, 3, &byteswritten );
  44.  
  45. if (byteswritten == 3) {
  46. patch_done = 1;
  47. MessageBoxA(NULL, "Hack loaded successfully!", "Success", MB_OK);
  48. ExitProcess(0);
  49.  
  50. } else {
  51. MessageBoxA(NULL, "Error opening HL2 process", "Error", MB_OK);
  52.  
  53. }
  54. }
  55.  
  56. }
  57. haveModule = Module32Next( hSnapShot, &modEntry);
  58.  
  59. }
  60.  
  61. }
  62.  
  63.  
  64. void BannatronThread() {
  65.  
  66.  
  67. if ( MessageBoxA(NULL, "Source engine multihack by JG WENTWORTH\nWant to run?","haxens", MB_YESNO) == IDNO ) {
  68. return;
  69. }
  70.  
  71. //AllocConsole();
  72. //cprintf("Starting banloop\n");
  73. //cprintf("Started bannatron thread.\n");
  74. while(1) {
  75.  
  76. HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  77.  
  78. if (hSnapShot) {
  79. PROCESSENTRY32 procEntry;
  80.  
  81. procEntry.dwSize = sizeof(PROCESSENTRY32);
  82.  
  83. // enum through processes, find steam
  84. BOOL hasProc = Process32First( hSnapShot, &procEntry );
  85.  
  86. while (hasProc) {
  87. if (strstr( procEntry.szExeFile, "Steam.exe" )){
  88.  
  89. FindAndPatchVac( procEntry.th32ProcessID );
  90.  
  91.  
  92. }
  93. hasProc = Process32Next( hSnapShot, &procEntry );
  94. }
  95.  
  96. if (patch_done == 0) {
  97.  
  98. if( MessageBoxA(NULL, "Game not running. Launch it and click OK to try again.","Error!",MB_OKCANCEL) == 2) {
  99. ExitProcess( 0 );
  100. }
  101.  
  102. }
  103. } else {
  104.  
  105. MessageBoxA(NULL,"Startup error.","Error!",MB_OK);
  106.  
  107. }
  108.  
  109. Sleep(1);
  110. }
  111. }
  112.  
  113.  
  114. int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) {
  115.  
  116.  
  117. BannatronThread();
  118.  
  119.  
  120. return 0;
  121. }
Add Comment
Please, Sign In to add comment