mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2025-12-05 21:15:39 -05:00
Refactored lib and module namespaces
This commit is contained in:
3
.idea/dictionaries/project.xml
generated
3
.idea/dictionaries/project.xml
generated
@@ -23,6 +23,7 @@
|
|||||||
<w>libgtk</w>
|
<w>libgtk</w>
|
||||||
<w>libsteam</w>
|
<w>libsteam</w>
|
||||||
<w>memcpy</w>
|
<w>memcpy</w>
|
||||||
|
<w>peparse</w>
|
||||||
<w>phnt</w>
|
<w>phnt</w>
|
||||||
<w>polyhook</w>
|
<w>polyhook</w>
|
||||||
<w>rtld</w>
|
<w>rtld</w>
|
||||||
@@ -30,6 +31,8 @@
|
|||||||
<w>steamapi</w>
|
<w>steamapi</w>
|
||||||
<w>steamapps</w>
|
<w>steamapps</w>
|
||||||
<w>steamclient</w>
|
<w>steamclient</w>
|
||||||
|
<w>winhttp</w>
|
||||||
|
<w>winmm</w>
|
||||||
<w>wstr</w>
|
<w>wstr</w>
|
||||||
</words>
|
</words>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="linux_exports_generator [64]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="--input_libs_glob $ProjectFileDir$/res/steamworks/*/binaries/linux64/libsteam_api.so --output_path $CMakeCurrentGenerationDir$/generated/proxy_exports" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="linux_exports_generator" CONFIG_NAME="Debug [64]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="linux_exports_generator">
|
<configuration default="false" name="linux_exports_generator [64]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="--input_libs_glob $ProjectFileDir$/res/steamworks/*/binaries/linux64/libsteam_api.so --output_path $CMakeCurrentGenerationDir$/generated/proxy_exports" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="linux_exports_generator" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="linux_exports_generator">
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="steamworks_downloader [prompt]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="$Prompt$" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/res" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="steamworks_downloader" CONFIG_NAME="Debug [64]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="steamworks_downloader">
|
<configuration default="false" name="steamworks_downloader [prompt]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="$Prompt$" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/res" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="steamworks_downloader" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="steamworks_downloader">
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
2
.idea/runConfigurations/steamworks_parser.xml
generated
2
.idea/runConfigurations/steamworks_parser.xml
generated
@@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="steamworks_parser" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/res/" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="steamworks_parser" CONFIG_NAME="Debug [64]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="steamworks_parser">
|
<configuration default="false" name="steamworks_parser" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/res/" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="steamworks_parser" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="steamworks_parser">
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="windows_exports_generator [64]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="--forwarded_dll_name "steam_api64_o" --lib_files_glob "$ProjectFileDir$\res\steamworks\*\binaries\steam_api64.dll" --output_file_path "$CMakeCurrentGenerationDir$\generated\linker_exports_for_steam_api.h" --sources_input_path """ REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="windows_exports_generator" CONFIG_NAME="Debug [64]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="windows_exports_generator">
|
<configuration default="false" name="windows_exports_generator [64]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="--forwarded_dll_name "steam_api64_o" --lib_files_glob "$ProjectFileDir$\res\steamworks\*\binaries\steam_api64.dll" --output_file_path "$CMakeCurrentGenerationDir$\generated\linker_exports_for_steam_api.h" --sources_input_path """ REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="windows_exports_generator" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="windows_exports_generator">
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
2
KoalaBox
2
KoalaBox
Submodule KoalaBox updated: cccc188870...3ac6456c3c
@@ -106,7 +106,7 @@ namespace {
|
|||||||
|
|
||||||
static const auto CreateInterface$ = KB_LIB_GET_FUNC(steamclient_handle, CreateInterface);
|
static const auto CreateInterface$ = KB_LIB_GET_FUNC(steamclient_handle, CreateInterface);
|
||||||
|
|
||||||
if(auto* steamapi_handle = kb::lib::get_library_handle(STEAM_API_MODULE)) {
|
if(auto* steamapi_handle = kb::lib::get_lib_handle(STEAM_API_MODULE)) {
|
||||||
// SteamAPI might have been initialized.
|
// SteamAPI might have been initialized.
|
||||||
// Hence, we need to query SteamClient interfaces and hook them if needed.
|
// Hence, we need to query SteamClient interfaces and hook them if needed.
|
||||||
const auto steamclient_versions = find_steamclient_versions(steamapi_handle);
|
const auto steamclient_versions = find_steamclient_versions(steamapi_handle);
|
||||||
@@ -176,7 +176,7 @@ namespace {
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_hook_mode(void* self_module_handle) {
|
void init_hook_mode([[maybe_unused]] void* self_module_handle) {
|
||||||
is_hook_mode = true;
|
is_hook_mode = true;
|
||||||
#ifdef KB_LINUX
|
#ifdef KB_LINUX
|
||||||
// Because we got injected via LD_PRELOAD,
|
// Because we got injected via LD_PRELOAD,
|
||||||
@@ -187,7 +187,7 @@ namespace {
|
|||||||
for(const auto& lib_path : glob::rglob({"./" + lib_name, "**/" + lib_name})) {
|
for(const auto& lib_path : glob::rglob({"./" + lib_name, "**/" + lib_name})) {
|
||||||
if(const auto lib_bitness = kb::lib::get_bitness(lib_path)) {
|
if(const auto lib_bitness = kb::lib::get_bitness(lib_path)) {
|
||||||
if(static_cast<uint8_t>(*lib_bitness) == kb::platform::bitness) {
|
if(static_cast<uint8_t>(*lib_bitness) == kb::platform::bitness) {
|
||||||
if(const auto lib_handle = kb::lib::load_library(lib_path)) {
|
if(const auto lib_handle = kb::lib::load(lib_path)) {
|
||||||
LOG_INFO("Found original library: {}", kb::path::to_str(lib_path));
|
LOG_INFO("Found original library: {}", kb::path::to_str(lib_path));
|
||||||
|
|
||||||
original_steamapi_handle = *lib_handle;
|
original_steamapi_handle = *lib_handle;
|
||||||
@@ -204,7 +204,7 @@ namespace {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_proxy_mode(void* self_module_handle) {
|
void init_proxy_mode([[maybe_unused]] void* self_module_handle) {
|
||||||
is_hook_mode = true;
|
is_hook_mode = true;
|
||||||
|
|
||||||
original_steamapi_handle = kb::lib::load_original_library(kb::paths::get_self_dir(), STEAM_API_MODULE);
|
original_steamapi_handle = kb::lib::load_original_library(kb::paths::get_self_dir(), STEAM_API_MODULE);
|
||||||
@@ -262,7 +262,7 @@ namespace smoke_api {
|
|||||||
void shutdown() {
|
void shutdown() {
|
||||||
try {
|
try {
|
||||||
if(original_steamapi_handle != nullptr) {
|
if(original_steamapi_handle != nullptr) {
|
||||||
kb::lib::unload_library(original_steamapi_handle);
|
kb::lib::unload(original_steamapi_handle);
|
||||||
original_steamapi_handle = nullptr;
|
original_steamapi_handle = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <koalabox/logger.hpp>
|
#include <koalabox/logger.hpp>
|
||||||
#include <koalabox/path.hpp>
|
#include <koalabox/path.hpp>
|
||||||
#include <koalabox/str.hpp>
|
#include <koalabox/str.hpp>
|
||||||
#include <koalabox/zip.hpp>
|
#include <koalabox_tools/zip.hpp>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
@@ -90,7 +90,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void unzip_sdk(const fs::path& zip_file_path, const fs::path& unzip_dir) {
|
void unzip_sdk(const fs::path& zip_file_path, const fs::path& unzip_dir) {
|
||||||
kb::zip::extract_files(
|
kb::tools::zip::extract_files(
|
||||||
zip_file_path,
|
zip_file_path,
|
||||||
[&](const std::string& name, const bool) {
|
[&](const std::string& name, const bool) {
|
||||||
if(name.starts_with("sdk/public/steam/") && name.ends_with(".h")) {
|
if(name.starts_with("sdk/public/steam/") && name.ends_with(".h")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user