Advertisement
Guest User

0pc0d3R

a guest
Jun 27th, 2015
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.34 KB | None | 0 0
  1. // Camera Stealer v1.1 (0.3.7) SF 5.2
  2. // Ворует интро-камеру сервера (Как статичную так и летающую)
  3. // Credits by 0pc0d3R
  4. // Specially for BlastHack.Net
  5. #include <windows.h>
  6. #include <string>
  7. #include <assert.h>
  8. #include <process.h>
  9. #include "SAMPFUNCS_API.h"
  10. #include "game_api\game_api.h"
  11. #pragma warning (disable:4700)
  12. #pragma warning (disable:4244)
  13. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  14. SAMPFUNCS *SF = new SAMPFUNCS();
  15. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  16. bool __stdcall HookedRPC(stRakNetHookParams *hook)
  17. {
  18.     if (hook->packetId == ScriptRPCEnumeration::RPC_ScrSetPlayerCameraPos)
  19.     {
  20.         hook->bitStream->ResetReadPointer();
  21.         float cpos[3];
  22.         hook->bitStream->Read(cpos[0]);
  23.         hook->bitStream->Read(cpos[1]);
  24.         hook->bitStream->Read(cpos[2]);
  25.         hook->bitStream->ResetReadPointer();
  26.         SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 139, 61),
  27.         "SetPlayerCameraPos(playerid, %f, %f, %f);", cpos[0], cpos[1], cpos[2]);
  28.     }
  29.     if (hook->packetId == ScriptRPCEnumeration::RPC_ScrSetPlayerCameraLookAt)
  30.     {
  31.         hook->bitStream->ResetReadPointer();
  32.         float cpos[3];
  33.         hook->bitStream->Read(cpos[0]);
  34.         hook->bitStream->Read(cpos[1]);
  35.         hook->bitStream->Read(cpos[2]);
  36.         hook->bitStream->ResetReadPointer();
  37.         SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 153, 102),
  38.         "SetPlayerCameraLookAt(playerid, %f, %f, %f);", cpos[0], cpos[1], cpos[2]);
  39.     }
  40.     if (hook->packetId == ScriptRPCEnumeration::RPC_ScrInterpolateCamera)
  41.     {
  42.         float cpos[6]; int cinterval;
  43.         BitStream bsData(hook->bitStream->GetData(), hook->bitStream->GetNumberOfBitsUsed() / 8, false);
  44.         bool variator; bsData.Read(variator);
  45.         bsData.Read(cpos[0]); bsData.Read(cpos[1]); bsData.Read(cpos[2]);
  46.         bsData.Read(cpos[3]); bsData.Read(cpos[4]); bsData.Read(cpos[5]);
  47.         bsData.Read(cinterval);
  48.         if (variator ? true : false) SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(0, 153, 255),
  49.         "InterpolateCameraPos(playerid, %f, %f, %f, %f, %f, %f, %d);",
  50.         cpos[0], cpos[1], cpos[2], cpos[3], cpos[4], cpos[5], cinterval);
  51.         else SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(61, 177, 255),
  52.         "InterpolateCameraLookAt(playerid, %f, %f, %f, %f, %f, %f, %d);",
  53.         cpos[0], cpos[1], cpos[2], cpos[3], cpos[4], cpos[5], cinterval);
  54.     }
  55.     return true;
  56. }
  57. ////////////////////////////////////////////////////////////////////////////////////////////////////
  58. void __stdcall mainloop( void )
  59. {
  60.     static bool init = false;
  61.     if( !init )
  62.     {
  63.         if( !SF->getSAMP()->IsInitialized() ) return;
  64.         if (GAME == nullptr) return;
  65.         SF->getRakNet()->registerRakNetCallback(RakNetScriptHookType::RAKHOOK_TYPE_INCOMING_RPC, HookedRPC);
  66.         SF->getSAMP()->getChat()->AddChatMessage( D3DCOLOR_XRGB( 153, 255, 0 ),
  67.         "CamStealer v1.1 by {FF001A}0pc0d3R");
  68.         init = true;
  69.     }
  70. }
  71. ////////////////////////////////////////////////////////////////////////////////////////////////////
  72. bool WINAPI DllMain( HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved )
  73. {/////
  74.     switch ( dwReasonForCall )
  75.     {
  76.     case DLL_PROCESS_ATTACH:    
  77.         SF->initPlugin( mainloop, hModule );
  78.         break;
  79.     case DLL_THREAD_ATTACH:
  80.     case DLL_THREAD_DETACH:
  81.     case DLL_PROCESS_DETACH:  
  82.         break;
  83.     }
  84.     return TRUE;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement