Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.01 KB | None | 0 0
  1. #include <windows.h>
  2. #define dwpLTClient 0x377F4930
  3.  
  4. DWORD posptr;
  5. DWORD posy;
  6. DWORD playertarget;
  7. DWORD nom;
  8. DWORD pos;
  9. DWORD teleloc;
  10. DWORD hD3D, adr, *vtbl;
  11. bool Compare(const BYTE* pData, const BYTE* bMask, const char* szMask)
  12. {
  13.     for(;*szMask;++szMask,++pData,++bMask)
  14.         if(*szMask=='x' && *pData!=*bMask)   return 0;
  15.     return (*szMask) == NULL;
  16. }
  17.  
  18. DWORD Findpattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
  19. {
  20.     for(DWORD i=0; i<dwLen; i++)
  21.         if (Compare((BYTE*)(dwAddress+i),bMask,szMask))  return (DWORD)(dwAddress+i);
  22.     return 0;
  23. }
  24. bool IsGameReadyForHook()
  25. {
  26. if( GetModuleHandleA( "d3d9.dll" ) != NULL
  27. && GetModuleHandleA( "ClientFX.fxd" ) != NULL
  28. && GetModuleHandleA( "CShell.dll" ) != NULL )
  29. return true;
  30. return false;
  31. }
  32.  
  33.  
  34. bool memoria( void * pDest, char * szPatch, size_t sSize ) //Nopping Method
  35. {
  36.     DWORD dwOrgProtect = NULL;
  37.     if ( !VirtualProtect ( pDest, sSize, PAGE_EXECUTE_READWRITE, &dwOrgProtect ))
  38.         return FALSE;
  39.  
  40.     memcpy( pDest, szPatch, sSize );
  41.     VirtualProtect( pDest, sSize, dwOrgProtect, NULL );
  42.     return TRUE;
  43. }
  44. DWORD Status;
  45. DWORD superbullets;
  46. DWORD NoCoilAddy1;
  47. DWORD NoCoilAddy2;
  48. DWORD NoCoilAddy3;
  49. DWORD NoCoilAddy4;
  50. DWORD NoCoilAddy5;
  51. DWORD RPP;
  52.  
  53. void GetAddresses (void)
  54. {
  55.     superbullets = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0xFFFFFF, (PBYTE)"\x0F\x94\xC0\x5E\xC3\xCC\xCC\xCC\xCC\xCC", "xxxxxxxxxx");
  56. NoCoilAddy1 = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x900000, (PBYTE)"\xD8\x66\x54\xD9\x5C\x24\x14\xD9\x44\x24\x14\xEB\x02", "xxxxxxxxxxxxx?");
  57. NoCoilAddy2 = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x900000, (PBYTE)"\xC7\x84\x24\x00\x00\x00\x00\x00\x00\x00\x00\x89\xBC\x24\x00\x00\x00\x00\xC6\x84\x24\x00\x00\x00\x00\x00\x39\x74\x24\x78", "xxx????????xxx????xxx?????xxxx");
  58. NoCoilAddy3 = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x900000, (PBYTE)"\xD9\x5E\x54\xD9\x46\x48\xD9\xC9\xDC\xC0\xDE\xE9", "xxxxxxxxxxxx");
  59. NoCoilAddy4 = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x900000, (PBYTE)"\xD9\x46\x48\xD9\xC9\xDC\xC0\xDE\xE9", "xxxxxxxxx");
  60. NoCoilAddy5 = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x900000, (PBYTE)"\xD9\x5E\x48\xE8\x00\x00\x00\x00\x90", "xxxx????x");
  61. RPP = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x91F000, (PBYTE)"\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\x00\x00\xFF\xFF", "xxxxxxxxxxxxxx");
  62.  
  63.     Status = Findpattern((DWORD)GetModuleHandleA("CShell.dll"), 0x97D000, (PBYTE)"\x71\x37\x50\x94\x71\x37", "xxxxxx");
  64.     if(Status)
  65.     {
  66.         Status -= 0xA;
  67.     }
  68. }
  69. void __cdecl PTC( const char* szCommand )
  70. {
  71.     if( !eng.IsReady || dwpLTClient == NULL )
  72.         return;
  73.  
  74.     DWORD dwConsoleFunc = *( DWORD* )( dwpLTClient + 0x208 );
  75.     DWORD dwRealCallA    = ( dwConsoleFunc + 0x26 );//JMP to real func
  76.     DWORD dwRealCallB    = *(DWORD*)( dwRealCallA + 0x1 );
  77.     DWORD dwRealCall    = ( dwRealCallA + dwRealCallB + 0x5 );
  78.  
  79.     if( *(BYTE*)dwRealCallA == 0xE9 )
  80.         dwConsoleFunc = dwRealCall;
  81.  
  82.     __asm
  83.     {
  84.         push szCommand;
  85.         call dwConsoleFunc;
  86.         add esp, 4;
  87.     }
  88. }
  89. void main()
  90.  
  91. {
  92.     while(true)
  93.     {
  94.  
  95.    
  96.             PushToConsole("PerturbRotationEffect  0.000000" );
  97.            
  98. PushToConsole("PerturbIncreaseSpeed 0.000000" );
  99.  
  100. PushToConsole("PerturbWalkPercent 0.000000" );
  101.  
  102. PushToConsole("PerturbFiringIncreaseSpeed 0.000000" );
  103.  
  104. PushToConsole("PerturbRecoil 0.000000" );
  105.  
  106. PushToConsole("FireMovePerturb 0.000000" );
  107.  
  108. PushToConsole("ZoomedFireMoveDuckPerturb 0.000000" );
  109.  
  110. PushToConsole("ZoomedFireMovePerturb 0.000000" );
  111.  
  112. PushToConsole("ZoomedFireDuckPerturb 0.000000" );
  113.  
  114.  
  115.  
  116.             Sleep(500);
  117.  
  118.     }}
  119.  
  120. DWORD WINAPI dwHackThread(LPVOID) {
  121. while( !IsGameReadyForHook() )
  122. Sleep(200);
  123. main();
  124.  
  125. return 0;
  126. }
  127. BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
  128. {
  129. DisableThreadLibraryCalls(hDll);
  130. if ( dwReason == DLL_PROCESS_ATTACH )
  131.                 CreateThread(NULL,NULL,dwHackThread,NULL,NULL,NULL);
  132.    
  133. {              
  134. }
  135. return TRUE;
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement