-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGameRenderer.cpp
More file actions
38 lines (28 loc) · 871 Bytes
/
GameRenderer.cpp
File metadata and controls
38 lines (28 loc) · 871 Bytes
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
/**
* Rainbow Six: Siege SDK
* Copyright (C) 2017 RangeMachine
*/
#include <windows.h>
#include "GameRenderer.h"
#include "Offsets.h"
#include "Memory.h"
namespace Engine
{
Camera* GameRenderer::GetCamera()
{
if (!Memory::IsValidPtr<GameRenderer>(this))
return nullptr;
auto pGameRenderer = *Memory::Ptr<void**>(this, (0x0));
auto pEngineLink = *Memory::Ptr<void**>(pGameRenderer, (OFFSET_GAMERENDERER_ENGINELINK));
if (!Memory::IsValidPtr(pEngineLink))
return nullptr;
auto pEngine = *Memory::Ptr<void**>(pEngineLink, (OFFSET_ENGINELINK_ENGINE));
if (!Memory::IsValidPtr(pEngine))
return nullptr;
return *Memory::Ptr<Camera**>(pEngine, (OFFSET_ENGINE_CAMERA));
}
GameRenderer* GameRenderer::GetInstance()
{
return *reinterpret_cast<GameRenderer**>(ADDRESS_GAMERENDERER + reinterpret_cast<uint64_t>(GetModuleHandle(NULL)));
}
}