2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
|
|
|
#pragma message("Pre-compiling headers.\n")
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN // Prevent winsock2 redefinition.
|
|
|
|
#include <windows.h>
|
|
|
|
#include <WinSock2.h>
|
2022-03-04 12:22:17 +01:00
|
|
|
#include <comdef.h>
|
2022-05-24 02:23:37 +02:00
|
|
|
#include <gdiplus.h>
|
|
|
|
#include <shellapi.h>
|
|
|
|
#include <Psapi.h>
|
2022-04-12 02:48:46 +02:00
|
|
|
#include <setjmp.h>
|
2022-03-21 23:13:03 +01:00
|
|
|
#include <tchar.h>
|
2021-12-25 22:36:38 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <shlobj.h>
|
|
|
|
#include <objbase.h>
|
2022-03-21 23:13:03 +01:00
|
|
|
#include <intrin.h>
|
2021-12-25 22:36:38 +01:00
|
|
|
#include <emmintrin.h>
|
|
|
|
#include <cmath>
|
2022-04-10 19:59:34 +02:00
|
|
|
#include <regex>
|
2021-12-25 22:36:38 +01:00
|
|
|
#include <thread>
|
2022-03-21 23:13:03 +01:00
|
|
|
#include <vector>
|
2021-12-25 22:36:38 +01:00
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <iomanip>
|
|
|
|
#include <cassert>
|
|
|
|
#include <filesystem>
|
|
|
|
|
2022-02-06 16:48:52 +01:00
|
|
|
#if !defined(DEDICATED) && !defined(SDKLAUNCHER) && !defined (NETCONSOLE)
|
2021-12-25 22:36:38 +01:00
|
|
|
#include <d3d11.h>
|
2022-02-06 16:48:52 +01:00
|
|
|
#endif // !DEDICATED && !SDKLAUNCHER && !NETCONSOLE
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-05-03 17:28:17 +02:00
|
|
|
#include "thirdparty/nlohmann/json.hpp"
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "thirdparty/detours/include/detours.h"
|
|
|
|
#include "thirdparty/detours/include/idetour.h"
|
|
|
|
|
2022-05-24 02:23:37 +02:00
|
|
|
#if defined(SDKLAUNCHER)
|
|
|
|
#include "thirdparty/cppnet/cppkore/Kore.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXTheme.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXLabel.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXListView.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXCheckBox.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXComboBox.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXTextBox.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXGroupBox.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXButton.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/UIXRadioButton.h"
|
|
|
|
#include "thirdparty/cppnet/cppkore/KoreTheme.h"
|
|
|
|
#endif // SDKLAUNCHER
|
|
|
|
|
2022-02-06 16:48:52 +01:00
|
|
|
#if !defined(DEDICATED) && !defined(SDKLAUNCHER) && !defined (NETCONSOLE)
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "thirdparty/imgui/include/imgui.h"
|
|
|
|
#include "thirdparty/imgui/include/imgui_stdlib.h"
|
2022-01-18 11:23:14 +01:00
|
|
|
#include "thirdparty/imgui/include/imgui_utility.h"
|
|
|
|
#include "thirdparty/imgui/include/imgui_internal.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "thirdparty/imgui/include/imgui_impl_dx11.h"
|
|
|
|
#include "thirdparty/imgui/include/imgui_impl_win32.h"
|
2022-02-06 16:48:52 +01:00
|
|
|
#endif // !DEDICATED && !SDKLAUNCHER && !NETCONSOLE
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-02-06 16:48:52 +01:00
|
|
|
#if !defined(SDKLAUNCHER) && !defined (NETCONSOLE)
|
2022-01-06 15:08:39 +01:00
|
|
|
#include "thirdparty/lzham/include/lzham_types.h"
|
|
|
|
#include "thirdparty/lzham/include/lzham.h"
|
2022-02-06 16:48:52 +01:00
|
|
|
#endif // !SDKLAUNCHER && !NETCONSOLE
|
2022-01-06 15:08:39 +01:00
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "thirdparty/spdlog/include/spdlog.h"
|
2022-01-14 15:38:48 +01:00
|
|
|
#include "thirdparty/spdlog/include/async.h"
|
|
|
|
#include "thirdparty/spdlog/include/sinks/ostream_sink.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "thirdparty/spdlog/include/sinks/basic_file_sink.h"
|
|
|
|
#include "thirdparty/spdlog/include/sinks/stdout_sinks.h"
|
2022-01-14 15:38:48 +01:00
|
|
|
#include "thirdparty/spdlog/include/sinks/stdout_color_sinks.h"
|
|
|
|
#include "thirdparty/spdlog/include/sinks/ansicolor_sink.h"
|
|
|
|
#include "thirdparty/spdlog/include/sinks/rotating_file_sink.h"
|
|
|
|
|
2022-04-10 19:59:34 +02:00
|
|
|
#include "common/pseudodefs.h"
|
|
|
|
#include "common/x86defs.h"
|
|
|
|
#include "common/sdkdefs.h"
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "public/include/utility.h"
|
|
|
|
#include "public/include/memaddr.h"
|
2022-04-10 19:59:34 +02:00
|
|
|
#include "public/include/module.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "public/include/httplib.h"
|
2022-05-26 01:44:46 +02:00
|
|
|
#include "public/include/vdf_parser.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-01-14 15:38:48 +01:00
|
|
|
#include "core/assert.h"
|
2022-01-26 23:48:52 +01:00
|
|
|
#include "core/termutil.h"
|
2022-01-16 01:18:36 +01:00
|
|
|
#include "tier0/basetypes.h"
|
2022-03-21 23:13:03 +01:00
|
|
|
#include "tier0/platform.h"
|
2022-05-26 01:44:46 +02:00
|
|
|
#if !defined(SDKLAUNCHER) && !defined (NETCONSOLE)
|
2022-05-25 14:18:29 +02:00
|
|
|
#include "tier0/dbg.h"
|
2022-05-26 01:44:46 +02:00
|
|
|
#endif // !SDKLAUNCHER && !NETCONSOLE
|
2022-04-02 02:48:54 +02:00
|
|
|
|
2022-02-06 16:48:52 +01:00
|
|
|
#if !defined(SDKLAUNCHER) && !defined (NETCONSOLE)
|
2022-01-14 15:38:48 +01:00
|
|
|
#if !defined (DEDICATED)
|
2022-04-10 19:59:34 +02:00
|
|
|
inline CModule g_mGameDll = CModule("r5apex.exe");
|
|
|
|
inline CModule g_mRadVideoToolsDll = CModule("bink2w64.dll");
|
|
|
|
inline CModule g_mRadAudioDecoderDll = CModule("binkawin64.dll");
|
|
|
|
inline CModule g_mRadAudioSystemDll = CModule("mileswin64.dll");
|
2022-02-23 21:03:06 +01:00
|
|
|
#else // No DirectX and Miles imports.
|
2022-04-10 19:59:34 +02:00
|
|
|
inline CModule g_mGameDll = CModule("r5apex_ds.exe");
|
2022-02-23 21:03:06 +01:00
|
|
|
#endif // !DEDICATED
|
2022-04-09 02:18:57 +02:00
|
|
|
|
2022-04-09 00:59:42 +02:00
|
|
|
#define VAR_NAME(varName) #varName
|
2022-01-23 18:26:48 +01:00
|
|
|
|
2022-02-06 16:48:52 +01:00
|
|
|
#define MEMBER_AT_OFFSET(varType, varName, offset) \
|
|
|
|
varType& varName() \
|
|
|
|
{ \
|
|
|
|
static int _##varName = offset; \
|
2022-01-23 18:26:48 +01:00
|
|
|
return *(varType*)((std::uintptr_t)this + _##varName); \
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename ReturnType, typename ...Args>
|
|
|
|
ReturnType CallVFunc(int index, void* thisPtr, Args... args)
|
|
|
|
{
|
|
|
|
return (*reinterpret_cast<ReturnType(__fastcall***)(void*, Args...)>(thisPtr))[index](thisPtr, args...);
|
2022-02-06 16:48:52 +01:00
|
|
|
}
|
|
|
|
#endif // !SDKLAUNCHER && !NETCONSOLE
|