Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- //Internal shitzz=======================================
- typedef void* (*CreateInterfaceFn)(const char*, int*);
- template<typename T>
- T CallVirtualFunction(void* table, int index) {
- return (*(T**)table)[index];
- }
- class IVEngineClient
- {
- public:
- void GetScreenSize(int& width,int& height)
- {
- typedef void(__thiscall* GetScreenSizeFn)(void*, int&, int&);
- return CallVirtualFunction<GetScreenSizeFn>(this, 5)(this, width, height);
- }
- void ClientCmd(const char* szCommandString)
- {
- typedef void(__thiscall* ClientCmdFn)(void*, const char*);
- return CallVirtualFunction<ClientCmdFn>(this, 7)(this, szCommandString);
- }
- int GetMaxClients()
- {
- typedef int(__thiscall* GetMaxClientsFn)(void*);
- return CallVirtualFunction<GetMaxClientsFn>(this, 20)(this);
- }
- bool IsInGame()
- {
- typedef bool(__thiscall* IsInGameFn)(void*);
- return CallVirtualFunction<IsInGameFn>(this, 26)(this);
- }
- bool IsConnected()
- {
- typedef bool(__thiscall* IsConnectedFn)(void*);
- return CallVirtualFunction<IsConnectedFn>(this, 27)(this);
- }
- };
- //======================================================
- void main() { //Hier kommt dann der hackie stuff rein
- CreateInterfaceFn EngineFactory = reinterpret_cast<CreateInterfaceFn>(GetProcAddress(GetModuleHandleA("engine.dll"), "CreateInterface"));
- IVEngineClient* Engine = Engine = static_cast<IVEngineClient*>(EngineFactory("VEngineClient014", nullptr)); // VEngineClient013
- while (true)
- {
- if (Engine->IsInGame() && Engine->IsConnected())
- {
- static int lasttime = 0;
- if (GetTickCount() - lasttime > 300) {
- Engine->ClientCmd("say Hydr0xHook");
- lasttime = GetTickCount();
- }
- }
- }
- }
- //DllMain wird gecallt wenn die dll injected wird
- bool __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
- {
- if (dwReason == DLL_PROCESS_ATTACH) // Wenn der cheat attacht wird wird "main()" ausgeführt
- {
- Beep(750, 100); //Beep geräusch wenn wir injecten
- DisableThreadLibraryCalls(hInstance);
- CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)main, hInstance, 0, nullptr);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement