Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "KeInterface.h"
- using namespace std;
- #define VK_FOV_RESET VK_NUMPAD7
- #define VK_FOV_INCREMENT 0x54
- #define VK_FOV_DECREMENT 0x59
- #define VK_BHOP_JUMP VK_SPACE
- #define VK_PRINT_OFFSETS VK_NUMPAD9
- KeInterface mm("\\\\.\\kernelhop");
- DWORD pid = mm.GetTargetPid();
- DWORD a_clientDll = mm.GetClientModule();
- DWORD a_pLocalPlayer = a_clientDll + 0xAA8FDC;
- void MmWrite(DWORD address, DWORD value)
- {
- mm.WriteVirtualMemory(pid, address, value, sizeof(value));
- }
- template <class T> T MmRead(DWORD address)
- {
- return mm.ReadVirtualMemory<T>(pid, address, sizeof(T));
- }
- DWORD a_localPlayer()
- {
- return MmRead<DWORD>(a_pLocalPlayer);
- }
- void PrintOffsets()
- {
- cout << "Debug information:" << endl;
- cout << "a_clientDll: 0x" << hex << a_clientDll << endl;
- cout << "a_pLocalPlayer 0x" << hex << a_pLocalPlayer << endl;
- cout << "a_localPlayer: 0x" << hex << a_localPlayer() << endl;
- }
- bool IsOnGround()
- {
- return MmRead<DWORD>(a_localPlayer() + 0x014C) != -1;
- }
- void Jump()
- {
- if (a_localPlayer() != 0x0)
- {
- MmWrite(a_clientDll + 0x4F1C354, 5);
- Sleep(50);
- MmWrite(a_clientDll + 0x4F1C354, 4);
- cout << "Jumping..." << endl;
- }
- }
- class FOV
- {
- DWORD Value;
- DWORD DefaultValue = 120;
- DWORD a_m_iFOV()
- {
- return a_localPlayer() + 0x31D4;
- };
- DWORD a_m_iFOVStart()
- {
- return a_localPlayer() + 0x31D8;
- };
- DWORD a_m_iFOVDefault()
- {
- return a_localPlayer() + 0x332C;
- };
- void Set(DWORD fov)
- {
- if (fov >= 10 && fov <= 150 && a_localPlayer() != 0x0)
- {
- cout << "Setting FOV: " << fov << endl;
- Value = fov;
- MmWrite(a_m_iFOVDefault(), fov);
- }
- }
- public:
- DWORD Step;
- FOV(DWORD step = 20)
- {
- Reset();
- Step = step;
- }
- void Reset()
- {
- Set(DefaultValue);
- }
- DWORD operator =(DWORD fov)
- {
- Set(fov);
- return Value;
- }
- DWORD operator ++(int)
- {
- Set(Value + Step);
- return Value;
- }
- DWORD operator --(int)
- {
- Set(Value - Step);
- return Value;
- }
- operator DWORD()
- {
- return Value;
- }
- };
- int main()
- {
- cout << "Hack has started\n";
- FOV fov;
- while (true)
- {
- if (GetAsyncKeyState(VK_FOV_INCREMENT))
- {
- fov ++;
- Sleep(200);
- }
- if (GetAsyncKeyState(VK_FOV_DECREMENT))
- {
- fov --;
- Sleep(200);
- }
- if (GetAsyncKeyState(VK_FOV_RESET))
- {
- fov.Reset();
- Sleep(200);
- }
- if (GetAsyncKeyState(VK_BHOP_JUMP))
- {
- if (IsOnGround())
- {
- Jump();
- }
- }
- if (GetAsyncKeyState(VK_PRINT_OFFSETS))
- {
- PrintOffsets();
- Sleep(200);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement