Added ISteamHTTP

This commit is contained in:
acidicoala
2025-08-27 20:42:08 +05:00
parent 9f51349517
commit dfbd7d00d9
32 changed files with 737 additions and 783 deletions

View File

@@ -4,45 +4,30 @@
#include "steam_api/steam_interface.hpp"
#include "steam_api/virtuals/steam_api_virtuals.hpp"
VIRTUAL(bool) ISteamApps_BIsSubscribedApp(PARAMS(const AppId_t dlc_id)) {
try {
return smoke_api::steam_apps::IsDlcUnlocked(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamApps_BIsSubscribedApp, ARGS(dlc_id))
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return false;
}
VIRTUAL(bool) ISteamApps_BIsSubscribedApp(PARAMS(const AppId_t dlc_id)) noexcept {
return smoke_api::steam_apps::IsDlcUnlocked(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamApps_BIsSubscribedApp, ARGS(dlc_id))
);
}
VIRTUAL(bool) ISteamApps_BIsDlcInstalled(PARAMS(const AppId_t dlc_id)) {
try {
return smoke_api::steam_apps::IsDlcUnlocked(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamApps_BIsDlcInstalled, ARGS(dlc_id))
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return false;
}
VIRTUAL(bool) ISteamApps_BIsDlcInstalled(PARAMS(const AppId_t dlc_id)) noexcept {
return smoke_api::steam_apps::IsDlcUnlocked(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamApps_BIsDlcInstalled, ARGS(dlc_id))
);
}
VIRTUAL(int) ISteamApps_GetDLCCount(PARAMS()) {
try {
return smoke_api::steam_apps::GetDLCCount(
__func__,
steam_interface::get_app_id(),
HOOKED_CALL_CLOSURE(ISteamApps_GetDLCCount, ARGS())
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return 0;
}
VIRTUAL(int) ISteamApps_GetDLCCount(PARAMS()) noexcept {
return smoke_api::steam_apps::GetDLCCount(
__func__,
steam_interface::get_app_id(),
HOOKED_CALL_CLOSURE(ISteamApps_GetDLCCount, ARGS())
);
}
VIRTUAL(bool) ISteamApps_BGetDLCDataByIndex(
@@ -53,26 +38,22 @@ VIRTUAL(bool) ISteamApps_BGetDLCDataByIndex(
char* pchName,
const int cchNameBufferSize
)
) {
try {
return smoke_api::steam_apps::GetDLCDataByIndex(
__func__,
steam_interface::get_app_id(),
iDLC,
p_dlc_id,
pbAvailable,
pchName,
cchNameBufferSize,
HOOKED_CALL_CLOSURE(
ISteamApps_BGetDLCDataByIndex,
ARGS(iDLC, p_dlc_id, pbAvailable, pchName, cchNameBufferSize)
),
[&](const AppId_t dlc_id) {
return ISteamApps_BIsDlcInstalled(ARGS(dlc_id));
}
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return false;
}
) noexcept {
return smoke_api::steam_apps::GetDLCDataByIndex(
__func__,
steam_interface::get_app_id(),
iDLC,
p_dlc_id,
pbAvailable,
pchName,
cchNameBufferSize,
HOOKED_CALL_CLOSURE(
ISteamApps_BGetDLCDataByIndex,
ARGS(iDLC, p_dlc_id, pbAvailable, pchName, cchNameBufferSize)
),
HOOKED_CALL_CLOSURE(
ISteamApps_BIsSubscribedApp,
ARGS(*p_dlc_id)
)
);
}

View File

@@ -9,17 +9,12 @@ VIRTUAL(void*) ISteamClient_GetISteamApps(
const HSteamPipe hSteamPipe,
const char* version
)
) {
try {
return steam_client::GetGenericInterface(
__func__,
version,
HOOKED_CALL_CLOSURE(ISteamClient_GetISteamApps, ARGS(hSteamUser, hSteamPipe, version))
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return nullptr;
}
) noexcept {
return steam_client::GetGenericInterface(
__func__,
version,
HOOKED_CALL_CLOSURE(ISteamClient_GetISteamApps, ARGS(hSteamUser, hSteamPipe, version))
);
}
VIRTUAL(void*) ISteamClient_GetISteamUser(
@@ -28,17 +23,12 @@ VIRTUAL(void*) ISteamClient_GetISteamUser(
const HSteamPipe hSteamPipe,
const char* version
)
) {
try {
return steam_client::GetGenericInterface(
__func__,
version,
HOOKED_CALL_CLOSURE(ISteamClient_GetISteamUser, ARGS(hSteamUser, hSteamPipe, version))
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return nullptr;
}
) noexcept {
return steam_client::GetGenericInterface(
__func__,
version,
HOOKED_CALL_CLOSURE(ISteamClient_GetISteamUser, ARGS(hSteamUser, hSteamPipe, version))
);
}
VIRTUAL(void*) ISteamClient_GetISteamGenericInterface(
@@ -47,20 +37,15 @@ VIRTUAL(void*) ISteamClient_GetISteamGenericInterface(
HSteamPipe hSteamPipe,
const char* pchVersion
)
) {
try {
return steam_client::GetGenericInterface(
__func__,
pchVersion,
HOOKED_CALL_CLOSURE(
ISteamClient_GetISteamGenericInterface,
ARGS(hSteamUser, hSteamPipe, pchVersion)
)
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return nullptr;
}
) noexcept {
return steam_client::GetGenericInterface(
__func__,
pchVersion,
HOOKED_CALL_CLOSURE(
ISteamClient_GetISteamGenericInterface,
ARGS(hSteamUser, hSteamPipe, pchVersion)
)
);
}
VIRTUAL(void*) ISteamClient_GetISteamInventory(
@@ -69,18 +54,13 @@ VIRTUAL(void*) ISteamClient_GetISteamInventory(
const HSteamPipe hSteamPipe,
const char* pchVersion
)
) {
try {
return steam_client::GetGenericInterface(
__func__,
pchVersion,
HOOKED_CALL_CLOSURE(
ISteamClient_GetISteamInventory,
ARGS(hSteamUser, hSteamPipe, pchVersion)
)
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return nullptr;
}
) noexcept {
return steam_client::GetGenericInterface(
__func__,
pchVersion,
HOOKED_CALL_CLOSURE(
ISteamClient_GetISteamInventory,
ARGS(hSteamUser, hSteamPipe, pchVersion)
)
);
}

View File

@@ -6,16 +6,11 @@
VIRTUAL(EUserHasLicenseForAppResult) ISteamGameServer_UserHasLicenseForApp(
PARAMS(const CSteamID steamID, const AppId_t dlc_id)
) {
try {
return smoke_api::steam_user::UserHasLicenseForApp(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamGameServer_UserHasLicenseForApp, ARGS(steamID, dlc_id))
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return k_EUserHasLicenseResultDoesNotHaveLicense;
}
) noexcept {
return smoke_api::steam_user::UserHasLicenseForApp(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamGameServer_UserHasLicenseForApp, ARGS(steamID, dlc_id))
);
}

View File

@@ -0,0 +1,66 @@
#include <koalabox/logger.hpp>
#include "smoke_api/interfaces/steam_http.hpp"
#include "steam_api/steam_interface.hpp"
#include "steam_api/virtuals/steam_api_virtuals.hpp"
VIRTUAL(bool) ISteamHTTP_GetHTTPResponseBodyData(
PARAMS(
const HTTPRequestHandle hRequest,
const uint8_t* pBodyDataBuffer,
const uint32_t unBufferSize
)
) noexcept {
return smoke_api::steam_http::GetHTTPResponseBodyData(
__func__,
hRequest,
pBodyDataBuffer,
unBufferSize,
HOOKED_CALL_CLOSURE(
ISteamHTTP_GetHTTPResponseBodyData,
ARGS(hRequest, pBodyDataBuffer, unBufferSize)
)
);
}
VIRTUAL(bool) ISteamHTTP_GetHTTPStreamingResponseBodyData(
PARAMS(
const HTTPRequestHandle hRequest,
const uint32_t cOffset,
const uint8_t* pBodyDataBuffer,
const uint32_t unBufferSize
)
) noexcept {
return smoke_api::steam_http::GetHTTPStreamingResponseBodyData(
__func__,
hRequest,
cOffset,
pBodyDataBuffer,
unBufferSize,
HOOKED_CALL_CLOSURE(
ISteamHTTP_GetHTTPStreamingResponseBodyData,
ARGS(hRequest, cOffset, pBodyDataBuffer, unBufferSize)
)
);
}
VIRTUAL(bool) ISteamHTTP_SetHTTPRequestRawPostBody(
PARAMS(
const HTTPRequestHandle hRequest,
const char* pchContentType,
const uint8_t* pubBody,
const uint32_t unBodyLen
)
) noexcept {
return smoke_api::steam_http::SetHTTPRequestRawPostBody(
__func__,
hRequest,
pchContentType,
pubBody,
unBodyLen,
HOOKED_CALL_CLOSURE(
ISteamHTTP_SetHTTPRequestRawPostBody,
ARGS(hRequest, pchContentType, pubBody, unBodyLen)
)
);
}

View File

@@ -3,7 +3,7 @@
VIRTUAL(EResult) ISteamInventory_GetResultStatus(
PARAMS(const SteamInventoryResult_t resultHandle)
) {
) noexcept {
return smoke_api::steam_inventory::GetResultStatus(
__func__,
resultHandle,
@@ -17,7 +17,7 @@ VIRTUAL(bool) ISteamInventory_GetResultItems(
SteamItemDetails_t* pOutItemsArray,
uint32_t* punOutItemsArraySize
)
) {
) noexcept {
return smoke_api::steam_inventory::GetResultItems(
__func__,
resultHandle,
@@ -44,7 +44,7 @@ VIRTUAL(bool) ISteamInventory_GetResultItemProperty(
char* pchValueBuffer,
uint32_t* punValueBufferSizeOut
)
) {
) noexcept {
return smoke_api::steam_inventory::GetResultItemProperty(
__func__,
resultHandle,
@@ -65,7 +65,7 @@ VIRTUAL(bool) ISteamInventory_GetResultItemProperty(
);
}
VIRTUAL(bool) ISteamInventory_GetAllItems(PARAMS(SteamInventoryResult_t* pResultHandle)) {
VIRTUAL(bool) ISteamInventory_GetAllItems(PARAMS(SteamInventoryResult_t* pResultHandle)) noexcept {
return smoke_api::steam_inventory::GetAllItems(
__func__,
pResultHandle,
@@ -79,7 +79,7 @@ VIRTUAL(bool) ISteamInventory_GetItemsByID(
const SteamItemInstanceID_t* pInstanceIDs,
const uint32_t unCountInstanceIDs
)
) {
) noexcept {
return smoke_api::steam_inventory::GetItemsByID(
__func__,
pResultHandle,
@@ -98,7 +98,7 @@ VIRTUAL(bool) ISteamInventory_SerializeResult(
void* pOutBuffer,
uint32_t* punOutBufferSize
)
) {
) noexcept {
return smoke_api::steam_inventory::SerializeResult(
__func__,
resultHandle,
@@ -116,7 +116,7 @@ VIRTUAL(bool) ISteamInventory_GetItemDefinitionIDs(
SteamItemDef_t*pItemDefIDs,
uint32_t* punItemDefIDsArraySize
)
) {
) noexcept {
return smoke_api::steam_inventory::GetItemDefinitionIDs(
__func__,
pItemDefIDs,
@@ -130,14 +130,11 @@ VIRTUAL(bool) ISteamInventory_GetItemDefinitionIDs(
VIRTUAL(bool) ISteamInventory_CheckResultSteamID(
PARAMS(const SteamInventoryResult_t resultHandle, CSteamID steamIDExpected)
) {
) noexcept {
return smoke_api::steam_inventory::CheckResultSteamID(
__func__,
resultHandle,
steamIDExpected,
HOOKED_CALL_CLOSURE(
ISteamInventory_CheckResultSteamID,
ARGS(resultHandle, steamIDExpected)
)
HOOKED_CALL_CLOSURE(ISteamInventory_CheckResultSteamID, ARGS(resultHandle, steamIDExpected))
);
}

View File

@@ -6,17 +6,11 @@
VIRTUAL(EUserHasLicenseForAppResult) ISteamUser_UserHasLicenseForApp(
PARAMS(const CSteamID steamID, const AppId_t dlc_id)
) {
try {
static const auto app_id = steam_interface::get_app_id();
return smoke_api::steam_user::UserHasLicenseForApp(
__func__,
app_id,
dlc_id,
HOOKED_CALL_CLOSURE(ISteamUser_UserHasLicenseForApp, ARGS(steamID, dlc_id))
);
} catch(const std::exception& e) {
LOG_ERROR("{} -> Error: {}", __func__, e.what());
return k_EUserHasLicenseResultDoesNotHaveLicense;
}
) noexcept {
return smoke_api::steam_user::UserHasLicenseForApp(
__func__,
steam_interface::get_app_id(),
dlc_id,
HOOKED_CALL_CLOSURE(ISteamUser_UserHasLicenseForApp, ARGS(steamID, dlc_id))
);
}

View File

@@ -3,38 +3,60 @@
#include "smoke_api/types.hpp"
// ISteamApps
VIRTUAL(bool) ISteamApps_BIsSubscribedApp(PARAMS(AppId_t));
VIRTUAL(bool) ISteamApps_BIsDlcInstalled(PARAMS(AppId_t));
VIRTUAL(int) ISteamApps_GetDLCCount(PARAMS());
VIRTUAL(bool) ISteamApps_BGetDLCDataByIndex(PARAMS(int, AppId_t*, bool*, char*, int));
VIRTUAL(bool) ISteamApps_BIsSubscribedApp(PARAMS(AppId_t)) noexcept;
VIRTUAL(bool) ISteamApps_BIsDlcInstalled(PARAMS(AppId_t)) noexcept;
VIRTUAL(int) ISteamApps_GetDLCCount(PARAMS()) noexcept;
VIRTUAL(bool) ISteamApps_BGetDLCDataByIndex(PARAMS(int, AppId_t*, bool*, char*, int)) noexcept;
// ISteamClient
VIRTUAL(void*) ISteamClient_GetISteamApps(PARAMS(HSteamUser, HSteamPipe, const char*));
VIRTUAL(void*) ISteamClient_GetISteamUser(PARAMS(HSteamUser, HSteamPipe, const char*));
VIRTUAL(void*) ISteamClient_GetISteamGenericInterface(PARAMS(HSteamUser, HSteamPipe, const char*));
VIRTUAL(void*) ISteamClient_GetISteamInventory(PARAMS(HSteamUser, HSteamPipe, const char*));
VIRTUAL(void*) ISteamClient_GetISteamApps(PARAMS(HSteamUser, HSteamPipe, const char*)) noexcept;
VIRTUAL(void*) ISteamClient_GetISteamUser(PARAMS(HSteamUser, HSteamPipe, const char*)) noexcept;
VIRTUAL(void*) ISteamClient_GetISteamGenericInterface(
PARAMS(HSteamUser, HSteamPipe, const char*)
) noexcept;
VIRTUAL(void*) ISteamClient_GetISteamInventory(
PARAMS(HSteamUser, HSteamPipe, const char*)
) noexcept;
// ISteamHTTP
VIRTUAL(bool) ISteamHTTP_GetHTTPResponseBodyData(
PARAMS(HTTPRequestHandle, const uint8_t*, uint32_t)
) noexcept;
VIRTUAL(bool) ISteamHTTP_GetHTTPStreamingResponseBodyData(
PARAMS(HTTPRequestHandle, uint32_t, const uint8_t*, uint32_t)
) noexcept;
VIRTUAL(bool) ISteamHTTP_SetHTTPRequestRawPostBody(
PARAMS(HTTPRequestHandle, const char*, const uint8_t*, uint32_t)
) noexcept;
// ISteamInventory
VIRTUAL(EResult) ISteamInventory_GetResultStatus(PARAMS(SteamInventoryResult_t));
VIRTUAL(EResult) ISteamInventory_GetResultStatus(PARAMS(SteamInventoryResult_t)) noexcept;
VIRTUAL(bool) ISteamInventory_GetResultItems(
PARAMS(SteamInventoryResult_t, SteamItemDetails_t*, uint32_t*) // @formatter:off
); // @formatter:on
) noexcept; // @formatter:on
VIRTUAL(bool) ISteamInventory_GetResultItemProperty(
PARAMS(SteamInventoryResult_t, uint32_t, const char*, char*, uint32_t*) // @formatter:off
); // @formatter:on
VIRTUAL(bool) ISteamInventory_GetAllItems(PARAMS(SteamInventoryResult_t*));
) noexcept; // @formatter:on
VIRTUAL(bool) ISteamInventory_GetAllItems(PARAMS(SteamInventoryResult_t*)) noexcept;
VIRTUAL(bool) ISteamInventory_GetItemsByID(
PARAMS(SteamInventoryResult_t*, const SteamItemInstanceID_t*, uint32_t)
);
VIRTUAL(bool) ISteamInventory_SerializeResult(PARAMS(SteamInventoryResult_t, void*, uint32_t*));
VIRTUAL(bool) ISteamInventory_GetItemDefinitionIDs(PARAMS(SteamItemDef_t*, uint32_t*));
VIRTUAL(bool) ISteamInventory_CheckResultSteamID(PARAMS(SteamInventoryResult_t, CSteamID));
) noexcept;
VIRTUAL(bool) ISteamInventory_SerializeResult(
PARAMS(SteamInventoryResult_t, void*, uint32_t*)
) noexcept;
VIRTUAL(bool) ISteamInventory_GetItemDefinitionIDs(PARAMS(SteamItemDef_t*, uint32_t*)) noexcept;
VIRTUAL(bool) ISteamInventory_CheckResultSteamID(PARAMS(SteamInventoryResult_t, CSteamID)) noexcept;
// ISteamUser
VIRTUAL(EUserHasLicenseForAppResult) ISteamUser_UserHasLicenseForApp(PARAMS(CSteamID, AppId_t));
VIRTUAL(EUserHasLicenseForAppResult) ISteamUser_UserHasLicenseForApp(
PARAMS(CSteamID, AppId_t)
) noexcept;
// ISteamGameServer
VIRTUAL(EUserHasLicenseForAppResult) ISteamGameServer_UserHasLicenseForApp(
PARAMS(CSteamID, AppId_t)
);
) noexcept;