2017-01-19 16:23:59 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Version number
|
|
|
|
#include "version.h"
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
2021-04-01 09:11:39 -04:00
|
|
|
//#define _HAS_CXX17 1
|
|
|
|
//#define _HAS_CXX20 1
|
2017-01-19 16:23:59 -05:00
|
|
|
#define VC_EXTRALEAN
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2018-07-17 08:30:29 -04:00
|
|
|
#define _CRT_SECURE_NO_WARNINGS
|
2021-08-25 13:59:55 -04:00
|
|
|
#define _USE_MATH_DEFINES
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2017-01-22 14:12:15 -05:00
|
|
|
// Requires Visual Leak Detector plugin: http://vld.codeplex.com/
|
2017-06-02 09:36:20 -04:00
|
|
|
#define VLD_FORCE_ENABLE
|
2017-01-22 14:12:15 -05:00
|
|
|
//#include <vld.h>
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
#include <windows.h>
|
|
|
|
#include <timeapi.h>
|
|
|
|
#include <shellapi.h>
|
|
|
|
#include <Wininet.h>
|
|
|
|
#include <d3d9.h>
|
|
|
|
#include <Aclapi.h>
|
2017-01-30 11:47:29 -05:00
|
|
|
#include <Psapi.h>
|
2017-03-04 07:51:41 -05:00
|
|
|
#include <tlhelp32.h>
|
2017-06-07 05:22:38 -04:00
|
|
|
#include <Shlwapi.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2017-03-13 16:50:42 -04:00
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable: 4091)
|
2017-04-28 08:18:28 -04:00
|
|
|
#pragma warning(disable: 4244)
|
2017-03-13 16:50:42 -04:00
|
|
|
#include <dbghelp.h>
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
#include <sstream>
|
|
|
|
#include <fstream>
|
|
|
|
#include <cctype>
|
|
|
|
#include <regex>
|
|
|
|
#include <thread>
|
|
|
|
#include <future>
|
|
|
|
#include <unordered_map>
|
2017-01-28 13:03:44 -05:00
|
|
|
#include <queue>
|
2021-04-04 12:04:28 -04:00
|
|
|
#include <algorithm>
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
// Experimental C++17 features
|
|
|
|
#include <filesystem>
|
2017-06-13 09:35:12 -04:00
|
|
|
#include <optional>
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2017-04-28 08:18:28 -04:00
|
|
|
#pragma warning(pop)
|
|
|
|
|
2017-01-20 08:36:52 -05:00
|
|
|
#include <d3dx9tex.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma comment(lib, "D3dx9.lib")
|
|
|
|
|
2021-01-02 02:17:37 -05:00
|
|
|
#include <Xinput.h>
|
|
|
|
#pragma comment (lib, "xinput.lib")
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
// Usefull for debugging
|
|
|
|
template <size_t S> class Sizer { };
|
|
|
|
#define BindNum(x, y) Sizer<x> y;
|
2017-09-02 05:46:15 -04:00
|
|
|
#define Size_Of(x, y) BindNum(sizeof(x), y)
|
|
|
|
#define Offset_Of(x, y, z) BindNum(offsetof(x, y), z)
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
// Submodules
|
2021-05-27 08:07:28 -04:00
|
|
|
// Ignore the warnings, it's not our code!
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable: 4005)
|
2017-02-18 11:25:54 -05:00
|
|
|
#pragma warning(disable: 4091)
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(disable: 4100)
|
2017-02-23 13:00:39 -05:00
|
|
|
#pragma warning(disable: 4244)
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(disable: 4389)
|
|
|
|
#pragma warning(disable: 4702)
|
2017-05-04 06:45:08 -04:00
|
|
|
#pragma warning(disable: 4800)
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(disable: 4996) // _CRT_SECURE_NO_WARNINGS
|
2019-09-16 04:46:50 -04:00
|
|
|
#pragma warning(disable: 5054)
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(disable: 6001)
|
|
|
|
#pragma warning(disable: 6011)
|
|
|
|
#pragma warning(disable: 6031)
|
|
|
|
#pragma warning(disable: 6255)
|
|
|
|
#pragma warning(disable: 6258)
|
|
|
|
#pragma warning(disable: 6386)
|
|
|
|
#pragma warning(disable: 6387)
|
|
|
|
|
2017-07-03 10:32:10 -04:00
|
|
|
#include <zlib.h>
|
2017-06-26 13:01:52 -04:00
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
#include <curses.h>
|
|
|
|
#include <mongoose.h>
|
|
|
|
#include <json11.hpp>
|
|
|
|
#include <tomcrypt.h>
|
2017-02-21 14:14:31 -05:00
|
|
|
#include <udis86.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
#ifdef max
|
|
|
|
#undef max
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef min
|
|
|
|
#undef min
|
|
|
|
#endif
|
|
|
|
|
2018-07-17 08:30:29 -04:00
|
|
|
// VMProtect
|
|
|
|
// #define USE_VMP
|
|
|
|
#ifdef USE_VMP
|
|
|
|
#include <VMProtect/VMProtectSDK.h>
|
|
|
|
#define __VMProtectBeginUltra VMProtectBeginUltra
|
|
|
|
#define __VMProtectEnd VMProtectEnd()
|
|
|
|
#else
|
|
|
|
#define __VMProtectBeginUltra
|
|
|
|
#define __VMProtectEnd
|
|
|
|
#endif
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
// Protobuf
|
2018-10-09 04:53:15 -04:00
|
|
|
#include "proto/session.pb.h"
|
2017-01-19 16:23:59 -05:00
|
|
|
#include "proto/party.pb.h"
|
|
|
|
#include "proto/auth.pb.h"
|
2018-10-09 04:53:15 -04:00
|
|
|
#include "proto/node.pb.h"
|
2017-01-19 16:23:59 -05:00
|
|
|
#include "proto/rcon.pb.h"
|
2017-01-27 16:45:01 -05:00
|
|
|
#include "proto/ipc.pb.h"
|
2017-01-31 11:53:59 -05:00
|
|
|
#include "proto/friends.pb.h"
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
#pragma warning(pop)
|
|
|
|
|
2017-01-20 08:36:52 -05:00
|
|
|
#include "Utils/IO.hpp"
|
|
|
|
#include "Utils/CSV.hpp"
|
|
|
|
#include "Utils/Time.hpp"
|
|
|
|
#include "Utils/Cache.hpp"
|
|
|
|
#include "Utils/Chain.hpp"
|
|
|
|
#include "Utils/Utils.hpp"
|
|
|
|
#include "Utils/WebIO.hpp"
|
|
|
|
#include "Utils/Memory.hpp"
|
|
|
|
#include "Utils/String.hpp"
|
|
|
|
#include "Utils/Hooking.hpp"
|
|
|
|
#include "Utils/Library.hpp"
|
2017-03-25 17:18:31 -04:00
|
|
|
#include "Utils/Entities.hpp"
|
2017-01-20 08:36:52 -05:00
|
|
|
#include "Utils/InfoString.hpp"
|
|
|
|
#include "Utils/Compression.hpp"
|
|
|
|
#include "Utils/Cryptography.hpp"
|
|
|
|
|
|
|
|
#include "Steam/Steam.hpp"
|
|
|
|
|
|
|
|
#include "Game/Structs.hpp"
|
|
|
|
#include "Game/Functions.hpp"
|
|
|
|
|
|
|
|
#include "Utils/Stream.hpp"
|
|
|
|
|
|
|
|
#include "Components/Loader.hpp"
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
// Libraries
|
|
|
|
#pragma comment(lib, "Winmm.lib")
|
|
|
|
#pragma comment(lib, "Crypt32.lib")
|
|
|
|
#pragma comment(lib, "Ws2_32.lib")
|
|
|
|
#pragma comment(lib, "d3d9.lib")
|
|
|
|
#pragma comment(lib, "Wininet.lib")
|
|
|
|
#pragma comment(lib, "shlwapi.lib")
|
|
|
|
#pragma comment(lib, "Urlmon.lib")
|
|
|
|
#pragma comment(lib, "Advapi32.lib")
|
|
|
|
#pragma comment(lib, "rpcrt4.lib")
|
2017-03-13 16:50:42 -04:00
|
|
|
#pragma comment(lib, "dbghelp.lib")
|
2021-07-18 12:11:20 -04:00
|
|
|
#pragma comment(lib, "ntdll.lib")
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
// Enable additional literals
|
|
|
|
using namespace std::literals;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define STRINGIZE_(x) #x
|
|
|
|
#define STRINGIZE(x) STRINGIZE_(x)
|
|
|
|
|
|
|
|
#define BASEGAME "iw4x"
|
|
|
|
#define CLIENT_CONFIG "iw4x_config.cfg"
|
|
|
|
|
|
|
|
#define AssertSize(x, size) static_assert(sizeof(x) == size, STRINGIZE(x) " structure has an invalid size.")
|
|
|
|
#define AssertOffset(x, y, offset) static_assert(offsetof(x, y) == offset, STRINGIZE(x) "::" STRINGIZE(y) " is not at the right offset.")
|
|
|
|
|
|
|
|
// Resource stuff
|
|
|
|
#ifdef APSTUDIO_INVOKED
|
|
|
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
|
|
|
// Defines below make accessing the resources from the code easier.
|
|
|
|
#define _APS_NEXT_RESOURCE_VALUE 102
|
|
|
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
|
|
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
|
|
|
#define _APS_NEXT_SYMED_VALUE 101
|
|
|
|
#endif
|
|
|
|
#endif
|