From c9793ce59208761066fa89be0e0ee6ea7fe6fdce Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 23 May 2022 17:57:45 +0200 Subject: [PATCH] Fix some formatting --- src/client/component/console.cpp | 42 +- src/client/component/scheduler.cpp | 9 +- src/client/component/scheduler.hpp | 10 +- src/client/component/splash.cpp | 22 +- src/client/main.cpp | 214 +++--- src/client/steam/interfaces/client.cpp | 609 ++++++++---------- src/client/steam/interfaces/client.hpp | 4 +- src/client/steam/interfaces/controller.cpp | 134 ++-- src/client/steam/interfaces/controller.hpp | 12 +- .../steam/interfaces/game_server_stats.cpp | 84 +-- .../steam/interfaces/game_server_stats.hpp | 3 +- src/client/steam/interfaces/http.cpp | 208 +++--- src/client/steam/interfaces/http.hpp | 34 +- src/client/steam/interfaces/screenshots.cpp | 55 +- src/client/steam/interfaces/screenshots.hpp | 3 +- .../steam/interfaces/unified_messages.cpp | 44 +- .../steam/interfaces/unified_messages.hpp | 14 +- src/client/steam/interfaces/user.cpp | 59 +- src/client/steam/steam.cpp | 80 +-- 19 files changed, 797 insertions(+), 843 deletions(-) diff --git a/src/client/component/console.cpp b/src/client/component/console.cpp index 56015321..6e1bb186 100644 --- a/src/client/component/console.cpp +++ b/src/client/component/console.cpp @@ -7,13 +7,13 @@ namespace console { - namespace - { - void create_game_console() - { - reinterpret_cast(utils::nt::library{}.get_ptr() + 0x2333F80)(); - } - } + namespace + { + void create_game_console() + { + reinterpret_cast(utils::nt::library{}.get_ptr() + 0x2333F80)(); + } + } class component final : public component_interface { @@ -24,21 +24,21 @@ namespace console this->console_runner_ = utils::thread::create_named_thread("Console IO", [this] { - create_game_console(); + create_game_console(); - MSG msg{}; - while (!this->terminate_runner_) - { - if (PeekMessageA(&msg, nullptr, NULL, NULL, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - else - { - std::this_thread::sleep_for(1ms); - } - } + MSG msg{}; + while (!this->terminate_runner_) + { + if (PeekMessageA(&msg, nullptr, NULL, NULL, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + else + { + std::this_thread::sleep_for(1ms); + } + } }); } diff --git a/src/client/component/scheduler.cpp b/src/client/component/scheduler.cpp index e8875f8a..5aa6642e 100644 --- a/src/client/component/scheduler.cpp +++ b/src/client/component/scheduler.cpp @@ -74,7 +74,8 @@ namespace scheduler { new_callbacks_.access([&](task_list& new_tasks) { - tasks.insert(tasks.end(), std::move_iterator(new_tasks.begin()), std::move_iterator(new_tasks.end())); + tasks.insert(tasks.end(), std::move_iterator(new_tasks.begin()), + std::move_iterator(new_tasks.end())); new_tasks = {}; }); }); @@ -114,7 +115,7 @@ namespace scheduler } void schedule(const std::function& callback, const pipeline type, - const std::chrono::milliseconds delay) + const std::chrono::milliseconds delay) { assert(type >= 0 && type < pipeline::count); @@ -127,7 +128,7 @@ namespace scheduler } void loop(const std::function& callback, const pipeline type, - const std::chrono::milliseconds delay) + const std::chrono::milliseconds delay) { schedule([callback]() { @@ -137,7 +138,7 @@ namespace scheduler } void once(const std::function& callback, const pipeline type, - const std::chrono::milliseconds delay) + const std::chrono::milliseconds delay) { schedule([callback]() { diff --git a/src/client/component/scheduler.hpp b/src/client/component/scheduler.hpp index f26c60ce..1e0de7a8 100644 --- a/src/client/component/scheduler.hpp +++ b/src/client/component/scheduler.hpp @@ -23,11 +23,11 @@ namespace scheduler static const bool cond_end = true; void schedule(const std::function& callback, pipeline type = pipeline::async, - std::chrono::milliseconds delay = 0ms); + std::chrono::milliseconds delay = 0ms); void loop(const std::function& callback, pipeline type = pipeline::async, - std::chrono::milliseconds delay = 0ms); + std::chrono::milliseconds delay = 0ms); void once(const std::function& callback, pipeline type = pipeline::async, - std::chrono::milliseconds delay = 0ms); + std::chrono::milliseconds delay = 0ms); void on_game_initialized(const std::function& callback, pipeline type = pipeline::async, - std::chrono::milliseconds delay = 0ms); -} \ No newline at end of file + std::chrono::milliseconds delay = 0ms); +} diff --git a/src/client/component/splash.cpp b/src/client/component/splash.cpp index dec45419..33de875b 100644 --- a/src/client/component/splash.cpp +++ b/src/client/component/splash.cpp @@ -6,14 +6,14 @@ namespace splash { -namespace -{ - HANDLE load_splash_image() - { - const auto self = utils::nt::library::get_by_address(load_splash_image); - return LoadImageA(self, MAKEINTRESOURCE(IMAGE_SPLASH), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - } -} + namespace + { + HANDLE load_splash_image() + { + const auto self = utils::nt::library::get_by_address(load_splash_image); + return LoadImageA(self, MAKEINTRESOURCE(IMAGE_SPLASH), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + } + } class component final : public component_interface { @@ -46,9 +46,9 @@ namespace this->window_ = nullptr; } - void post_unpack() override + void post_unpack() override { - this->destroy(); + this->destroy(); } private: @@ -69,7 +69,7 @@ namespace { WNDCLASSA wnd_class; - const utils::nt::library host{}; + const utils::nt::library host{}; wnd_class.style = CS_DROPSHADOW; wnd_class.cbClsExtra = 0; diff --git a/src/client/main.cpp b/src/client/main.cpp index e63a77e3..f4f9b253 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -8,124 +8,138 @@ namespace { -DECLSPEC_NORETURN void WINAPI exit_hook(const int code) -{ - component_loader::pre_destroy(); - exit(code); -} - -VOID WINAPI initialize_critical_section(const LPCRITICAL_SECTION lpCriticalSection) -{ - component_loader::post_unpack(); - InitializeCriticalSection(lpCriticalSection); -} - -void patch_imports() -{ - const utils::nt::library game{}; - const auto self = utils::nt::library::get_by_address(patch_imports); - - auto patch_steam_import = [&](const std::string& func) { - const auto game_entry = game.get_iat_entry("steam_api64.dll", func); - if (!game_entry) { - throw std::runtime_error("Import '" + func + "' not found!"); - } - - const auto self_proc = self.get_proc(func); - if (!self_proc) { - throw std::runtime_error(func + " export not found"); - } - utils::hook::set(game_entry, self_proc); - }; - - patch_steam_import("SteamAPI_RegisterCallback"); - patch_steam_import("SteamAPI_RegisterCallResult"); - patch_steam_import("SteamGameServer_Shutdown"); - patch_steam_import("SteamGameServer_RunCallbacks"); - patch_steam_import("SteamGameServer_GetHSteamPipe"); - patch_steam_import("SteamGameServer_GetHSteamUser"); - patch_steam_import("SteamInternal_GameServer_Init"); - patch_steam_import("SteamAPI_UnregisterCallResult"); - patch_steam_import("SteamAPI_UnregisterCallback"); - patch_steam_import("SteamAPI_RunCallbacks"); - //patch_steam_import("SteamAPI_Shutdown"); - patch_steam_import("SteamInternal_CreateInterface"); - patch_steam_import("SteamAPI_GetHSteamUser"); - patch_steam_import("SteamAPI_GetHSteamPipe"); - patch_steam_import("SteamAPI_Init"); - patch_steam_import("SteamAPI_RestartAppIfNecessary"); - - utils::hook::set(game.get_iat_entry("kernel32.dll", "InitializeCriticalSection"), initialize_critical_section); - utils::hook::set(game.get_iat_entry("kernel32.dll", "ExitProcess"), exit_hook); -} - -bool run() -{ - srand(uint32_t(time(nullptr)) ^ (~GetTickCount())); - + DECLSPEC_NORETURN void WINAPI exit_hook(const int code) { - auto premature_shutdown = true; - const auto _ = utils::finally([&premature_shutdown]() - { - if (premature_shutdown) - { - component_loader::pre_destroy(); - } - }); + component_loader::pre_destroy(); + exit(code); + } - try - { - patch_imports(); + VOID WINAPI initialize_critical_section(const LPCRITICAL_SECTION critical_section) + { + component_loader::post_unpack(); + InitializeCriticalSection(critical_section); + } - if (!component_loader::post_load()) + void patch_imports() + { + const utils::nt::library game{}; + const auto self = utils::nt::library::get_by_address(patch_imports); + + auto patch_steam_import = [&](const std::string& func) + { + const auto game_entry = game.get_iat_entry("steam_api64.dll", func); + if (!game_entry) { - return false; + throw std::runtime_error("Import '" + func + "' not found!"); } - premature_shutdown = false; - } - catch (std::exception& e) + const auto self_proc = self.get_proc(func); + if (!self_proc) + { + throw std::runtime_error(func + " export not found"); + } + utils::hook::set(game_entry, self_proc); + }; + + patch_steam_import("SteamAPI_RegisterCallback"); + patch_steam_import("SteamAPI_RegisterCallResult"); + patch_steam_import("SteamGameServer_Shutdown"); + patch_steam_import("SteamGameServer_RunCallbacks"); + patch_steam_import("SteamGameServer_GetHSteamPipe"); + patch_steam_import("SteamGameServer_GetHSteamUser"); + patch_steam_import("SteamInternal_GameServer_Init"); + patch_steam_import("SteamAPI_UnregisterCallResult"); + patch_steam_import("SteamAPI_UnregisterCallback"); + patch_steam_import("SteamAPI_RunCallbacks"); + //patch_steam_import("SteamAPI_Shutdown"); + patch_steam_import("SteamInternal_CreateInterface"); + patch_steam_import("SteamAPI_GetHSteamUser"); + patch_steam_import("SteamAPI_GetHSteamPipe"); + patch_steam_import("SteamAPI_Init"); + patch_steam_import("SteamAPI_RestartAppIfNecessary"); + + utils::hook::set(game.get_iat_entry("kernel32.dll", "InitializeCriticalSection"), initialize_critical_section); + utils::hook::set(game.get_iat_entry("kernel32.dll", "ExitProcess"), exit_hook); + } + + void enable_dpi_awareness() + { + const utils::nt::library user32{"user32.dll"}; + const auto set_dpi = user32 + ? user32.get_proc( + "SetProcessDpiAwarenessContext") + : nullptr; + if (set_dpi) { - MessageBoxA(nullptr, e.what(), "ERROR", MB_ICONERROR); - return false; + set_dpi(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); } } - return true; -} + bool run() + { + srand(uint32_t(time(nullptr)) ^ (~GetTickCount())); + + { + auto premature_shutdown = true; + const auto _ = utils::finally([&premature_shutdown]() + { + if (premature_shutdown) + { + component_loader::pre_destroy(); + } + }); + + try + { + enable_dpi_awareness(); + patch_imports(); + + if (!component_loader::post_load()) + { + return false; + } + + premature_shutdown = false; + } + catch (std::exception& e) + { + MessageBoxA(nullptr, e.what(), "ERROR", MB_ICONERROR); + return false; + } + } + + return true; + } } BOOL WINAPI DllMain(HINSTANCE, const DWORD reason, LPVOID) { - if (reason == DLL_PROCESS_ATTACH) { - if(!run()) { - return FALSE; - } - } - return TRUE; + if (reason == DLL_PROCESS_ATTACH) + { + if (!run()) + { + return FALSE; + } + } + return TRUE; } extern "C" __declspec(dllexport) -HRESULT D3D11CreateDevice( - void* pAdapter, - uint64_t DriverType, - HMODULE Software, - UINT Flags, - const void* pFeatureLevels, - UINT FeatureLevels, - UINT SDKVersion, - void** ppDevice, - void* pFeatureLevel, - void** ppImmediateContext -) +HRESULT D3D11CreateDevice(void* adapter, const uint64_t driver_type, + const HMODULE software, const UINT flags, + const void* p_feature_levels, const UINT feature_levels, + const UINT sdk_version, void** device, void* feature_level, + void** immediate_context) { - static auto func = [] { - char dir[MAX_PATH]{ 0 }; - GetSystemDirectoryA(dir, sizeof(dir)); + static auto func = [] + { + char dir[MAX_PATH]{0}; + GetSystemDirectoryA(dir, sizeof(dir)); - const auto d3d11 = utils::nt::library::load(dir + "/d3d11.dll"s); - return d3d11.get_proc("D3D11CreateDevice"); - }(); + const auto d3d11 = utils::nt::library::load(dir + "/d3d11.dll"s); + return d3d11.get_proc("D3D11CreateDevice"); + }(); - return func(pAdapter, DriverType, Software, Flags, pFeatureLevels, FeatureLevels, SDKVersion, ppDevice, pFeatureLevel, ppImmediateContext); + return func(adapter, driver_type, software, flags, p_feature_levels, feature_levels, sdk_version, device, + feature_level, immediate_context); } diff --git a/src/client/steam/interfaces/client.cpp b/src/client/steam/interfaces/client.cpp index e0eda062..bc4485cd 100644 --- a/src/client/steam/interfaces/client.cpp +++ b/src/client/steam/interfaces/client.cpp @@ -1,356 +1,277 @@ #include #include "../steam.hpp" -namespace steam { -namespace { - -void* get_dummy() +namespace steam { - static class blub { - public: - virtual uint64_t m0() { return 0; } - virtual uint64_t m1() { return 0; } - virtual uint64_t m2() { return 0; } - virtual uint64_t m3() { return 0; } - virtual uint64_t m4() { return 0; } - virtual uint64_t m5() { return 0; } - virtual uint64_t m6() { return 0; } - virtual uint64_t m7() { return 0; } - virtual uint64_t m8() { return 0; } - virtual uint64_t m9() { return 0; } + namespace + { + void* get_dummy() + { + class blub + { + public: + virtual uint64_t m0() { return 0; } + virtual uint64_t m1() { return 0; } + virtual uint64_t m2() { return 0; } + virtual uint64_t m3() { return 0; } + virtual uint64_t m4() { return 0; } + virtual uint64_t m5() { return 0; } + virtual uint64_t m6() { return 0; } + virtual uint64_t m7() { return 0; } + virtual uint64_t m8() { return 0; } + virtual uint64_t m9() { return 0; } - virtual uint64_t m10() { return 0; } - virtual uint64_t m11() { return 0; } - virtual uint64_t m12() { return 0; } - virtual uint64_t m13() { return 0; } - virtual uint64_t m14() { return 0; } - virtual uint64_t m15() { return 0; } - virtual uint64_t m16() { return 0; } - virtual uint64_t m17() { return 0; } - virtual uint64_t m18() { return 0; } - virtual uint64_t m19() { return 0; } + virtual uint64_t m10() { return 0; } + virtual uint64_t m11() { return 0; } + virtual uint64_t m12() { return 0; } + virtual uint64_t m13() { return 0; } + virtual uint64_t m14() { return 0; } + virtual uint64_t m15() { return 0; } + virtual uint64_t m16() { return 0; } + virtual uint64_t m17() { return 0; } + virtual uint64_t m18() { return 0; } + virtual uint64_t m19() { return 0; } - virtual uint64_t m20() { return 0; } - virtual uint64_t m21() { return 0; } - virtual uint64_t m22() { return 0; } - virtual uint64_t m23() { return 0; } - virtual uint64_t m24() { return 0; } - virtual uint64_t m25() { return 0; } - virtual uint64_t m26() { return 0; } - virtual uint64_t m27() { return 0; } - virtual uint64_t m28() { return 0; } - virtual uint64_t m29() { return 0; } + virtual uint64_t m20() { return 0; } + virtual uint64_t m21() { return 0; } + virtual uint64_t m22() { return 0; } + virtual uint64_t m23() { return 0; } + virtual uint64_t m24() { return 0; } + virtual uint64_t m25() { return 0; } + virtual uint64_t m26() { return 0; } + virtual uint64_t m27() { return 0; } + virtual uint64_t m28() { return 0; } + virtual uint64_t m29() { return 0; } - virtual uint64_t m30() { return 0; } - virtual uint64_t m31() { return 0; } - virtual uint64_t m32() { return 0; } - virtual uint64_t m33() { return 0; } - virtual uint64_t m34() { return 0; } - virtual uint64_t m35() { return 0; } - virtual uint64_t m36() { return 0; } - virtual uint64_t m37() { return 0; } - virtual uint64_t m38() { return 0; } - virtual uint64_t m39() { return 0; } + virtual uint64_t m30() { return 0; } + virtual uint64_t m31() { return 0; } + virtual uint64_t m32() { return 0; } + virtual uint64_t m33() { return 0; } + virtual uint64_t m34() { return 0; } + virtual uint64_t m35() { return 0; } + virtual uint64_t m36() { return 0; } + virtual uint64_t m37() { return 0; } + virtual uint64_t m38() { return 0; } + virtual uint64_t m39() { return 0; } - virtual uint64_t m40() { return 0; } - virtual uint64_t m41() { return 0; } - virtual uint64_t m42() { return 0; } - virtual uint64_t m43() { return 0; } - virtual uint64_t m44() { return 0; } - virtual uint64_t m45() { return 0; } - virtual uint64_t m46() { return 0; } - virtual uint64_t m47() { return 0; } - virtual uint64_t m48() { return 0; } - virtual uint64_t m49() { return 0; } + virtual uint64_t m40() { return 0; } + virtual uint64_t m41() { return 0; } + virtual uint64_t m42() { return 0; } + virtual uint64_t m43() { return 0; } + virtual uint64_t m44() { return 0; } + virtual uint64_t m45() { return 0; } + virtual uint64_t m46() { return 0; } + virtual uint64_t m47() { return 0; } + virtual uint64_t m48() { return 0; } + virtual uint64_t m49() { return 0; } - virtual uint64_t m50() { return 0; } - virtual uint64_t m51() { return 0; } - virtual uint64_t m52() { return 0; } - virtual uint64_t m53() { return 0; } - virtual uint64_t m54() { return 0; } - virtual uint64_t m55() { return 0; } - virtual uint64_t m56() { return 0; } - virtual uint64_t m57() { return 0; } - virtual uint64_t m58() { return 0; } - virtual uint64_t m59() { return 0; } + virtual uint64_t m50() { return 0; } + virtual uint64_t m51() { return 0; } + virtual uint64_t m52() { return 0; } + virtual uint64_t m53() { return 0; } + virtual uint64_t m54() { return 0; } + virtual uint64_t m55() { return 0; } + virtual uint64_t m56() { return 0; } + virtual uint64_t m57() { return 0; } + virtual uint64_t m58() { return 0; } + virtual uint64_t m59() { return 0; } - virtual uint64_t m60() { return 0; } - virtual uint64_t m61() { return 0; } - virtual uint64_t m62() { return 0; } - virtual uint64_t m63() { return 0; } - virtual uint64_t m64() { return 0; } - virtual uint64_t m65() { return 0; } - virtual uint64_t m66() { return 0; } - virtual uint64_t m67() { return 0; } - virtual uint64_t m68() { return 0; } - virtual uint64_t m69() { return 0; } + virtual uint64_t m60() { return 0; } + virtual uint64_t m61() { return 0; } + virtual uint64_t m62() { return 0; } + virtual uint64_t m63() { return 0; } + virtual uint64_t m64() { return 0; } + virtual uint64_t m65() { return 0; } + virtual uint64_t m66() { return 0; } + virtual uint64_t m67() { return 0; } + virtual uint64_t m68() { return 0; } + virtual uint64_t m69() { return 0; } + } x; + return &x; + } + } - } x; - return &x; -} - -} - -HSteamPipe client::CreateSteamPipe() -{ - OutputDebugStringA(__FUNCTION__); - return 1; -} - -bool client::BReleaseSteamPipe(HSteamPipe hSteamPipe) -{ - OutputDebugStringA(__FUNCTION__); - return true; -} - -HSteamUser client::ConnectToGlobalUser(HSteamPipe hSteamPipe) -{ - OutputDebugStringA(__FUNCTION__); - return 1; -} - -HSteamUser client::CreateLocalUser(HSteamPipe* phSteamPipe, uint32_t eAccountType) -{ - OutputDebugStringA(__FUNCTION__); - return 1; -} - -void client::ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) -{ - OutputDebugStringA(__FUNCTION__); -} - -void* client::GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - return SteamUser(); -} - -void* client::GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamGameServer(); -} - -void client::SetLocalIPBinding(uint32_t unIP, uint16_t usPort) -{ - OutputDebugStringA(__FUNCTION__); -} - -void* client::GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - return SteamFriends(); -} - -void* client::GetISteamUtils(HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamUtils(); -} - -void* client::GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamMatchmaking(); -} - -void* client::GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - static matchmaking_servers u; - return &u; -} - -void* client::GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return nullptr; -} - -void* client::GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamUserStats(); -} - -void* client::GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - static game_server_stats u; - return &u; -} - -void* client::GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamApps(); -} - -void* client::GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamNetworking(); -} - -void* client::GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - return SteamRemoteStorage(); -} - -void* client::GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - static screenshots s; - return &s; -} - -void client::RunFrame() -{ - OutputDebugStringA(__FUNCTION__); -} - -uint32_t client::GetIPCCallCount() -{ - OutputDebugStringA(__FUNCTION__); - return 0; -} - -void client::SetWarningMessageHook(void* pFunction) -{ - OutputDebugStringA(__FUNCTION__); -} - -bool client::BShutdownIfAllPipesClosed() -{ - OutputDebugStringA(__FUNCTION__); - return true; -} - -void* client::GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - - static http h; - return &h; -} - -void* client::GetISteamUnifiedMessages(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - static unified_messages u; - return &u; // -} - -void* client::GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - - static controller c; - return &c; // -} - -void* client::GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); // -} - -void* client::GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); // -} - -void* client::GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); // -} - -void* client::GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); // -} - -void* client::GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); // -} - -void client::Set_SteamAPI_CPostAPIResultInProcess(void* func) -{ - OutputDebugStringA(__FUNCTION__); -} - -void client::Remove_SteamAPI_CPostAPIResultInProcess(void* func) -{ - OutputDebugStringA(__FUNCTION__); -} - -void client::Set_SteamAPI_CCheckCallbackRegisteredInProcess(void* func) -{ - OutputDebugStringA(__FUNCTION__); -} - -void* client::GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); -} - -void* client::GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy();// -} - -void* client::GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) -{ - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(pchVersion); - //MessageBoxA(0, pchVersion, 0, 0); - return get_dummy(); -} + HSteamPipe client::CreateSteamPipe() + { + return 1; + } + + bool client::BReleaseSteamPipe(HSteamPipe hSteamPipe) + { + return true; + } + + HSteamUser client::ConnectToGlobalUser(HSteamPipe hSteamPipe) + { + return 1; + } + + HSteamUser client::CreateLocalUser(HSteamPipe* phSteamPipe, uint32_t eAccountType) + { + return 1; + } + + void client::ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) + { + } + + void* client::GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamUser(); + } + + void* client::GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamGameServer(); + } + + void client::SetLocalIPBinding(uint32_t unIP, uint16_t usPort) + { + } + + void* client::GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamFriends(); + } + + void* client::GetISteamUtils(HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamUtils(); + } + + void* client::GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamMatchmaking(); + } + + void* client::GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + static matchmaking_servers u; + return &u; + } + + void* client::GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return nullptr; + } + + void* client::GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamUserStats(); + } + + void* client::GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + static game_server_stats u; + return &u; + } + + void* client::GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamApps(); + } + + void* client::GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamNetworking(); + } + + void* client::GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return SteamRemoteStorage(); + } + + void* client::GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + static screenshots s; + return &s; + } + + void client::RunFrame() + { + } + + uint32_t client::GetIPCCallCount() + { + return 0; + } + + void client::SetWarningMessageHook(void* pFunction) + { + } + + bool client::BShutdownIfAllPipesClosed() + { + return true; + } + + void* client::GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + static http h; + return &h; + } + + void* client::GetISteamUnifiedMessages(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + static unified_messages u; + return &u; + } + + void* client::GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + static controller c; + return &c; + } + + void* client::GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } + + void* client::GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } + + void* client::GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } + + void* client::GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } + + void* client::GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } + + void client::Set_SteamAPI_CPostAPIResultInProcess(void* func) + { + } + + void client::Remove_SteamAPI_CPostAPIResultInProcess(void* func) + { + } + + void client::Set_SteamAPI_CCheckCallbackRegisteredInProcess(void* func) + { + } + + void* client::GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } + + void* client::GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); // + } + + void* client::GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion) + { + return get_dummy(); + } } diff --git a/src/client/steam/interfaces/client.hpp b/src/client/steam/interfaces/client.hpp index 85c0a6a9..4146ec94 100644 --- a/src/client/steam/interfaces/client.hpp +++ b/src/client/steam/interfaces/client.hpp @@ -3,8 +3,8 @@ namespace steam { - using HSteamPipe = uint64_t; -using HSteamUser = uint64_t; + using HSteamPipe = uint64_t; + using HSteamUser = uint64_t; class client { diff --git a/src/client/steam/interfaces/controller.cpp b/src/client/steam/interfaces/controller.cpp index 6772babe..f74f14a7 100644 --- a/src/client/steam/interfaces/controller.cpp +++ b/src/client/steam/interfaces/controller.cpp @@ -3,72 +3,82 @@ namespace steam { - bool controller::Init() - { - return true; - } - bool controller::Shutdown() - { - return true; - } + bool controller::Init() + { + return true; + } - void controller::RunFrame() - { + bool controller::Shutdown() + { + return true; + } - } - int controller::GetConnectedControllers(ControllerHandle_t* handlesOut) - { - return 0; - } + void controller::RunFrame() + { + } - bool controller::ShowBindingPanel(ControllerHandle_t controllerHandle) - { - return false; - } - uint64_t controller::GetActionSetHandle(const char* pszActionSetName) - { - return 0; - } - void controller::ActivateActionSet(ControllerHandle_t controllerHandle, uint64_t actionSetHandle) - { + int controller::GetConnectedControllers(ControllerHandle_t* handlesOut) + { + return 0; + } - } - uint64_t controller::GetCurrentActionSet(ControllerHandle_t controllerHandle) - { - return 0; - } - uint64_t controller::GetDigitalActionHandle(const char* pszActionName) - { - return 0; - } + bool controller::ShowBindingPanel(ControllerHandle_t controllerHandle) + { + return false; + } - uint64_t controller::GetDigitalActionData(ControllerHandle_t controllerHandle, uint64_t digitalActionHandle) - { - return 0; - } - int controller::GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, uint64_t digitalActionHandle, uint64_t* originsOut) - { - return 0; - } - uint64_t controller::GetAnalogActionHandle(const char* pszActionName) - { - return 0; - } - uint64_t controller::GetAnalogActionData(ControllerHandle_t controllerHandle, uint64_t analogActionHandle) - { - return 0; - } - int controller::GetAnalogActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, uint64_t analogActionHandle, uint64_t* originsOut) - { - return 0; - } - void controller::StopAnalogActionMomentum(ControllerHandle_t controllerHandle, uint64_t eAction) - { - - } + uint64_t controller::GetActionSetHandle(const char* pszActionSetName) + { + return 0; + } - void controller::TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad, unsigned short usDurationMicroSec) - { - - } + void controller::ActivateActionSet(ControllerHandle_t controllerHandle, uint64_t actionSetHandle) + { + } + + uint64_t controller::GetCurrentActionSet(ControllerHandle_t controllerHandle) + { + return 0; + } + + uint64_t controller::GetDigitalActionHandle(const char* pszActionName) + { + return 0; + } + + uint64_t controller::GetDigitalActionData(ControllerHandle_t controllerHandle, uint64_t digitalActionHandle) + { + return 0; + } + + int controller::GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, + uint64_t digitalActionHandle, uint64_t* originsOut) + { + return 0; + } + + uint64_t controller::GetAnalogActionHandle(const char* pszActionName) + { + return 0; + } + + uint64_t controller::GetAnalogActionData(ControllerHandle_t controllerHandle, uint64_t analogActionHandle) + { + return 0; + } + + int controller::GetAnalogActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, + uint64_t analogActionHandle, uint64_t* originsOut) + { + return 0; + } + + void controller::StopAnalogActionMomentum(ControllerHandle_t controllerHandle, uint64_t eAction) + { + } + + void controller::TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad, + unsigned short usDurationMicroSec) + { + } } diff --git a/src/client/steam/interfaces/controller.hpp b/src/client/steam/interfaces/controller.hpp index 1d2d27f7..51bf8034 100644 --- a/src/client/steam/interfaces/controller.hpp +++ b/src/client/steam/interfaces/controller.hpp @@ -2,7 +2,8 @@ namespace steam { - using ControllerHandle_t = uint64_t; + using ControllerHandle_t = uint64_t; + class controller { public: @@ -18,11 +19,14 @@ namespace steam virtual uint64_t GetCurrentActionSet(ControllerHandle_t controllerHandle); virtual uint64_t GetDigitalActionHandle(const char* pszActionName); virtual uint64_t GetDigitalActionData(ControllerHandle_t controllerHandle, uint64_t digitalActionHandle); - virtual int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, uint64_t digitalActionHandle, uint64_t* originsOut); + virtual int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, + uint64_t digitalActionHandle, uint64_t* originsOut); virtual uint64_t GetAnalogActionHandle(const char* pszActionName); virtual uint64_t GetAnalogActionData(ControllerHandle_t controllerHandle, uint64_t analogActionHandle); - virtual int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, uint64_t analogActionHandle, uint64_t* originsOut); + virtual int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, + uint64_t analogActionHandle, uint64_t* originsOut); virtual void StopAnalogActionMomentum(ControllerHandle_t controllerHandle, uint64_t eAction); - virtual void TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad, unsigned short usDurationMicroSec); + virtual void TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad, + unsigned short usDurationMicroSec); }; } diff --git a/src/client/steam/interfaces/game_server_stats.cpp b/src/client/steam/interfaces/game_server_stats.cpp index 96198098..9eb49238 100644 --- a/src/client/steam/interfaces/game_server_stats.cpp +++ b/src/client/steam/interfaces/game_server_stats.cpp @@ -1,56 +1,56 @@ #include #include "../steam.hpp" -namespace steam { -uint64_t game_server_stats::RequestUserStats(steam_id steamIDUser) +namespace steam { - return 0; -} + uint64_t game_server_stats::RequestUserStats(steam_id steamIDUser) + { + return 0; + } -bool game_server_stats::GetUserStat(steam_id steamIDUser, const char* pchName, int32_t* pData) -{ - return false; -} + bool game_server_stats::GetUserStat(steam_id steamIDUser, const char* pchName, int32_t* pData) + { + return false; + } -bool game_server_stats::GetUserStat(steam_id steamIDUser, const char* pchName, float* pData) -{ - return false; -} + bool game_server_stats::GetUserStat(steam_id steamIDUser, const char* pchName, float* pData) + { + return false; + } -bool game_server_stats::GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved) -{ - return false; -} + bool game_server_stats::GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved) + { + return false; + } -bool game_server_stats::SetUserStat(steam_id steamIDUser, const char* pchName, int32_t nData) -{ - return false; -} + bool game_server_stats::SetUserStat(steam_id steamIDUser, const char* pchName, int32_t nData) + { + return false; + } -bool game_server_stats::SetUserStat(steam_id steamIDUser, const char* pchName, float fData) -{ - return false; -} + bool game_server_stats::SetUserStat(steam_id steamIDUser, const char* pchName, float fData) + { + return false; + } -bool game_server_stats::UpdateUserAvgRateStat(steam_id steamIDUser, const char* pchName, float flCountThisSession, - double dSessionLength) -{ - return false; -} + bool game_server_stats::UpdateUserAvgRateStat(steam_id steamIDUser, const char* pchName, float flCountThisSession, + double dSessionLength) + { + return false; + } -bool game_server_stats::SetUserAchievement(steam_id steamIDUser, const char* pchName) -{ - return false; -} + bool game_server_stats::SetUserAchievement(steam_id steamIDUser, const char* pchName) + { + return false; + } -bool game_server_stats::ClearUserAchievement(steam_id steamIDUser, const char* pchName) -{ - return false; -} - -uint64_t game_server_stats::StoreUserStats(steam_id steamIDUser) -{ - return 0; -} + bool game_server_stats::ClearUserAchievement(steam_id steamIDUser, const char* pchName) + { + return false; + } + uint64_t game_server_stats::StoreUserStats(steam_id steamIDUser) + { + return 0; + } } diff --git a/src/client/steam/interfaces/game_server_stats.hpp b/src/client/steam/interfaces/game_server_stats.hpp index 07151ed9..a8b9735f 100644 --- a/src/client/steam/interfaces/game_server_stats.hpp +++ b/src/client/steam/interfaces/game_server_stats.hpp @@ -13,7 +13,8 @@ namespace steam virtual bool GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved); virtual bool SetUserStat(steam_id steamIDUser, const char* pchName, int32_t nData); virtual bool SetUserStat(steam_id steamIDUser, const char* pchName, float fData); - virtual bool UpdateUserAvgRateStat(steam_id steamIDUser, const char* pchName, float flCountThisSession, double dSessionLength); + virtual bool UpdateUserAvgRateStat(steam_id steamIDUser, const char* pchName, float flCountThisSession, + double dSessionLength); virtual bool SetUserAchievement(steam_id steamIDUser, const char* pchName); virtual bool ClearUserAchievement(steam_id steamIDUser, const char* pchName); virtual uint64_t StoreUserStats(steam_id steamIDUser); diff --git a/src/client/steam/interfaces/http.cpp b/src/client/steam/interfaces/http.cpp index c9f701de..5505ca0a 100644 --- a/src/client/steam/interfaces/http.cpp +++ b/src/client/steam/interfaces/http.cpp @@ -1,131 +1,137 @@ #include #include "../steam.hpp" - namespace steam { - HTTPRequestHandle http::http::CreateHTTPRequest(uint32_t eHTTPRequestMethod, const char* pchAbsoluteURL) - { - return 0; - } + HTTPRequestHandle http::http::CreateHTTPRequest(uint32_t eHTTPRequestMethod, const char* pchAbsoluteURL) + { + return 0; + } - bool http::SetHTTPRequestContextValue(HTTPRequestHandle hRequest, uint64_t ulContextValue) - { - return false; - } + bool http::SetHTTPRequestContextValue(HTTPRequestHandle hRequest, uint64_t ulContextValue) + { + return false; + } - bool http::SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint32_t unTimeoutSeconds) - { - return false; - } + bool http::SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint32_t unTimeoutSeconds) + { + return false; + } - bool http::SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, const char* pchHeaderValue) - { - return false; - } + bool http::SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, + const char* pchHeaderValue) + { + return false; + } - bool http::SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName, const char* pchParamValue) - { - return false; - } + bool http::SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName, + const char* pchParamValue) + { + return false; + } - bool http::SendHTTPRequest(HTTPRequestHandle hRequest, uint64_t* pCallHandle) - { - return false; - } + bool http::SendHTTPRequest(HTTPRequestHandle hRequest, uint64_t* pCallHandle) + { + return false; + } - bool http::SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, uint64_t* pCallHandle) - { - return false; - } + bool http::SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, uint64_t* pCallHandle) + { + return false; + } - bool http::DeferHTTPRequest(HTTPRequestHandle hRequest) - { - return false; - } + bool http::DeferHTTPRequest(HTTPRequestHandle hRequest) + { + return false; + } - bool http::PrioritizeHTTPRequest(HTTPRequestHandle hRequest) - { - return false; - } + bool http::PrioritizeHTTPRequest(HTTPRequestHandle hRequest) + { + return false; + } - bool http::GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName, uint32_t* unResponseHeaderSize) - { - return false; - } + bool http::GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName, + uint32_t* unResponseHeaderSize) + { + return false; + } - bool http::GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, uint8_t* pHeaderValueBuffer, uint32_t unBufferSize) - { - return false; - } + bool http::GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, + uint8_t* pHeaderValueBuffer, uint32_t unBufferSize) + { + return false; + } - bool http::GetHTTPResponseBodySize(HTTPRequestHandle hRequest, uint32_t* unBodySize) - { - return false; - } + bool http::GetHTTPResponseBodySize(HTTPRequestHandle hRequest, uint32_t* unBodySize) + { + return false; + } - bool http::GetHTTPResponseBodyData(HTTPRequestHandle hRequest, uint8_t* pBodyDataBuffer, uint32_t unBufferSize) - { - return false; - } + bool http::GetHTTPResponseBodyData(HTTPRequestHandle hRequest, uint8_t* pBodyDataBuffer, uint32_t unBufferSize) + { + return false; + } - bool http::GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, uint8_t* pBodyDataBuffer, uint32_t unBufferSize) - { - return false; - } + bool http::GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, uint8_t* pBodyDataBuffer, + uint32_t unBufferSize) + { + return false; + } - bool http::ReleaseHTTPRequest(HTTPRequestHandle hRequest) - { - return false; - } + bool http::ReleaseHTTPRequest(HTTPRequestHandle hRequest) + { + return false; + } - bool http::GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, float* pflPercentOut) - { - return false; - } + bool http::GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, float* pflPercentOut) + { + return false; + } - bool http::SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody, uint32_t unBodyLen) - { - return false; - } + bool http::SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody, + uint32_t unBodyLen) + { + return false; + } - HTTPCookieContainerHandle http::CreateCookieContainer(bool bAllowResponsesToModify) - { - return 0; - } + HTTPCookieContainerHandle http::CreateCookieContainer(bool bAllowResponsesToModify) + { + return 0; + } - bool http::ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) - { - return false; - } + bool http::ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) + { + return false; + } - bool http::SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl, const char* pchCookie) - { - return false; - } + bool http::SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl, + const char* pchCookie) + { + return false; + } - bool http::SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) - { - return false; - } + bool http::SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) + { + return false; + } - bool http::SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, const char* pchUserAgentInfo) - { - return false; - } + bool http::SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, const char* pchUserAgentInfo) + { + return false; + } - bool http::SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) - { - return false; - } + bool http::SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) + { + return false; + } - bool http::SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint32_t unMilliseconds) - { - return false; - } + bool http::SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint32_t unMilliseconds) + { + return false; + } - bool http::GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, bool* pbWasTimedOut) - { - return false; - } + bool http::GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, bool* pbWasTimedOut) + { + return false; + } } diff --git a/src/client/steam/interfaces/http.hpp b/src/client/steam/interfaces/http.hpp index 8f2eb0fe..ad8c6ed5 100644 --- a/src/client/steam/interfaces/http.hpp +++ b/src/client/steam/interfaces/http.hpp @@ -2,8 +2,8 @@ namespace steam { - using HTTPRequestHandle = uint64_t; - using HTTPCookieContainerHandle = uint64_t; + using HTTPRequestHandle = uint64_t; + using HTTPCookieContainerHandle = uint64_t; class http { @@ -13,26 +13,36 @@ namespace steam virtual HTTPRequestHandle CreateHTTPRequest(uint32_t eHTTPRequestMethod, const char* pchAbsoluteURL); virtual bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, uint64_t ulContextValue); virtual bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint32_t unTimeoutSeconds); - virtual bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, const char* pchHeaderValue); - virtual bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName, const char* pchParamValue); + virtual bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, + const char* pchHeaderValue); + virtual bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName, + const char* pchParamValue); virtual bool SendHTTPRequest(HTTPRequestHandle hRequest, uint64_t* pCallHandle); virtual bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, uint64_t* pCallHandle); virtual bool DeferHTTPRequest(HTTPRequestHandle hRequest); virtual bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest); - virtual bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName, uint32_t* unResponseHeaderSize); - virtual bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, uint8_t* pHeaderValueBuffer, uint32_t unBufferSize); + virtual bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName, + uint32_t* unResponseHeaderSize); + virtual bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, + uint8_t* pHeaderValueBuffer, uint32_t unBufferSize); virtual bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, uint32_t* unBodySize); - virtual bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, uint8_t* pBodyDataBuffer, uint32_t unBufferSize); - virtual bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, uint8_t* pBodyDataBuffer, uint32_t unBufferSize); + virtual bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, uint8_t* pBodyDataBuffer, + uint32_t unBufferSize); + virtual bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, + uint8_t* pBodyDataBuffer, uint32_t unBufferSize); virtual bool ReleaseHTTPRequest(HTTPRequestHandle hRequest); virtual bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, float* pflPercentOut); - virtual bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody, uint32_t unBodyLen); + virtual bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody, + uint32_t unBodyLen); virtual HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify); virtual bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer); - virtual bool SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl, const char* pchCookie); - virtual bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer); + virtual bool SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl, + const char* pchCookie); + virtual bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, + HTTPCookieContainerHandle hCookieContainer); virtual bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, const char* pchUserAgentInfo); - virtual bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate); + virtual bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, + bool bRequireVerifiedCertificate); virtual bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint32_t unMilliseconds); virtual bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, bool* pbWasTimedOut); }; diff --git a/src/client/steam/interfaces/screenshots.cpp b/src/client/steam/interfaces/screenshots.cpp index cd34b47e..a63e300c 100644 --- a/src/client/steam/interfaces/screenshots.cpp +++ b/src/client/steam/interfaces/screenshots.cpp @@ -3,38 +3,37 @@ namespace steam { - uint64_t screenshots::WriteScreenshot(void* pubRGB, uint32_t cubRGB, int nWidth, int nHeight) - { - return 0; - } + uint64_t screenshots::WriteScreenshot(void* pubRGB, uint32_t cubRGB, int nWidth, int nHeight) + { + return 0; + } - uint64_t screenshots::AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth, int nHeight) - { - return 0; - } + uint64_t screenshots::AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth, + int nHeight) + { + return 0; + } - void screenshots::TriggerScreenshot() - { - - } + void screenshots::TriggerScreenshot() + { + } - void screenshots::HookScreenshots(bool bHook) - { - - } + void screenshots::HookScreenshots(bool bHook) + { + } - bool screenshots::SetLocation(uint64_t hScreenshot, const char* pchLocation) - { - return false; - } + bool screenshots::SetLocation(uint64_t hScreenshot, const char* pchLocation) + { + return false; + } - bool screenshots::TagUser(uint64_t hScreenshot, steam_id steamID) - { - return false; - } + bool screenshots::TagUser(uint64_t hScreenshot, steam_id steamID) + { + return false; + } - bool screenshots::TagPublishedFile(uint64_t hScreenshot, uint64_t unPublishedFileID) - { - return false; - } + bool screenshots::TagPublishedFile(uint64_t hScreenshot, uint64_t unPublishedFileID) + { + return false; + } } diff --git a/src/client/steam/interfaces/screenshots.hpp b/src/client/steam/interfaces/screenshots.hpp index 0a6e9db3..153ed732 100644 --- a/src/client/steam/interfaces/screenshots.hpp +++ b/src/client/steam/interfaces/screenshots.hpp @@ -8,7 +8,8 @@ namespace steam ~screenshots() = default; virtual uint64_t WriteScreenshot(void* pubRGB, uint32_t cubRGB, int nWidth, int nHeight); - virtual uint64_t AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth, int nHeight); + virtual uint64_t AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth, + int nHeight); virtual void TriggerScreenshot(); virtual void HookScreenshots(bool bHook); virtual bool SetLocation(uint64_t hScreenshot, const char* pchLocation); diff --git a/src/client/steam/interfaces/unified_messages.cpp b/src/client/steam/interfaces/unified_messages.cpp index 8e9462ae..fd1b9516 100644 --- a/src/client/steam/interfaces/unified_messages.cpp +++ b/src/client/steam/interfaces/unified_messages.cpp @@ -3,28 +3,32 @@ namespace steam { - ClientUnifiedMessageHandle unified_messages::SendMethod(const char* pchServiceMethod, const void* pRequestBuffer, uint32_t unRequestBufferSize, uint64_t unContext) - { - return 0; - } + ClientUnifiedMessageHandle unified_messages::SendMethod(const char* pchServiceMethod, const void* pRequestBuffer, + uint32_t unRequestBufferSize, uint64_t unContext) + { + return 0; + } - bool unified_messages::GetMethodResponseInfo(ClientUnifiedMessageHandle hHandle, uint32_t* punResponseSize, uint32_t* peResult) - { - return false; - } + bool unified_messages::GetMethodResponseInfo(ClientUnifiedMessageHandle hHandle, uint32_t* punResponseSize, + uint32_t* peResult) + { + return false; + } - bool unified_messages::GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer, uint32_t unResponseBufferSize, bool bAutoRelease) - { - return false; - } + bool unified_messages::GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer, + uint32_t unResponseBufferSize, bool bAutoRelease) + { + return false; + } - bool unified_messages::ReleaseMethod(ClientUnifiedMessageHandle hHandle) - { - return false; - } + bool unified_messages::ReleaseMethod(ClientUnifiedMessageHandle hHandle) + { + return false; + } - bool unified_messages::SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer, uint32_t unNotificationBufferSize) - { - return false; - } + bool unified_messages::SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer, + uint32_t unNotificationBufferSize) + { + return false; + } } diff --git a/src/client/steam/interfaces/unified_messages.hpp b/src/client/steam/interfaces/unified_messages.hpp index 22722555..398326c8 100644 --- a/src/client/steam/interfaces/unified_messages.hpp +++ b/src/client/steam/interfaces/unified_messages.hpp @@ -2,17 +2,21 @@ namespace steam { - using ClientUnifiedMessageHandle = uint64_t; + using ClientUnifiedMessageHandle = uint64_t; class unified_messages { public: ~unified_messages() = default; - virtual ClientUnifiedMessageHandle SendMethod(const char* pchServiceMethod, const void* pRequestBuffer, uint32_t unRequestBufferSize, uint64_t unContext); - virtual bool GetMethodResponseInfo(ClientUnifiedMessageHandle hHandle, uint32_t* punResponseSize, uint32_t* peResult); - virtual bool GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer, uint32_t unResponseBufferSize, bool bAutoRelease); + virtual ClientUnifiedMessageHandle SendMethod(const char* pchServiceMethod, const void* pRequestBuffer, + uint32_t unRequestBufferSize, uint64_t unContext); + virtual bool GetMethodResponseInfo(ClientUnifiedMessageHandle hHandle, uint32_t* punResponseSize, + uint32_t* peResult); + virtual bool GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer, + uint32_t unResponseBufferSize, bool bAutoRelease); virtual bool ReleaseMethod(ClientUnifiedMessageHandle hHandle); - virtual bool SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer, uint32_t unNotificationBufferSize); + virtual bool SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer, + uint32_t unNotificationBufferSize); }; } diff --git a/src/client/steam/interfaces/user.cpp b/src/client/steam/interfaces/user.cpp index e52bf004..c344bf78 100644 --- a/src/client/steam/interfaces/user.cpp +++ b/src/client/steam/interfaces/user.cpp @@ -139,7 +139,8 @@ namespace steam // Create the call response const auto result = callbacks::register_call(); - const auto retvals = static_cast(calloc(1, sizeof(encrypted_app_ticket_response))); + const auto retvals = static_cast(calloc( + 1, sizeof(encrypted_app_ticket_response))); //::Utils::Memory::AllocateArray(); retvals->m_e_result = 1; @@ -161,34 +162,38 @@ namespace steam return true; } - int user::GetGameBadgeLevel(int nSeries, bool bFoil) + int user::GetGameBadgeLevel(int nSeries, bool bFoil) { - return 1; + return 1; } - int user::GetPlayerSteamLevel() - { - return 0; - } - uint64_t user::RequestStoreAuthURL(const char* pchRedirectURL) - { - return 0; - } - bool user::BIsPhoneVerified() - { - return true; - } - bool user::BIsTwoFactorEnabled() - { - return true; - } + int user::GetPlayerSteamLevel() + { + return 0; + } - bool user::BIsPhoneIdentifying() - { - return false; - } - bool user::BIsPhoneRequiringVerification() - { - return false; - } + uint64_t user::RequestStoreAuthURL(const char* pchRedirectURL) + { + return 0; + } + + bool user::BIsPhoneVerified() + { + return true; + } + + bool user::BIsTwoFactorEnabled() + { + return true; + } + + bool user::BIsPhoneIdentifying() + { + return false; + } + + bool user::BIsPhoneRequiringVerification() + { + return false; + } } diff --git a/src/client/steam/steam.cpp b/src/client/steam/steam.cpp index 7c99955e..9dbdae42 100644 --- a/src/client/steam/steam.cpp +++ b/src/client/steam/steam.cpp @@ -105,13 +105,11 @@ namespace steam bool SteamAPI_RestartAppIfNecessary() { - OutputDebugStringA(__FUNCTION__); return false; } bool SteamAPI_Init() { - OutputDebugStringA(__FUNCTION__); const std::filesystem::path steam_path = steam::SteamAPI_GetSteamInstallPath(); if (steam_path.empty()) return true; @@ -124,42 +122,35 @@ namespace steam void SteamAPI_RegisterCallResult(callbacks::base* result, const uint64_t call) { - OutputDebugStringA(__FUNCTION__); callbacks::register_call_result(call, result); } void SteamAPI_RegisterCallback(callbacks::base* handler, const int callback) { - OutputDebugStringA(__FUNCTION__); callbacks::register_callback(handler, callback); } void SteamAPI_RunCallbacks() { - OutputDebugStringA(__FUNCTION__); callbacks::run_callbacks(); } void SteamAPI_Shutdown() { - OutputDebugStringA(__FUNCTION__); } void SteamAPI_UnregisterCallResult(callbacks::base* result, const uint64_t call) { - OutputDebugStringA(__FUNCTION__); callbacks::unregister_call_result(call, result); } void SteamAPI_UnregisterCallback(callbacks::base* handler) { - OutputDebugStringA(__FUNCTION__); callbacks::unregister_callback(handler); } const char* SteamAPI_GetSteamInstallPath() { - OutputDebugStringA(__FUNCTION__); static std::string install_path{}; if (!install_path.empty()) { @@ -182,126 +173,109 @@ namespace steam return install_path.data(); } - void* SteamGameServer_GetHSteamPipe() + + void* SteamGameServer_GetHSteamPipe() { - OutputDebugStringA(__FUNCTION__); - return (void*)1; + return reinterpret_cast(1); } -void* SteamGameServer_GetHSteamUser() + void* SteamGameServer_GetHSteamUser() { - OutputDebugStringA(__FUNCTION__); - return (void*)1; + return reinterpret_cast(1); } -void* SteamAPI_GetHSteamUser() -{ - OutputDebugStringA(__FUNCTION__); - return (void*)1; -} - -void* SteamAPI_GetHSteamPipe() -{ - OutputDebugStringA(__FUNCTION__); - return (void*)1; -} - -void* SteamInternal_CreateInterface(const char* interfacename) + void* SteamAPI_GetHSteamUser() { - OutputDebugStringA(__FUNCTION__); - OutputDebugStringA(interfacename); - if(std::string(interfacename) == "SteamClient017") { - static client c; - return &c; - } - - - MessageBoxA(0, interfacename, __FUNCTION__, 0); - return nullptr;//::utils::nt::library("steam_api64.dll").invoke("SteamInternal_CreateInterface", interfacename); + return reinterpret_cast(1); } -bool SteamInternal_GameServer_Init() + void* SteamAPI_GetHSteamPipe() { - OutputDebugStringA(__FUNCTION__); - return true; + return reinterpret_cast(1); + } + + void* SteamInternal_CreateInterface(const char* interfacename) + { + if (std::string(interfacename) == "SteamClient017") + { + static client c; + return &c; + } + + + MessageBoxA(0, interfacename, __FUNCTION__, 0); + return nullptr; + } + + bool SteamInternal_GameServer_Init() + { + return true; } bool SteamGameServer_Init() { - OutputDebugStringA(__FUNCTION__); return true; } void SteamGameServer_RunCallbacks() { - OutputDebugStringA(__FUNCTION__); } void SteamGameServer_Shutdown() { - OutputDebugStringA(__FUNCTION__); } friends* SteamFriends() { - OutputDebugStringA(__FUNCTION__); static friends friends; return &friends; } matchmaking* SteamMatchmaking() { - OutputDebugStringA(__FUNCTION__); static matchmaking matchmaking; return &matchmaking; } game_server* SteamGameServer() { - OutputDebugStringA(__FUNCTION__); static game_server game_server; return &game_server; } networking* SteamNetworking() { - OutputDebugStringA(__FUNCTION__); static networking networking; return &networking; } remote_storage* SteamRemoteStorage() { - OutputDebugStringA(__FUNCTION__); static remote_storage remote_storage; return &remote_storage; } user* SteamUser() { - OutputDebugStringA(__FUNCTION__); static user user; return &user; } utils* SteamUtils() { - OutputDebugStringA(__FUNCTION__); static utils utils; return &utils; } apps* SteamApps() { - OutputDebugStringA(__FUNCTION__); static apps apps; return &apps; } user_stats* SteamUserStats() { - OutputDebugStringA(__FUNCTION__); static user_stats user_stats; return &user_stats; }