Compare commits
3 Commits
d86721afcb
...
e100c89160
Author | SHA1 | Date |
---|---|---|
Nemirtingas | e100c89160 | |
Nemirtingas | fe9bbd1104 | |
Nemirtingas | 25ee1dfa52 |
48
dll/base.cpp
48
dll/base.cpp
|
@ -17,13 +17,7 @@
|
||||||
|
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
#ifdef STEAM_WIN32
|
#ifdef __WINDOWS__
|
||||||
#include <windows.h>
|
|
||||||
#include <direct.h>
|
|
||||||
|
|
||||||
#define SystemFunction036 NTAPI SystemFunction036
|
|
||||||
#include <ntsecapi.h>
|
|
||||||
#undef SystemFunction036
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
randombytes(char * const buf, const size_t size)
|
randombytes(char * const buf, const size_t size)
|
||||||
|
@ -46,11 +40,6 @@ std::string get_env_variable(std::string name)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
static int fd = -1;
|
static int fd = -1;
|
||||||
|
|
||||||
static void randombytes(char *buf, size_t size)
|
static void randombytes(char *buf, size_t size)
|
||||||
|
@ -149,9 +138,19 @@ CSteamID generate_steam_id_lobby()
|
||||||
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance | k_EChatInstanceFlagLobby, k_EUniversePublic, k_EAccountTypeChat);
|
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance | k_EChatInstanceFlagLobby, k_EUniversePublic, k_EAccountTypeChat);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef STEAM_WIN32
|
bool check_timedout(std::chrono::high_resolution_clock::time_point old, double timeout)
|
||||||
#include <sys/types.h>
|
{
|
||||||
#include <dirent.h>
|
if (timeout == 0.0) return true;
|
||||||
|
|
||||||
|
std::chrono::high_resolution_clock::time_point now = std::chrono::high_resolution_clock::now();
|
||||||
|
if (std::chrono::duration_cast<std::chrono::duration<double>>(now - old).count() > timeout) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __LINUX__
|
||||||
std::string get_lib_path() {
|
std::string get_lib_path() {
|
||||||
std::string dir = "/proc/self/map_files";
|
std::string dir = "/proc/self/map_files";
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
|
@ -194,7 +193,7 @@ std::string get_lib_path() {
|
||||||
std::string get_full_lib_path()
|
std::string get_full_lib_path()
|
||||||
{
|
{
|
||||||
std::string program_path;
|
std::string program_path;
|
||||||
#if defined(STEAM_WIN32)
|
#if defined(__WINDOWS__)
|
||||||
char DllPath[MAX_PATH] = {0};
|
char DllPath[MAX_PATH] = {0};
|
||||||
GetModuleFileName((HINSTANCE)&__ImageBase, DllPath, _countof(DllPath));
|
GetModuleFileName((HINSTANCE)&__ImageBase, DllPath, _countof(DllPath));
|
||||||
program_path = DllPath;
|
program_path = DllPath;
|
||||||
|
@ -474,8 +473,7 @@ void Auth_Ticket_Manager::Callback(Common_Message *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EMU_EXPERIMENTAL_BUILD
|
#ifdef EMU_EXPERIMENTAL_BUILD
|
||||||
#ifdef STEAM_WIN32
|
#ifdef __WINDOWS__
|
||||||
#include "../detours/detours.h"
|
|
||||||
|
|
||||||
struct ips_test {
|
struct ips_test {
|
||||||
uint32_t ip_from;
|
uint32_t ip_from;
|
||||||
|
@ -596,13 +594,6 @@ inline bool file_exists (const std::string& name) {
|
||||||
return (stat (name.c_str(), &buffer) == 0);
|
return (stat (name.c_str(), &buffer) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DETOURS_64BIT
|
|
||||||
#define DLL_NAME "steam_api64.dll"
|
|
||||||
#else
|
|
||||||
#define DLL_NAME "steam_api.dll"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
HMODULE (WINAPI *Real_GetModuleHandleA)(LPCSTR lpModuleName) = GetModuleHandleA;
|
HMODULE (WINAPI *Real_GetModuleHandleA)(LPCSTR lpModuleName) = GetModuleHandleA;
|
||||||
HMODULE WINAPI Mine_GetModuleHandleA(LPCSTR lpModuleName)
|
HMODULE WINAPI Mine_GetModuleHandleA(LPCSTR lpModuleName)
|
||||||
{
|
{
|
||||||
|
@ -648,12 +639,6 @@ static void load_dll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DETOURS_64BIT
|
|
||||||
#define LUMA_CEG_DLL_NAME "LumaCEG_Plugin_x64.dll"
|
|
||||||
#else
|
|
||||||
#define LUMA_CEG_DLL_NAME "LumaCEG_Plugin_x86.dll"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void load_lumaCEG()
|
static void load_lumaCEG()
|
||||||
{
|
{
|
||||||
std::string path = get_full_program_path();
|
std::string path = get_full_program_path();
|
||||||
|
@ -700,7 +685,6 @@ bool crack_SteamAPI_Init()
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#include <winhttp.h>
|
|
||||||
|
|
||||||
HINTERNET (WINAPI *Real_WinHttpConnect)(
|
HINTERNET (WINAPI *Real_WinHttpConnect)(
|
||||||
IN HINTERNET hSession,
|
IN HINTERNET hSession,
|
||||||
|
|
68
dll/base.h
68
dll/base.h
|
@ -18,78 +18,14 @@
|
||||||
#ifndef BASE_INCLUDE
|
#ifndef BASE_INCLUDE
|
||||||
#define BASE_INCLUDE
|
#define BASE_INCLUDE
|
||||||
|
|
||||||
#if defined(WIN64) || defined(_WIN64) || defined(__MINGW64__)
|
#include "common_includes.h"
|
||||||
#define __WINDOWS_64__
|
|
||||||
#elif defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
|
|
||||||
#define __WINDOWS_32__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__WINDOWS_32__) || defined(__WINDOWS_64__)
|
|
||||||
#define __WINDOWS__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__linux__) || defined(linux)
|
|
||||||
#if defined(__x86_64__)
|
|
||||||
#define __LINUX_64__
|
|
||||||
#else
|
|
||||||
#define __LINUX_32__
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__LINUX_32__) || defined(__LINUX_64__)
|
|
||||||
#define __LINUX__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
|
||||||
#define STEAM_WIN32
|
|
||||||
#ifndef NOMINMAX
|
|
||||||
# define NOMINMAX
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STEAM_API_EXPORTS
|
|
||||||
#include "../sdk_includes/steam_gameserver.h"
|
|
||||||
#include "../sdk_includes/steamdatagram_tickets.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
//#define PRINT_DEBUG(...) {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, __VA_ARGS__); fclose(t);}
|
|
||||||
#ifdef STEAM_WIN32
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <processthreadsapi.h>
|
|
||||||
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
|
|
||||||
#define PATH_SEPARATOR "\\"
|
|
||||||
#ifndef EMU_RELEASE_BUILD
|
|
||||||
#define PRINT_DEBUG(a, ...) do {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t); WSASetLastError(0);} while (0)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#define PATH_SEPARATOR "/"
|
|
||||||
#ifndef EMU_RELEASE_BUILD
|
|
||||||
#define PRINT_DEBUG(...) {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, __VA_ARGS__); fclose(t);}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
//#define PRINT_DEBUG(...) fprintf(stdout, __VA_ARGS__)
|
|
||||||
#ifdef EMU_RELEASE_BUILD
|
|
||||||
#define PRINT_DEBUG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "settings.h"
|
|
||||||
#include "local_storage.h"
|
|
||||||
#include "network.h"
|
|
||||||
|
|
||||||
#include "defines.h"
|
|
||||||
|
|
||||||
#define PUSH_BACK_IF_NOT_IN(vector, element) { if(std::find(vector.begin(), vector.end(), element) == vector.end()) vector.push_back(element); }
|
#define PUSH_BACK_IF_NOT_IN(vector, element) { if(std::find(vector.begin(), vector.end(), element) == vector.end()) vector.push_back(element); }
|
||||||
|
|
||||||
extern std::recursive_mutex global_mutex;
|
extern std::recursive_mutex global_mutex;
|
||||||
|
|
||||||
std::string get_env_variable(std::string name);
|
std::string get_env_variable(std::string name);
|
||||||
|
bool check_timedout(std::chrono::high_resolution_clock::time_point old, double timeout);
|
||||||
|
|
||||||
class CCallbackMgr
|
class CCallbackMgr
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,172 @@
|
||||||
|
/* Copyright (C) 2019 Mr Goldberg
|
||||||
|
This file is part of the Goldberg Emulator
|
||||||
|
|
||||||
|
The Goldberg Emulator is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Goldberg Emulator is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with the Goldberg Emulator; if not, see
|
||||||
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#ifndef __INCLUDED_COMMON_INCLUDES__
|
||||||
|
#define __INCLUDED_COMMON_INCLUDES__
|
||||||
|
|
||||||
|
#if defined(WIN64) || defined(_WIN64) || defined(__MINGW64__)
|
||||||
|
#define __WINDOWS_64__
|
||||||
|
#elif defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
|
||||||
|
#define __WINDOWS_32__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__WINDOWS_32__) || defined(__WINDOWS_64__)
|
||||||
|
#define __WINDOWS__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(linux)
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
#define __LINUX_64__
|
||||||
|
#else
|
||||||
|
#define __LINUX_32__
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__LINUX_32__) || defined(__LINUX_64__)
|
||||||
|
#define __LINUX__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__WINDOWS__)
|
||||||
|
#define STEAM_WIN32
|
||||||
|
#ifndef NOMINMAX
|
||||||
|
#define NOMINMAX
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STEAM_API_EXPORTS
|
||||||
|
|
||||||
|
#if defined(__WINDOWS__)
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#include <processthreadsapi.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <direct.h>
|
||||||
|
#include <iphlpapi.h> // Include winsock2 before this, or winsock2 iphlpapi will be unavailable
|
||||||
|
#include <shlobj.h>
|
||||||
|
|
||||||
|
#define MSG_NOSIGNAL 0
|
||||||
|
|
||||||
|
#define SystemFunction036 NTAPI SystemFunction036
|
||||||
|
#include <ntsecapi.h>
|
||||||
|
#undef SystemFunction036
|
||||||
|
|
||||||
|
#ifndef EMU_RELEASE_BUILD
|
||||||
|
#define PRINT_DEBUG(a, ...) do {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t); WSASetLastError(0);} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
|
||||||
|
#define PATH_SEPARATOR "\\"
|
||||||
|
|
||||||
|
#ifdef EMU_EXPERIMENTAL_BUILD
|
||||||
|
#include <winhttp.h>
|
||||||
|
|
||||||
|
#include "../detours/detours.h"
|
||||||
|
|
||||||
|
#ifdef DETOURS_64BIT
|
||||||
|
#define LUMA_CEG_DLL_NAME "LumaCEG_Plugin_x64.dll"
|
||||||
|
#define DLL_NAME "steam_api64.dll"
|
||||||
|
#else
|
||||||
|
#define LUMA_CEG_DLL_NAME "LumaCEG_Plugin_x86.dll"
|
||||||
|
#define DLL_NAME "steam_api.dll"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined(__LINUX__)
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <linux/netdevice.h>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <utime.h>
|
||||||
|
|
||||||
|
#define PATH_MAX_STRING_SIZE 512
|
||||||
|
|
||||||
|
#ifndef EMU_RELEASE_BUILD
|
||||||
|
#define PRINT_DEBUG(...) {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, __VA_ARGS__); fclose(t);}
|
||||||
|
#endif
|
||||||
|
#define PATH_SEPARATOR "/"
|
||||||
|
#endif
|
||||||
|
//#define PRINT_DEBUG(...) fprintf(stdout, __VA_ARGS__)
|
||||||
|
#ifdef EMU_RELEASE_BUILD
|
||||||
|
#define PRINT_DEBUG(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// C/C++ includes
|
||||||
|
#include <cstdint>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <string>
|
||||||
|
#include <chrono>
|
||||||
|
#include <cctype>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <iterator>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <queue>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
#include <thread>
|
||||||
|
#include <mutex>
|
||||||
|
#include <condition_variable>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
// Other libs includes
|
||||||
|
#include "../json/json.hpp"
|
||||||
|
#include "../controller/gamepad.h"
|
||||||
|
|
||||||
|
// Steamsdk includes
|
||||||
|
#include "../sdk_includes/steam_api.h"
|
||||||
|
#include "../sdk_includes/steam_gameserver.h"
|
||||||
|
#include "../sdk_includes/steamdatagram_tickets.h"
|
||||||
|
|
||||||
|
// Emulator includes
|
||||||
|
#include "net.pb.h"
|
||||||
|
#include "settings.h"
|
||||||
|
#include "local_storage.h"
|
||||||
|
#include "network.h"
|
||||||
|
|
||||||
|
// Emulator defines
|
||||||
|
#define CLIENT_HSTEAMUSER 1
|
||||||
|
#define SERVER_HSTEAMUSER 1
|
||||||
|
|
||||||
|
#define DEFAULT_NAME "Goldberg"
|
||||||
|
#define PROGRAM_NAME "Goldberg SteamEmu"
|
||||||
|
#define DEFAULT_LANGUAGE "english"
|
||||||
|
|
||||||
|
#define LOBBY_CONNECT_APPID ((uint32)-2)
|
||||||
|
|
||||||
|
#endif//__INCLUDED_COMMON_INCLUDES__
|
|
@ -1,9 +0,0 @@
|
||||||
//TODO: put these in a common .h
|
|
||||||
#define CLIENT_HSTEAMUSER 1
|
|
||||||
#define SERVER_HSTEAMUSER 1
|
|
||||||
|
|
||||||
#define DEFAULT_NAME "Goldberg"
|
|
||||||
#define PROGRAM_NAME "Goldberg SteamEmu"
|
|
||||||
#define DEFAULT_LANGUAGE "english"
|
|
||||||
|
|
||||||
#define LOBBY_CONNECT_APPID ((uint32)-2)
|
|
|
@ -44,7 +44,6 @@ static char old_inventory[128] = "STEAMINVENTORY_INTERFACE_V001";
|
||||||
static char old_video[128] = "STEAMVIDEO_INTERFACE_V001";
|
static char old_video[128] = "STEAMVIDEO_INTERFACE_V001";
|
||||||
static char old_masterserver_updater[128] = "SteamMasterServerUpdater001";
|
static char old_masterserver_updater[128] = "SteamMasterServerUpdater001";
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
static void load_old_interface_versions()
|
static void load_old_interface_versions()
|
||||||
{
|
{
|
||||||
static bool loaded = false;
|
static bool loaded = false;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#define STEAM_API_FUNCTIONS_IMPL
|
#define STEAM_API_FUNCTIONS_IMPL
|
||||||
#include "dll.h"
|
#include "dll.h"
|
||||||
#include "../sdk_includes/steam_api_flat.h"
|
#include "../sdk_includes/steam_api_flat.h"
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
STEAMAPI_API HSteamPipe SteamAPI_ISteamClient_CreateSteamPipe( ISteamClient* self )
|
STEAMAPI_API HSteamPipe SteamAPI_ISteamClient_CreateSteamPipe( ISteamClient* self )
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,11 +17,6 @@
|
||||||
|
|
||||||
#include "local_storage.h"
|
#include "local_storage.h"
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iterator>
|
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
struct File_Data {
|
struct File_Data {
|
||||||
std::string name;
|
std::string name;
|
||||||
};
|
};
|
||||||
|
@ -149,8 +144,7 @@ std::vector<std::string> Local_Storage::get_filenames_path(std::string path)
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(__WINDOWS__)
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
static BOOL DirectoryExists(LPCSTR szPath)
|
static BOOL DirectoryExists(LPCSTR szPath)
|
||||||
{
|
{
|
||||||
|
@ -176,11 +170,6 @@ static void create_directory(std::string strPath)
|
||||||
createDirectoryRecursively(strPath);
|
createDirectoryRecursively(strPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
|
|
||||||
static std::vector<struct File_Data> get_filenames(std::string strPath)
|
static std::vector<struct File_Data> get_filenames(std::string strPath)
|
||||||
{
|
{
|
||||||
std::vector<struct File_Data> output;
|
std::vector<struct File_Data> output;
|
||||||
|
@ -250,14 +239,7 @@ static std::vector<struct File_Data> get_filenames_recursive(std::string base_pa
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
|
|
||||||
#define PATH_MAX_STRING_SIZE 512
|
|
||||||
|
|
||||||
/* recursive mkdir */
|
/* recursive mkdir */
|
||||||
static int mkdir_p(const char *dir, const mode_t mode) {
|
static int mkdir_p(const char *dir, const mode_t mode) {
|
||||||
|
@ -397,11 +379,6 @@ std::string Local_Storage::get_game_settings_path()
|
||||||
return get_program_path().append(game_settings_folder).append(PATH_SEPARATOR);
|
return get_program_path().append(game_settings_folder).append(PATH_SEPARATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(STEAM_WIN32)
|
|
||||||
#include <shlobj.h>
|
|
||||||
#include <sstream>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string Local_Storage::get_user_appdata_path()
|
std::string Local_Storage::get_user_appdata_path()
|
||||||
{
|
{
|
||||||
std::string user_appdata_path = "SAVE";
|
std::string user_appdata_path = "SAVE";
|
||||||
|
|
|
@ -15,14 +15,10 @@
|
||||||
License along with the Goldberg Emulator; if not, see
|
License along with the Goldberg Emulator; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#ifndef LOCAL_STORAGE_INCLUDE
|
#ifndef LOCAL_STORAGE_INCLUDE
|
||||||
#define LOCAL_STORAGE_INCLUDE
|
#define LOCAL_STORAGE_INCLUDE
|
||||||
|
|
||||||
#include <string>
|
#include "base.h"
|
||||||
#include "../json/json.hpp"
|
|
||||||
|
|
||||||
#define MAX_FILENAME_LENGTH 300
|
#define MAX_FILENAME_LENGTH 300
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ message Low_Level {
|
||||||
Types type = 1;
|
Types type = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Network {
|
message Network_pb {
|
||||||
uint32 channel = 1;
|
uint32 channel = 1;
|
||||||
bytes data = 2;
|
bytes data = 2;
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ message Common_Message {
|
||||||
Low_Level low_level = 4;
|
Low_Level low_level = 4;
|
||||||
Lobby lobby = 5;
|
Lobby lobby = 5;
|
||||||
Lobby_Messages lobby_messages = 6;
|
Lobby_Messages lobby_messages = 6;
|
||||||
Network network = 7;
|
Network_pb network = 7;
|
||||||
Gameserver gameserver = 8;
|
Gameserver gameserver = 8;
|
||||||
Friend friend = 9;
|
Friend friend = 9;
|
||||||
Auth_Ticket auth_ticket = 10;
|
Auth_Ticket auth_ticket = 10;
|
||||||
|
|
|
@ -17,22 +17,6 @@
|
||||||
|
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
|
||||||
#if defined(STEAM_WIN32)
|
|
||||||
|
|
||||||
#define MSG_NOSIGNAL 0
|
|
||||||
|
|
||||||
#else
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <linux/netdevice.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_BROADCASTS 16
|
#define MAX_BROADCASTS 16
|
||||||
static int number_broadcasts = -1;
|
static int number_broadcasts = -1;
|
||||||
static IP_PORT broadcasts[MAX_BROADCASTS];
|
static IP_PORT broadcasts[MAX_BROADCASTS];
|
||||||
|
@ -45,8 +29,6 @@ static uint32_t upper_range_ips[MAX_BROADCASTS];
|
||||||
|
|
||||||
#if defined(STEAM_WIN32)
|
#if defined(STEAM_WIN32)
|
||||||
|
|
||||||
#include <iphlpapi.h>
|
|
||||||
|
|
||||||
//windows xp support
|
//windows xp support
|
||||||
static int
|
static int
|
||||||
inet_pton4(const char *src, uint32_t *dst)
|
inet_pton4(const char *src, uint32_t *dst)
|
||||||
|
@ -489,18 +471,6 @@ static bool recv_tcp(struct TCP_Socket &socket)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool check_timedout(std::chrono::high_resolution_clock::time_point old, double timeout)
|
|
||||||
{
|
|
||||||
if (timeout == 0.0) return true;
|
|
||||||
|
|
||||||
std::chrono::high_resolution_clock::time_point now = std::chrono::high_resolution_clock::now();
|
|
||||||
if (std::chrono::duration_cast<std::chrono::duration<double>>(now - old).count() > timeout) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void socket_timeouts(struct TCP_Socket &socket, double extra_time)
|
static void socket_timeouts(struct TCP_Socket &socket, double extra_time)
|
||||||
{
|
{
|
||||||
if (check_timedout(socket.last_heartbeat_sent, HEARTBEAT_TIMEOUT / 2.0)) {
|
if (check_timedout(socket.last_heartbeat_sent, HEARTBEAT_TIMEOUT / 2.0)) {
|
||||||
|
|
|
@ -15,13 +15,10 @@
|
||||||
License along with the Goldberg Emulator; if not, see
|
License along with the Goldberg Emulator; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h"
|
|
||||||
|
|
||||||
#ifndef NETWORK_INCLUDE
|
#ifndef NETWORK_INCLUDE
|
||||||
#define NETWORK_INCLUDE
|
#define NETWORK_INCLUDE
|
||||||
|
|
||||||
#include "net.pb.h"
|
#include "base.h"
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
inline bool protobuf_message_equal(const google::protobuf::MessageLite& msg_a,
|
inline bool protobuf_message_equal(const google::protobuf::MessageLite& msg_a,
|
||||||
const google::protobuf::MessageLite& msg_b) {
|
const google::protobuf::MessageLite& msg_b) {
|
||||||
|
@ -38,8 +35,6 @@ typedef unsigned int sock_t;
|
||||||
typedef int sock_t;
|
typedef int sock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool check_timedout(std::chrono::high_resolution_clock::time_point old, double timeout);
|
|
||||||
|
|
||||||
struct IP_PORT {
|
struct IP_PORT {
|
||||||
uint32 ip;
|
uint32 ip;
|
||||||
uint16 port;
|
uint16 port;
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
License along with the Goldberg Emulator; if not, see
|
License along with the Goldberg Emulator; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h"
|
|
||||||
#include <set>
|
|
||||||
|
|
||||||
#ifndef SETTINGS_INCLUDE
|
#ifndef SETTINGS_INCLUDE
|
||||||
#define SETTINGS_INCLUDE
|
#define SETTINGS_INCLUDE
|
||||||
|
|
||||||
|
#include "base.h"
|
||||||
|
|
||||||
struct DLC_entry {
|
struct DLC_entry {
|
||||||
AppId_t appID;
|
AppId_t appID;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "settings_parser.h"
|
#include "settings_parser.h"
|
||||||
#include <fstream>
|
|
||||||
#include <cctype>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
static void consume_bom(std::ifstream &input)
|
static void consume_bom(std::ifstream &input)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
#include "steam_client.h"
|
#include "steam_client.h"
|
||||||
#include "settings_parser.h"
|
#include "settings_parser.h"
|
||||||
|
|
||||||
#include <condition_variable>
|
|
||||||
|
|
||||||
static std::condition_variable kill_background_thread_cv;
|
static std::condition_variable kill_background_thread_cv;
|
||||||
static std::atomic_bool kill_background_thread;
|
static std::atomic_bool kill_background_thread;
|
||||||
static void background_thread(Steam_Client *client)
|
static void background_thread(Steam_Client *client)
|
||||||
|
|
|
@ -56,8 +56,6 @@
|
||||||
|
|
||||||
#include "../overlay_experimental/steam_overlay.h"
|
#include "../overlay_experimental/steam_overlay.h"
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
enum Steam_Pipe {
|
enum Steam_Pipe {
|
||||||
NO_USER,
|
NO_USER,
|
||||||
CLIENT,
|
CLIENT,
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
#include "../controller/gamepad.h"
|
|
||||||
#include <cctype>
|
|
||||||
|
|
||||||
struct Controller_Map {
|
struct Controller_Map {
|
||||||
std::map<ControllerDigitalActionHandle_t, std::set<int>> active_digital;
|
std::map<ControllerDigitalActionHandle_t, std::set<int>> active_digital;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
class Steam_Game_Coordinator :
|
class Steam_Game_Coordinator :
|
||||||
public ISteamGameCoordinator
|
public ISteamGameCoordinator
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h" // For SteamItemDef_t
|
#include "base.h" // For SteamItemDef_t
|
||||||
#include "../json/json.hpp"
|
|
||||||
|
|
||||||
struct Steam_Inventory_Requests {
|
struct Steam_Inventory_Requests {
|
||||||
double timeout = 0.1;
|
double timeout = 0.1;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
#include <list>
|
|
||||||
|
|
||||||
//packet timeout in seconds for non connections
|
//packet timeout in seconds for non connections
|
||||||
#define ORPHANED_PACKET_TIMEOUT (20)
|
#define ORPHANED_PACKET_TIMEOUT (20)
|
||||||
|
@ -278,16 +277,16 @@ bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData,
|
||||||
Common_Message msg;
|
Common_Message msg;
|
||||||
msg.set_source_id(settings->get_local_steam_id().ConvertToUint64());
|
msg.set_source_id(settings->get_local_steam_id().ConvertToUint64());
|
||||||
msg.set_dest_id(steamIDRemote.ConvertToUint64());
|
msg.set_dest_id(steamIDRemote.ConvertToUint64());
|
||||||
msg.set_allocated_network(new Network);
|
msg.set_allocated_network(new Network_pb);
|
||||||
|
|
||||||
if (!connection_exists(steamIDRemote)) {
|
if (!connection_exists(steamIDRemote)) {
|
||||||
msg.mutable_network()->set_type(Network::NEW_CONNECTION);
|
msg.mutable_network()->set_type(Network_pb::NEW_CONNECTION);
|
||||||
network->sendTo(&msg, true);
|
network->sendTo(&msg, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.mutable_network()->set_channel(nChannel);
|
msg.mutable_network()->set_channel(nChannel);
|
||||||
msg.mutable_network()->set_data(pubData, cubData);
|
msg.mutable_network()->set_data(pubData, cubData);
|
||||||
msg.mutable_network()->set_type(Network::DATA);
|
msg.mutable_network()->set_type(Network_pb::DATA);
|
||||||
|
|
||||||
struct Steam_Networking_Connection *conn = get_or_create_connection(steamIDRemote);
|
struct Steam_Networking_Connection *conn = get_or_create_connection(steamIDRemote);
|
||||||
new_connection_times.erase(steamIDRemote);
|
new_connection_times.erase(steamIDRemote);
|
||||||
|
@ -914,11 +913,11 @@ void Callback(Common_Message *msg)
|
||||||
}PRINT_DEBUG("\n");
|
}PRINT_DEBUG("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (msg->network().type() == Network::DATA) {
|
if (msg->network().type() == Network_pb::DATA) {
|
||||||
unprocessed_messages.push_back(Common_Message(*msg));
|
unprocessed_messages.push_back(Common_Message(*msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->network().type() == Network::NEW_CONNECTION) {
|
if (msg->network().type() == Network_pb::NEW_CONNECTION) {
|
||||||
std::lock_guard<std::recursive_mutex> lock(messages_mutex);
|
std::lock_guard<std::recursive_mutex> lock(messages_mutex);
|
||||||
auto msg_temp = std::begin(messages);
|
auto msg_temp = std::begin(messages);
|
||||||
while (msg_temp != std::end(messages)) {
|
while (msg_temp != std::end(messages)) {
|
||||||
|
|
|
@ -338,40 +338,291 @@ ESteamNetworkingConfigValue GetFirstConfigValue()
|
||||||
void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort )
|
void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIPAddr_ToString\n");
|
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIPAddr_ToString\n");
|
||||||
|
if (buf == nullptr || cbBuf == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
char buffer[64]; // Its enought for ipv4 & ipv6 + port
|
||||||
|
std::string str_addr;
|
||||||
|
if (addr.IsIPv4())
|
||||||
|
{
|
||||||
|
in_addr ipv4_addr;
|
||||||
|
ipv4_addr.s_addr = htonl(addr.GetIPv4());
|
||||||
|
|
||||||
|
if (inet_ntop(AF_INET, &ipv4_addr, buffer, sizeof(buffer) / sizeof(*buffer)) != nullptr)
|
||||||
|
{
|
||||||
|
if (bWithPort)
|
||||||
|
{
|
||||||
|
str_addr = buffer;
|
||||||
|
str_addr += ':';
|
||||||
|
str_addr += std::to_string(addr.m_port);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str_addr = buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
in6_addr ipv6_addr;
|
||||||
|
memcpy(ipv6_addr.s6_addr, addr.m_ipv6, sizeof(addr.m_ipv6));
|
||||||
|
|
||||||
|
if (inet_ntop(AF_INET6, &ipv6_addr, buffer, sizeof(buffer) / sizeof(*buffer)) != nullptr)
|
||||||
|
{
|
||||||
|
if (bWithPort)
|
||||||
|
{
|
||||||
|
str_addr = '[';
|
||||||
|
str_addr += buffer;
|
||||||
|
str_addr += "]:";
|
||||||
|
str_addr += std::to_string(addr.m_port);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str_addr = buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cbBuf = std::min<size_t>(cbBuf, str_addr.length() + 1);
|
||||||
|
strncpy(buf, str_addr.c_str(), cbBuf);
|
||||||
|
buf[cbBuf - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr )
|
bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIPAddr_ParseString\n");
|
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIPAddr_ParseString\n");
|
||||||
return false;
|
|
||||||
|
bool valid = false;
|
||||||
|
|
||||||
|
if (pAddr == nullptr || pszStr == nullptr)
|
||||||
|
return valid;
|
||||||
|
|
||||||
|
std::string str(pszStr);
|
||||||
|
size_t pos = str.find(':');
|
||||||
|
|
||||||
|
if (pos != std::string::npos)
|
||||||
|
{// Try ipv4 with port
|
||||||
|
in_addr ipv4_addr;
|
||||||
|
std::string tmp(str);
|
||||||
|
tmp[pos] = 0;
|
||||||
|
const char* ip = tmp.c_str();
|
||||||
|
const char* port = &tmp[pos + 1];
|
||||||
|
|
||||||
|
if (inet_pton(AF_INET, ip, &ipv4_addr) == 1)
|
||||||
|
{
|
||||||
|
valid = true;
|
||||||
|
pAddr->SetIPv4(ntohl(ipv4_addr.s_addr), strtoul(port, nullptr, 10));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{// Try ipv4 without port
|
||||||
|
in_addr ipv4_addr;
|
||||||
|
if (inet_pton(AF_INET, str.c_str(), &ipv4_addr) == 1)
|
||||||
|
{
|
||||||
|
valid = true;
|
||||||
|
pAddr->SetIPv4(ntohl(ipv4_addr.s_addr), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!valid)
|
||||||
|
{// Try ipv6
|
||||||
|
addrinfo* info = nullptr;
|
||||||
|
addrinfo hints = {};
|
||||||
|
hints.ai_family = AF_INET6;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
|
||||||
|
|
||||||
|
size_t sep_pos = 0;
|
||||||
|
std::string ip;
|
||||||
|
int sep_count = 0;
|
||||||
|
for (int i = 0; i < str.length(); ++i)
|
||||||
|
{
|
||||||
|
if (str[i] == ':')
|
||||||
|
{
|
||||||
|
sep_pos = i;
|
||||||
|
++sep_count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sep_count == 8)
|
||||||
|
{
|
||||||
|
ip = std::move(std::string(str.begin(), str.begin() + sep_pos));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ip = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getaddrinfo(ip.c_str(), nullptr, &hints, &info) == 0)
|
||||||
|
{
|
||||||
|
sockaddr_in6* maddr = (sockaddr_in6*)info->ai_addr;
|
||||||
|
|
||||||
|
size_t pos = str.find(']');
|
||||||
|
std::string str_port("0");
|
||||||
|
if (pos != std::string::npos)
|
||||||
|
{
|
||||||
|
str_port = std::move(std::string(str.begin() + pos + 2, str.end()));
|
||||||
|
}
|
||||||
|
else if (sep_count == 8)
|
||||||
|
{
|
||||||
|
str_port = std::move(std::string(str.begin() + sep_pos + 1, str.end()));
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int port = std::stoi(str_port);
|
||||||
|
if (port >= 0 && port <= 65535)
|
||||||
|
{
|
||||||
|
pAddr->SetIPv6(maddr->sin6_addr.s6_addr, port);
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info)
|
||||||
|
{
|
||||||
|
freeaddrinfo(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!valid)
|
||||||
|
{
|
||||||
|
pAddr->Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf )
|
void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ToString\n");
|
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ToString\n");
|
||||||
if (identity.m_eType == k_ESteamNetworkingIdentityType_SteamID)
|
if (buf == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::string str;
|
||||||
|
str.reserve(SteamNetworkingIdentity::k_cchMaxString);
|
||||||
|
switch (identity.m_eType)
|
||||||
{
|
{
|
||||||
if (buf != nullptr)
|
case k_ESteamNetworkingIdentityType_SteamID:
|
||||||
{
|
{
|
||||||
std::string str("steamid:");
|
str = "steamid:";
|
||||||
str += std::move(std::to_string(identity.GetSteamID64()));
|
str += std::move(std::to_string(identity.GetSteamID64()));
|
||||||
strncpy(buf, str.c_str(), cbBuf);
|
|
||||||
buf[cbBuf - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else
|
|
||||||
{
|
case k_ESteamNetworkingIdentityType_IPAddress:
|
||||||
if (cbBuf != 0 && buf != nullptr)
|
|
||||||
{
|
{
|
||||||
*buf = '\0';
|
str = "ip:";
|
||||||
|
char buff[SteamNetworkingIPAddr::k_cchMaxString];
|
||||||
|
auto& addr = *identity.GetIPAddr();
|
||||||
|
SteamNetworkingIPAddr_ToString(addr, buff, sizeof(buff), true);
|
||||||
|
str += buff;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case k_ESteamNetworkingIdentityType_GenericBytes:
|
||||||
|
{
|
||||||
|
int generic_len;
|
||||||
|
const uint8* pBuf = identity.GetGenericBytes(generic_len);
|
||||||
|
|
||||||
|
str = "gen:";
|
||||||
|
str.resize(4 + (generic_len * 2));
|
||||||
|
|
||||||
|
char* pDest = &str[4];
|
||||||
|
while(generic_len--)
|
||||||
|
{
|
||||||
|
// I don't care for the last char, I've reserved the max string size
|
||||||
|
snprintf(pDest, 3, "%02x", *pBuf);
|
||||||
|
++pBuf;
|
||||||
|
pDest += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case k_ESteamNetworkingIdentityType_GenericString:
|
||||||
|
{
|
||||||
|
str = "str:";
|
||||||
|
str += identity.GetGenericString();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case k_ESteamNetworkingIdentityType_UnknownType:
|
||||||
|
{
|
||||||
|
str = identity.m_szUnknownRawString;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
cbBuf = std::min<size_t>(cbBuf, str.length() + 1);
|
||||||
|
strncpy(buf, str.c_str(), cbBuf);
|
||||||
|
buf[cbBuf - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr )
|
bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ParseString\n");
|
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ParseString\n");
|
||||||
return false;
|
bool valid = false;
|
||||||
|
if (pIdentity == nullptr)
|
||||||
|
{
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pszStr != nullptr)
|
||||||
|
{
|
||||||
|
const char* end = strchr(pszStr, ':');
|
||||||
|
if (end != nullptr)
|
||||||
|
{
|
||||||
|
++end;
|
||||||
|
if (strncmp(pszStr, "gen:", end - pszStr) == 0)
|
||||||
|
{
|
||||||
|
size_t length = strlen(end);
|
||||||
|
if (!(length % 2) && length <= (sizeof(pIdentity->m_genericBytes) * 2))
|
||||||
|
{// Must be even
|
||||||
|
valid = true;
|
||||||
|
length /= 2;
|
||||||
|
pIdentity->m_eType = k_ESteamNetworkingIdentityType_GenericBytes;
|
||||||
|
pIdentity->m_cbSize = length;
|
||||||
|
uint8* pBytes = pIdentity->m_genericBytes;
|
||||||
|
|
||||||
|
char hex[3] = { 0,0,0 };
|
||||||
|
while (length)
|
||||||
|
{
|
||||||
|
hex[0] = end[0];
|
||||||
|
hex[1] = end[1];
|
||||||
|
// Steam doesn't check if wasn't a hex char
|
||||||
|
*pBytes = strtol(hex, nullptr, 16);
|
||||||
|
|
||||||
|
++pBytes;
|
||||||
|
end += 2;
|
||||||
|
--length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strncmp(pszStr, "steamid:", end - pszStr) == 0)
|
||||||
|
{
|
||||||
|
CSteamID steam_id(uint64(strtoull(end, nullptr, 10)));
|
||||||
|
if (steam_id.IsValid())
|
||||||
|
{
|
||||||
|
valid = true;
|
||||||
|
pIdentity->SetSteamID(steam_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strncmp(pszStr, "str:", end - pszStr) == 0)
|
||||||
|
{
|
||||||
|
valid = pIdentity->SetGenericString(end);
|
||||||
|
}
|
||||||
|
else if (strncmp(pszStr, "ip:", end - pszStr) == 0)
|
||||||
|
{
|
||||||
|
SteamNetworkingIPAddr steam_addr;
|
||||||
|
if (SteamNetworkingIPAddr_ParseString(&steam_addr, end))
|
||||||
|
{
|
||||||
|
valid = true;
|
||||||
|
pIdentity->SetIPAddr(steam_addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
#include "../overlay_experimental/steam_overlay.h"
|
#include "../overlay_experimental/steam_overlay.h"
|
||||||
|
|
||||||
#include <iomanip>
|
|
||||||
#include <fstream>
|
|
||||||
#include "../json/json.hpp"
|
|
||||||
|
|
||||||
struct Steam_Leaderboard {
|
struct Steam_Leaderboard {
|
||||||
std::string name;
|
std::string name;
|
||||||
ELeaderboardSortMethod sort_method;
|
ELeaderboardSortMethod sort_method;
|
||||||
|
|
12
dll/wrap.cpp
12
dll/wrap.cpp
|
@ -28,18 +28,6 @@
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
#include "dll.h"
|
#include "dll.h"
|
||||||
|
|
||||||
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/mount.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/statvfs.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <utime.h>
|
|
||||||
|
|
||||||
#define PATH_SEPARATOR_CHAR '/'
|
#define PATH_SEPARATOR_CHAR '/'
|
||||||
#define STEAM_PATH_CACHE_SIZE 4096
|
#define STEAM_PATH_CACHE_SIZE 4096
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sdk_includes/steam_api.h"
|
#include "sdk_includes/steam_api.h"
|
||||||
#include "dll/defines.h"
|
#include "dll/common_includes.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#ifndef __INCLUDED_BASE_HOOK_H__
|
#ifndef __INCLUDED_BASE_HOOK_H__
|
||||||
#define __INCLUDED_BASE_HOOK_H__
|
#define __INCLUDED_BASE_HOOK_H__
|
||||||
|
|
||||||
#ifdef EMU_OVERLAY
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include "../dll/base.h"
|
#include "../dll/base.h"
|
||||||
|
|
||||||
|
#ifdef EMU_OVERLAY
|
||||||
|
|
||||||
class Base_Hook
|
class Base_Hook
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
|
|
||||||
#ifdef EMU_OVERLAY
|
#ifdef EMU_OVERLAY
|
||||||
|
|
||||||
#include <set>
|
|
||||||
|
|
||||||
class Hook_Manager
|
class Hook_Manager
|
||||||
{
|
{
|
||||||
friend class Base_Hook;
|
friend class Base_Hook;
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
#include "Renderer_Detector.h"
|
#include "Renderer_Detector.h"
|
||||||
#include "Hook_Manager.h"
|
#include "Hook_Manager.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
constexpr int max_hook_retries = 500;
|
constexpr int max_hook_retries = 500;
|
||||||
|
|
||||||
#ifdef STEAM_WIN32
|
#ifdef __WINDOWS__
|
||||||
#include "windows/DX12_Hook.h"
|
#include "windows/DX12_Hook.h"
|
||||||
#include "windows/DX11_Hook.h"
|
#include "windows/DX11_Hook.h"
|
||||||
#include "windows/DX10_Hook.h"
|
#include "windows/DX10_Hook.h"
|
||||||
|
@ -220,7 +218,7 @@ void Renderer_Detector::hook_dx9()
|
||||||
|
|
||||||
IDirect3D9Ex* pD3D = nullptr;
|
IDirect3D9Ex* pD3D = nullptr;
|
||||||
IUnknown* pDevice = nullptr;
|
IUnknown* pDevice = nullptr;
|
||||||
HMODULE library = GetModuleHandle(DX9_Hook::DLL_NAME);
|
HMODULE library = GetModuleHandle(DX9_DLL);
|
||||||
decltype(Direct3DCreate9Ex)* Direct3DCreate9Ex = nullptr;
|
decltype(Direct3DCreate9Ex)* Direct3DCreate9Ex = nullptr;
|
||||||
if (library != nullptr)
|
if (library != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -279,7 +277,7 @@ void Renderer_Detector::hook_dx10()
|
||||||
|
|
||||||
IDXGISwapChain* pSwapChain = nullptr;
|
IDXGISwapChain* pSwapChain = nullptr;
|
||||||
ID3D10Device* pDevice = nullptr;
|
ID3D10Device* pDevice = nullptr;
|
||||||
HMODULE library = GetModuleHandle(DX10_Hook::DLL_NAME);
|
HMODULE library = GetModuleHandle(DX10_DLL);
|
||||||
if (library != nullptr)
|
if (library != nullptr)
|
||||||
{
|
{
|
||||||
decltype(D3D10CreateDeviceAndSwapChain)* D3D10CreateDeviceAndSwapChain =
|
decltype(D3D10CreateDeviceAndSwapChain)* D3D10CreateDeviceAndSwapChain =
|
||||||
|
@ -332,7 +330,7 @@ void Renderer_Detector::hook_dx11()
|
||||||
|
|
||||||
IDXGISwapChain* pSwapChain = nullptr;
|
IDXGISwapChain* pSwapChain = nullptr;
|
||||||
ID3D11Device* pDevice = nullptr;
|
ID3D11Device* pDevice = nullptr;
|
||||||
HMODULE library = GetModuleHandle(DX11_Hook::DLL_NAME);
|
HMODULE library = GetModuleHandle(DX11_DLL);
|
||||||
if (library != nullptr)
|
if (library != nullptr)
|
||||||
{
|
{
|
||||||
decltype(D3D11CreateDeviceAndSwapChain)* D3D11CreateDeviceAndSwapChain =
|
decltype(D3D11CreateDeviceAndSwapChain)* D3D11CreateDeviceAndSwapChain =
|
||||||
|
@ -391,7 +389,7 @@ void Renderer_Detector::hook_dx12()
|
||||||
ID3D12CommandAllocator* pCommandAllocator = nullptr;
|
ID3D12CommandAllocator* pCommandAllocator = nullptr;
|
||||||
ID3D12GraphicsCommandList* pCommandList = nullptr;
|
ID3D12GraphicsCommandList* pCommandList = nullptr;
|
||||||
|
|
||||||
HMODULE library = GetModuleHandle(DX12_Hook::DLL_NAME);
|
HMODULE library = GetModuleHandle(DX12_DLL);
|
||||||
if (library != nullptr)
|
if (library != nullptr)
|
||||||
{
|
{
|
||||||
decltype(D3D12CreateDevice)* D3D12CreateDevice =
|
decltype(D3D12CreateDevice)* D3D12CreateDevice =
|
||||||
|
@ -473,7 +471,7 @@ void Renderer_Detector::hook_opengl()
|
||||||
{
|
{
|
||||||
if (!_ogl_hooked && !_renderer_found)
|
if (!_ogl_hooked && !_renderer_found)
|
||||||
{
|
{
|
||||||
HMODULE library = GetModuleHandle(OpenGL_Hook::DLL_NAME);
|
HMODULE library = GetModuleHandle(OPENGL_DLL);
|
||||||
decltype(wglMakeCurrent)* wglMakeCurrent = nullptr;
|
decltype(wglMakeCurrent)* wglMakeCurrent = nullptr;
|
||||||
OpenGL_Hook::wglSwapBuffers_t wglSwapBuffers = nullptr;
|
OpenGL_Hook::wglSwapBuffers_t wglSwapBuffers = nullptr;
|
||||||
if (library != nullptr)
|
if (library != nullptr)
|
||||||
|
@ -500,15 +498,15 @@ void Renderer_Detector::hook_opengl()
|
||||||
|
|
||||||
void Renderer_Detector::create_hook(const char* libname)
|
void Renderer_Detector::create_hook(const char* libname)
|
||||||
{
|
{
|
||||||
if (!_stricmp(libname, DX9_Hook::DLL_NAME))
|
if (!_stricmp(libname, DX9_DLL))
|
||||||
hook_dx9();
|
hook_dx9();
|
||||||
else if (!_stricmp(libname, DX10_Hook::DLL_NAME))
|
else if (!_stricmp(libname, DX10_DLL))
|
||||||
hook_dx10();
|
hook_dx10();
|
||||||
else if (!_stricmp(libname, DX11_Hook::DLL_NAME))
|
else if (!_stricmp(libname, DX11_DLL))
|
||||||
hook_dx11();
|
hook_dx11();
|
||||||
else if (!_stricmp(libname, DX12_Hook::DLL_NAME))
|
else if (!_stricmp(libname, DX12_DLL))
|
||||||
hook_dx12();
|
hook_dx12();
|
||||||
else if (!_stricmp(libname, OpenGL_Hook::DLL_NAME))
|
else if (!_stricmp(libname, OPENGL_DLL))
|
||||||
hook_opengl();
|
hook_opengl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,11 +517,11 @@ void Renderer_Detector::find_renderer_proc(Renderer_Detector* _this)
|
||||||
hm.AddHook(_this->rendererdetect_hook);
|
hm.AddHook(_this->rendererdetect_hook);
|
||||||
|
|
||||||
std::vector<std::string> const libraries = {
|
std::vector<std::string> const libraries = {
|
||||||
OpenGL_Hook::DLL_NAME,
|
OPENGL_DLL,
|
||||||
DX12_Hook::DLL_NAME,
|
DX12_DLL,
|
||||||
DX11_Hook::DLL_NAME,
|
DX11_DLL,
|
||||||
DX10_Hook::DLL_NAME,
|
DX10_DLL,
|
||||||
DX9_Hook::DLL_NAME
|
DX9_DLL
|
||||||
};
|
};
|
||||||
|
|
||||||
while (!_this->_renderer_found && !_this->stop_retry())
|
while (!_this->_renderer_found && !_this->stop_retry())
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define __INCLUDED_RENDERER_DETECTOR_H__
|
#define __INCLUDED_RENDERER_DETECTOR_H__
|
||||||
|
|
||||||
#include "Base_Hook.h"
|
#include "Base_Hook.h"
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#ifdef EMU_OVERLAY
|
#ifdef EMU_OVERLAY
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
|
|
|
@ -122,7 +122,7 @@ DX10_Hook::DX10_Hook():
|
||||||
ResizeBuffers(nullptr),
|
ResizeBuffers(nullptr),
|
||||||
ResizeTarget(nullptr)
|
ResizeTarget(nullptr)
|
||||||
{
|
{
|
||||||
_library = LoadLibrary(DLL_NAME);
|
_library = LoadLibrary(DX10_DLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
DX10_Hook::~DX10_Hook()
|
DX10_Hook::~DX10_Hook()
|
||||||
|
@ -154,7 +154,7 @@ DX10_Hook* DX10_Hook::Inst()
|
||||||
|
|
||||||
const char* DX10_Hook::get_lib_name() const
|
const char* DX10_Hook::get_lib_name() const
|
||||||
{
|
{
|
||||||
return DLL_NAME;
|
return DX10_DLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DX10_Hook::loadFunctions(IDXGISwapChain *pSwapChain)
|
void DX10_Hook::loadFunctions(IDXGISwapChain *pSwapChain)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
class DX10_Hook : public Base_Hook
|
class DX10_Hook : public Base_Hook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr const char *DLL_NAME = "d3d10.dll";
|
#define DX10_DLL "d3d10.dll"
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static DX10_Hook* _inst;
|
static DX10_Hook* _inst;
|
||||||
|
|
|
@ -167,7 +167,7 @@ DX11_Hook::DX11_Hook():
|
||||||
ResizeBuffers(nullptr),
|
ResizeBuffers(nullptr),
|
||||||
ResizeTarget(nullptr)
|
ResizeTarget(nullptr)
|
||||||
{
|
{
|
||||||
_library = LoadLibrary(DLL_NAME);
|
_library = LoadLibrary(DX11_DLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
DX11_Hook::~DX11_Hook()
|
DX11_Hook::~DX11_Hook()
|
||||||
|
@ -204,7 +204,7 @@ DX11_Hook* DX11_Hook::Inst()
|
||||||
|
|
||||||
const char* DX11_Hook::get_lib_name() const
|
const char* DX11_Hook::get_lib_name() const
|
||||||
{
|
{
|
||||||
return DLL_NAME;
|
return DX11_DLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DX11_Hook::loadFunctions(IDXGISwapChain *pSwapChain)
|
void DX11_Hook::loadFunctions(IDXGISwapChain *pSwapChain)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
class DX11_Hook : public Base_Hook
|
class DX11_Hook : public Base_Hook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr const char *DLL_NAME = "d3d11.dll";
|
#define DX11_DLL "d3d11.dll"
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static DX11_Hook* _inst;
|
static DX11_Hook* _inst;
|
||||||
|
|
|
@ -254,7 +254,7 @@ DX12_Hook::DX12_Hook():
|
||||||
ResizeTarget(nullptr),
|
ResizeTarget(nullptr),
|
||||||
ExecuteCommandLists(nullptr)
|
ExecuteCommandLists(nullptr)
|
||||||
{
|
{
|
||||||
_library = LoadLibrary(DLL_NAME);
|
_library = LoadLibrary(DX12_DLL);
|
||||||
|
|
||||||
PRINT_DEBUG("DX12 support is experimental, don't complain if it doesn't work as expected.\n");
|
PRINT_DEBUG("DX12 support is experimental, don't complain if it doesn't work as expected.\n");
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ DX12_Hook* DX12_Hook::Inst()
|
||||||
|
|
||||||
const char* DX12_Hook::get_lib_name() const
|
const char* DX12_Hook::get_lib_name() const
|
||||||
{
|
{
|
||||||
return DLL_NAME;
|
return DX12_DLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DX12_Hook::loadFunctions(ID3D12CommandQueue* pCommandQueue, IDXGISwapChain *pSwapChain)
|
void DX12_Hook::loadFunctions(ID3D12CommandQueue* pCommandQueue, IDXGISwapChain *pSwapChain)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
class DX12_Hook : public Base_Hook
|
class DX12_Hook : public Base_Hook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr const char *DLL_NAME = "d3d12.dll";
|
#define DX12_DLL "d3d12.dll"
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static DX12_Hook* _inst;
|
static DX12_Hook* _inst;
|
||||||
|
|
|
@ -125,7 +125,7 @@ DX9_Hook::DX9_Hook():
|
||||||
PresentEx(nullptr),
|
PresentEx(nullptr),
|
||||||
Reset(nullptr)
|
Reset(nullptr)
|
||||||
{
|
{
|
||||||
_library = LoadLibrary(DLL_NAME);
|
_library = LoadLibrary(DX9_DLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
DX9_Hook::~DX9_Hook()
|
DX9_Hook::~DX9_Hook()
|
||||||
|
@ -153,7 +153,7 @@ DX9_Hook* DX9_Hook::Inst()
|
||||||
|
|
||||||
const char* DX9_Hook::get_lib_name() const
|
const char* DX9_Hook::get_lib_name() const
|
||||||
{
|
{
|
||||||
return DLL_NAME;
|
return DX9_DLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DX9_Hook::loadFunctions(IDirect3DDevice9* pDevice, bool ex)
|
void DX9_Hook::loadFunctions(IDirect3DDevice9* pDevice, bool ex)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
class DX9_Hook : public Base_Hook
|
class DX9_Hook : public Base_Hook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr const char *DLL_NAME = "d3d9.dll";
|
#define DX9_DLL "d3d9.dll"
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static DX9_Hook* _inst;
|
static DX9_Hook* _inst;
|
||||||
|
|
|
@ -108,7 +108,7 @@ OpenGL_Hook::OpenGL_Hook():
|
||||||
hooked(false),
|
hooked(false),
|
||||||
wglSwapBuffers(nullptr)
|
wglSwapBuffers(nullptr)
|
||||||
{
|
{
|
||||||
_library = LoadLibrary(DLL_NAME);
|
_library = LoadLibrary(OPENGL_DLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenGL_Hook::~OpenGL_Hook()
|
OpenGL_Hook::~OpenGL_Hook()
|
||||||
|
@ -136,7 +136,7 @@ OpenGL_Hook* OpenGL_Hook::Inst()
|
||||||
|
|
||||||
const char* OpenGL_Hook::get_lib_name() const
|
const char* OpenGL_Hook::get_lib_name() const
|
||||||
{
|
{
|
||||||
return DLL_NAME;
|
return OPENGL_DLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGL_Hook::loadFunctions(wglSwapBuffers_t pfnwglSwapBuffers)
|
void OpenGL_Hook::loadFunctions(wglSwapBuffers_t pfnwglSwapBuffers)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
class OpenGL_Hook : public Base_Hook
|
class OpenGL_Hook : public Base_Hook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr const char *DLL_NAME = "opengl32.dll";
|
#define OPENGL_DLL "opengl32.dll"
|
||||||
|
|
||||||
using wglSwapBuffers_t = BOOL(WINAPI*)(HDC);
|
using wglSwapBuffers_t = BOOL(WINAPI*)(HDC);
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ Windows_Hook* Windows_Hook::Inst()
|
||||||
|
|
||||||
const char* Windows_Hook::get_lib_name() const
|
const char* Windows_Hook::get_lib_name() const
|
||||||
{
|
{
|
||||||
return DLL_NAME;
|
return WINDOWS_DLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif//EMU_OVERLAY
|
#endif//EMU_OVERLAY
|
|
@ -9,7 +9,7 @@
|
||||||
class Windows_Hook : public Base_Hook
|
class Windows_Hook : public Base_Hook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr const char* DLL_NAME = "user32.dll";
|
#define WINDOWS_DLL "user32.dll"
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Windows_Hook* _inst;
|
static Windows_Hook* _inst;
|
||||||
|
|
Loading…
Reference in New Issue