Fix some formatting

This commit is contained in:
momo5502 2022-05-23 17:57:45 +02:00
parent feb1282e03
commit c9793ce592
19 changed files with 797 additions and 843 deletions

View File

@ -74,7 +74,8 @@ namespace scheduler
{
new_callbacks_.access([&](task_list& new_tasks)
{
tasks.insert(tasks.end(), std::move_iterator<task_list::iterator>(new_tasks.begin()), std::move_iterator<task_list::iterator>(new_tasks.end()));
tasks.insert(tasks.end(), std::move_iterator<task_list::iterator>(new_tasks.begin()),
std::move_iterator<task_list::iterator>(new_tasks.end()));
new_tasks = {};
});
});

View File

@ -6,14 +6,14 @@
namespace splash
{
namespace
{
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
{

View File

@ -8,31 +8,34 @@
namespace
{
DECLSPEC_NORETURN void WINAPI exit_hook(const int code)
{
DECLSPEC_NORETURN void WINAPI exit_hook(const int code)
{
component_loader::pre_destroy();
exit(code);
}
}
VOID WINAPI initialize_critical_section(const LPCRITICAL_SECTION lpCriticalSection)
{
VOID WINAPI initialize_critical_section(const LPCRITICAL_SECTION critical_section)
{
component_loader::post_unpack();
InitializeCriticalSection(lpCriticalSection);
}
InitializeCriticalSection(critical_section);
}
void patch_imports()
{
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) {
auto patch_steam_import = [&](const std::string& func)
{
const auto game_entry = game.get_iat_entry("steam_api64.dll", func);
if (!game_entry) {
if (!game_entry)
{
throw std::runtime_error("Import '" + func + "' not found!");
}
const auto self_proc = self.get_proc<void*>(func);
if (!self_proc) {
if (!self_proc)
{
throw std::runtime_error(func + " export not found");
}
utils::hook::set(game_entry, self_proc);
@ -57,10 +60,23 @@ void patch_imports()
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()
{
void enable_dpi_awareness()
{
const utils::nt::library user32{"user32.dll"};
const auto set_dpi = user32
? user32.get_proc<BOOL(WINAPI*)(DPI_AWARENESS_CONTEXT)>(
"SetProcessDpiAwarenessContext")
: nullptr;
if (set_dpi)
{
set_dpi(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
}
}
bool run()
{
srand(uint32_t(time(nullptr)) ^ (~GetTickCount()));
{
@ -75,6 +91,7 @@ bool run()
try
{
enable_dpi_awareness();
patch_imports();
if (!component_loader::post_load())
@ -92,13 +109,15 @@ bool run()
}
return true;
}
}
}
BOOL WINAPI DllMain(HINSTANCE, const DWORD reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH) {
if(!run()) {
if (reason == DLL_PROCESS_ATTACH)
{
if (!run())
{
return FALSE;
}
}
@ -106,26 +125,21 @@ BOOL WINAPI DllMain(HINSTANCE, const DWORD reason, LPVOID)
}
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 };
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<decltype(&D3D11CreateDevice)>("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);
}

View File

@ -1,12 +1,14 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam {
namespace {
void* get_dummy()
namespace steam
{
static class blub {
namespace
{
void* get_dummy()
{
class blub
{
public:
virtual uint64_t m0() { return 0; }
virtual uint64_t m1() { return 0; }
@ -84,273 +86,192 @@ void* get_dummy()
virtual uint64_t m67() { return 0; }
virtual uint64_t m68() { return 0; }
virtual uint64_t m69() { return 0; }
} x;
return &x;
}
}
}
}
HSteamPipe client::CreateSteamPipe()
{
OutputDebugStringA(__FUNCTION__);
HSteamPipe client::CreateSteamPipe()
{
return 1;
}
}
bool client::BReleaseSteamPipe(HSteamPipe hSteamPipe)
{
OutputDebugStringA(__FUNCTION__);
bool client::BReleaseSteamPipe(HSteamPipe hSteamPipe)
{
return true;
}
}
HSteamUser client::ConnectToGlobalUser(HSteamPipe hSteamPipe)
{
OutputDebugStringA(__FUNCTION__);
HSteamUser client::ConnectToGlobalUser(HSteamPipe hSteamPipe)
{
return 1;
}
}
HSteamUser client::CreateLocalUser(HSteamPipe* phSteamPipe, uint32_t eAccountType)
{
OutputDebugStringA(__FUNCTION__);
HSteamUser client::CreateLocalUser(HSteamPipe* phSteamPipe, uint32_t eAccountType)
{
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);
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)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* 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);
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)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamUtils(HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamUtils();
}
}
void* client::GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamMatchmaking();
}
void* client::GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
}
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)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
//MessageBoxA(0, pchVersion, 0, 0);
void* client::GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return nullptr;
}
}
void* client::GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamUserStats();
}
void* client::GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
}
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)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamApps();
}
}
void* client::GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamNetworking();
}
}
void* client::GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
void* client::GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamRemoteStorage();
}
void* client::GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
}
void* client::GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static screenshots s;
return &s;
}
}
void client::RunFrame()
{
OutputDebugStringA(__FUNCTION__);
}
void client::RunFrame()
{
}
uint32_t client::GetIPCCallCount()
{
OutputDebugStringA(__FUNCTION__);
uint32_t client::GetIPCCallCount()
{
return 0;
}
}
void client::SetWarningMessageHook(void* pFunction)
{
OutputDebugStringA(__FUNCTION__);
}
void client::SetWarningMessageHook(void* pFunction)
{
}
bool client::BShutdownIfAllPipesClosed()
{
OutputDebugStringA(__FUNCTION__);
bool client::BShutdownIfAllPipesClosed()
{
return true;
}
void* client::GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
//MessageBoxA(0, pchVersion, 0, 0);
}
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)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
}
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)
{
OutputDebugStringA(__FUNCTION__);
OutputDebugStringA(pchVersion);
return &u;
}
void* client::GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static controller c;
return &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);
void* client::GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
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);
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();
}
}

View File

@ -4,7 +4,7 @@
namespace steam
{
using HSteamPipe = uint64_t;
using HSteamUser = uint64_t;
using HSteamUser = uint64_t;
class client
{

View File

@ -7,6 +7,7 @@ namespace steam
{
return true;
}
bool controller::Shutdown()
{
return true;
@ -14,8 +15,8 @@ namespace steam
void controller::RunFrame()
{
}
int controller::GetConnectedControllers(ControllerHandle_t* handlesOut)
{
return 0;
@ -25,18 +26,21 @@ namespace steam
{
return false;
}
uint64_t controller::GetActionSetHandle(const char* pszActionSetName)
{
return 0;
}
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;
@ -46,29 +50,35 @@ namespace steam
{
return 0;
}
int controller::GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle, uint64_t digitalActionHandle, uint64_t* originsOut)
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)
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)
void controller::TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad,
unsigned short usDurationMicroSec)
{
}
}

View File

@ -3,6 +3,7 @@
namespace steam
{
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);
};
}

View File

@ -1,56 +1,56 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam {
uint64_t game_server_stats::RequestUserStats(steam_id steamIDUser)
namespace steam
{
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)
{
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)
{
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)
{
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)
{
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)
{
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,
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)
{
bool game_server_stats::SetUserAchievement(steam_id steamIDUser, const char* pchName)
{
return false;
}
}
bool game_server_stats::ClearUserAchievement(steam_id steamIDUser, const char* pchName)
{
bool game_server_stats::ClearUserAchievement(steam_id steamIDUser, const char* pchName)
{
return false;
}
}
uint64_t game_server_stats::StoreUserStats(steam_id steamIDUser)
{
uint64_t game_server_stats::StoreUserStats(steam_id steamIDUser)
{
return 0;
}
}
}

View File

@ -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);

View File

@ -1,7 +1,6 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
HTTPRequestHandle http::http::CreateHTTPRequest(uint32_t eHTTPRequestMethod, const char* pchAbsoluteURL)
@ -19,12 +18,14 @@ namespace steam
return false;
}
bool http::SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName, const char* pchHeaderValue)
bool http::SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName,
const char* pchHeaderValue)
{
return false;
}
bool http::SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName, const char* pchParamValue)
bool http::SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName,
const char* pchParamValue)
{
return false;
}
@ -49,12 +50,14 @@ namespace steam
return false;
}
bool http::GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName, uint32_t* unResponseHeaderSize)
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)
bool http::GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName,
uint8_t* pHeaderValueBuffer, uint32_t unBufferSize)
{
return false;
}
@ -69,7 +72,8 @@ namespace steam
return false;
}
bool http::GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, uint8_t* pBodyDataBuffer, uint32_t unBufferSize)
bool http::GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, uint8_t* pBodyDataBuffer,
uint32_t unBufferSize)
{
return false;
}
@ -84,7 +88,8 @@ namespace steam
return false;
}
bool http::SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody, uint32_t unBodyLen)
bool http::SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody,
uint32_t unBodyLen)
{
return false;
}
@ -99,7 +104,8 @@ namespace steam
return false;
}
bool http::SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl, const char* pchCookie)
bool http::SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl,
const char* pchCookie)
{
return false;
}

View File

@ -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);
};

View File

@ -8,19 +8,18 @@ namespace steam
return 0;
}
uint64_t screenshots::AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth, int nHeight)
uint64_t screenshots::AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth,
int nHeight)
{
return 0;
}
void screenshots::TriggerScreenshot()
{
}
void screenshots::HookScreenshots(bool bHook)
{
}
bool screenshots::SetLocation(uint64_t hScreenshot, const char* pchLocation)

View File

@ -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);

View File

@ -3,17 +3,20 @@
namespace steam
{
ClientUnifiedMessageHandle unified_messages::SendMethod(const char* pchServiceMethod, const void* pRequestBuffer, uint32_t unRequestBufferSize, uint64_t unContext)
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)
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)
bool unified_messages::GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer,
uint32_t unResponseBufferSize, bool bAutoRelease)
{
return false;
}
@ -23,7 +26,8 @@ namespace steam
return false;
}
bool unified_messages::SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer, uint32_t unNotificationBufferSize)
bool unified_messages::SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer,
uint32_t unNotificationBufferSize)
{
return false;
}

View File

@ -9,10 +9,14 @@ namespace steam
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);
};
}

View File

@ -139,7 +139,8 @@ namespace steam
// Create the call response
const auto result = callbacks::register_call();
const auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(1, sizeof(encrypted_app_ticket_response)));
const auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(
1, sizeof(encrypted_app_ticket_response)));
//::Utils::Memory::AllocateArray<EncryptedAppTicketResponse>();
retvals->m_e_result = 1;
@ -165,14 +166,17 @@ namespace steam
{
return 1;
}
int user::GetPlayerSteamLevel()
{
return 0;
}
uint64_t user::RequestStoreAuthURL(const char* pchRedirectURL)
{
return 0;
}
bool user::BIsPhoneVerified()
{
return true;
@ -187,6 +191,7 @@ namespace steam
{
return false;
}
bool user::BIsPhoneRequiringVerification()
{
return false;

View File

@ -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()
{
OutputDebugStringA(__FUNCTION__);
return (void*)1;
return reinterpret_cast<void*>(1);
}
void* SteamGameServer_GetHSteamUser()
void* SteamGameServer_GetHSteamUser()
{
OutputDebugStringA(__FUNCTION__);
return (void*)1;
return reinterpret_cast<void*>(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()
{
return reinterpret_cast<void*>(1);
}
void* SteamAPI_GetHSteamPipe()
{
return reinterpret_cast<void*>(1);
}
void* SteamInternal_CreateInterface(const char* interfacename)
{
if (std::string(interfacename) == "SteamClient017")
{
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<void*>("SteamInternal_CreateInterface", interfacename);
return nullptr;
}
bool SteamInternal_GameServer_Init()
bool SteamInternal_GameServer_Init()
{
OutputDebugStringA(__FUNCTION__);
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;
}