Advertisement
GK-Chubbz

Hookless Mouse Fly

May 16th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.43 KB | None | 0 0
  1. #define Padding(x) struct { unsigned char __padding##x[(x)]; };
  2.  
  3. struct CUserLocal
  4. {
  5.     Padding(0x5E5C); //char vector/char pid
  6.     void* lpvPID;
  7. };
  8.  
  9. struct Location
  10. {
  11.     Padding(0x98); //mouse x
  12.     int x; //0x98
  13.     int y; //0x9C
  14. };
  15.  
  16. struct CWndMan
  17. {
  18.     Padding(0x0978); //mouse location
  19.     Location* pLocation;
  20.     Padding(0x0104); //animation - location - 4
  21.     DWORD dwDlag;
  22. };
  23.  
  24. CUserLocal*(__cdecl* TSingleton_CUserLocal_GetInstance)() = NULL;
  25. CWndMan*(__cdecl* TSingleton_CWndMan_GetInstance)() = NULL;
  26.  
  27. void(__fastcall* CUserLocal__IsTeleportSkillAvailable)(void* lpvEcx, void* lpvEdx, void* lpvPID, int x, int y) = NULL;
  28.  
  29. namespace Function
  30. {
  31.     void Teleport(int x, int y)
  32.     {
  33.         void* PID = TSingleton_CUserLocal_GetInstance()->lpvPID;
  34.        
  35.         return CUserLocal_IsTeleportSkillAvailable(0, 0, PID, x, y);
  36.     }
  37.  
  38.     void MouseFly(bool dragCheck)
  39.     {
  40.         Location *location = reinterpret_cast<Location*>(reinterpret_cast<PBYTE*>(TSingleton_CWndMan_GetInstance()->pLocation));
  41.         int x = location->x;
  42.         int y = location->y;
  43.  
  44.         if (!dragCheck) //no drag
  45.             return Teleport(x, y);
  46.         else
  47.         {
  48.             DWORD drag = TSingleton_CWndMan_GetInstance()->dwDlag;
  49.            
  50.             if (drag == 0xC)
  51.                 return Teleport(x, y);
  52.         }
  53.     }
  54. }
  55.  
  56. void GetData()
  57. {
  58.     *(void**)&TSingleton_CUserLocal_GetInstance = reinterpret_cast<void*>(0x004AEDB0); //
  59.     *(void**)&TSingleton_CWndMan_GetInstance = reinterpret_cast<void*>(0x004AF6D0); //
  60.  
  61.     *(void**)&CUserLocal_IsTeleportSkillAvailable = reinterpret_cast<void*>(0x01763BE0); //
  62. }
  63.  
  64. //C++/CLI
  65. static int iMouseFly_delay = 100; //100ms
  66.  
  67. //CheckBox
  68. System::Void GUIm::cbMouseFly_CheckedChanged(System::Object^  sender, System::EventArgs^  e)
  69. {
  70.     if (cbMouseFly->Checked)
  71.     {
  72.         tmrMouseFly->Interval = iMouseFly_delay;
  73.         tmrMouseFly->Start();
  74.     }
  75.     else tmrMouseFly->Stop();
  76. }
  77.  
  78. //NumericUpDown
  79. System::Void GUIm::txtMouseFlyDelay_ValueChanged(System::Object^  sender, System::EventArgs^  e)
  80. {
  81.     if (System::Convert::ToInt32(txtMouseFlyDelay->Value) < 1)
  82.         txtMouseFlyDelay->Value = 1;
  83.  
  84.     iMouseFly_delay = System::Convert::ToInt32(txtMouseFlyDelay->Value);
  85. }
  86.  
  87. //Timer
  88. System::Void GUIm::tmrMouseFly_Tick(System::Object^  sender, System::EventArgs^  e)
  89. {
  90.     static bool dragcheck;
  91.    
  92.     if (cbMouseFlyDragCheck->CheckState == CheckState::Checked)
  93.         dragcheck = true;
  94.     else dragcheck = false;
  95.  
  96.     Function::MouseFly(dragcheck);
  97. }
  98.  
  99. //Function::MouseFly(true) //teleport on click
  100. //Function::MouseFly(false) //teleport on mouse coords
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement