-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathGlobal.cpp
53 lines (46 loc) · 1.39 KB
/
Global.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "Global.h"
#include "kiero.h"
#include "stdafx.h"
#include "imgui/imgui.h"
#include "imgui/imgui_impl_dx12.h"
#include "imgui/imgui_impl_win32.h"
#include <dxgi.h>
#include <d3d12.h>
DWORD64 OFFSET_RefDef = 0x10768428;
DWORD64 OFFSET_LocalPlayer = 0x10773280;
namespace Globals
{
DWORD64 pGameBase = NULL;
HANDLE hWindow = NULL;
HMODULE hMainModule = NULL;
Camera* pRefDef;
Camera* GetRefDef()
{
return (Camera*)*(uintptr_t*)(Globals::pGameBase + OFFSET_RefDef);
}
uint64_t GetLocalPlayer()
{
return *(uint64_t*)(Globals::pGameBase + OFFSET_LocalPlayer);
}
Vector GetLocalPlayerPos()
{
return *(const Vector*)(Globals::GetLocalPlayer() + 0x30);
}
bool IsLocalAlive()
{
auto pLocal = Globals::GetLocalPlayer();
auto vLocalPos = *(const Vector*)(pLocal + 0x30);
return !(vLocalPos.x == 0);
}
void HooksInit()
{
if (kiero::init(kiero::RenderType::D3D12) == kiero::Status::Success)
{
kiero::bind(54, (void**)&d3d12hook::oExecuteCommandListsD3D12, d3d12hook::hookExecuteCommandListsD3D12);
kiero::bind(58, (void**)&d3d12hook::oSignalD3D12, d3d12hook::hookSignalD3D12);
kiero::bind(140, (void**)&d3d12hook::oPresentD3D12, d3d12hook::hookPresentD3D12);
kiero::bind(84, (void**)&d3d12hook::oDrawInstancedD3D12, d3d12hook::hookkDrawInstancedD3D12);
kiero::bind(85, (void**)&d3d12hook::oDrawIndexedInstancedD3D12, d3d12hook::hookDrawIndexedInstancedD3D12);
}
}
}