Advertisement
Hydrox

Untitled

Mar 18th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. #include <Windows.h>
  2. //Internal shitzz=======================================
  3. typedef void* (*CreateInterfaceFn)(const char*, int*);
  4. template<typename T>
  5. T CallVirtualFunction(void* table, int index) {
  6. return (*(T**)table)[index];
  7. }
  8. class IVEngineClient
  9. {
  10. public:
  11. void GetScreenSize(int& width,int& height)
  12. {
  13. typedef void(__thiscall* GetScreenSizeFn)(void*, int&, int&);
  14. return CallVirtualFunction<GetScreenSizeFn>(this, 5)(this, width, height);
  15. }
  16. void ClientCmd(const char* szCommandString)
  17. {
  18. typedef void(__thiscall* ClientCmdFn)(void*, const char*);
  19. return CallVirtualFunction<ClientCmdFn>(this, 7)(this, szCommandString);
  20. }
  21. int GetMaxClients()
  22. {
  23. typedef int(__thiscall* GetMaxClientsFn)(void*);
  24. return CallVirtualFunction<GetMaxClientsFn>(this, 20)(this);
  25. }
  26.  
  27. bool IsInGame()
  28. {
  29. typedef bool(__thiscall* IsInGameFn)(void*);
  30. return CallVirtualFunction<IsInGameFn>(this, 26)(this);
  31. }
  32.  
  33. bool IsConnected()
  34. {
  35. typedef bool(__thiscall* IsConnectedFn)(void*);
  36. return CallVirtualFunction<IsConnectedFn>(this, 27)(this);
  37. }
  38. };
  39. //======================================================
  40.  
  41. void main() { //Hier kommt dann der hackie stuff rein
  42. CreateInterfaceFn EngineFactory = reinterpret_cast<CreateInterfaceFn>(GetProcAddress(GetModuleHandleA("engine.dll"), "CreateInterface"));
  43. IVEngineClient* Engine = Engine = static_cast<IVEngineClient*>(EngineFactory("VEngineClient014", nullptr)); // VEngineClient013
  44. while (true)
  45. {
  46. if (Engine->IsInGame() && Engine->IsConnected())
  47. {
  48. static int lasttime = 0;
  49. if (GetTickCount() - lasttime > 300) {
  50. Engine->ClientCmd("say Hydr0xHook");
  51. lasttime = GetTickCount();
  52. }
  53. }
  54. }
  55. }
  56.  
  57. //DllMain wird gecallt wenn die dll injected wird
  58. bool __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  59. {
  60. if (dwReason == DLL_PROCESS_ATTACH) // Wenn der cheat attacht wird wird "main()" ausgeführt
  61. {
  62. Beep(750, 100); //Beep geräusch wenn wir injecten
  63. DisableThreadLibraryCalls(hInstance);
  64. CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)main, hInstance, 0, nullptr);
  65. }
  66. return true;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement