Fix indentation
This commit is contained in:
parent
7c731368af
commit
5ba522d2d0
@ -23,7 +23,7 @@ void command::add(const std::string& name, const std::function<void(const std::v
|
||||
void command::pre_destroy()
|
||||
{
|
||||
std::lock_guard _(mutex_);
|
||||
if(!callbacks_.empty())
|
||||
if (!callbacks_.empty())
|
||||
{
|
||||
callbacks_.clear();
|
||||
}
|
||||
|
@ -19,7 +19,8 @@ public:
|
||||
|
||||
private:
|
||||
static HINSTANCE __stdcall shell_execute_a(const HWND hwnd, const LPCSTR lp_operation, const LPCSTR lp_file,
|
||||
const LPCSTR lp_parameters, const LPCSTR lp_directory, INT n_show_cmd)
|
||||
const LPCSTR lp_parameters, const LPCSTR lp_directory,
|
||||
const INT n_show_cmd)
|
||||
{
|
||||
static const auto sp_url = "steam://run/42680"s;
|
||||
static const auto mp_url = "steam://run/42690"s;
|
||||
|
@ -171,7 +171,7 @@ private:
|
||||
this->steam_pipe_ = nullptr;
|
||||
this->global_user_ = nullptr;
|
||||
|
||||
this->steam_client_module_ = utils::nt::module{ nullptr };
|
||||
this->steam_client_module_ = utils::nt::module{nullptr};
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,6 @@ namespace steam
|
||||
|
||||
interface::interface(void* interface_ptr) : interface_ptr_(static_cast<void***>(interface_ptr))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
interface::operator bool() const
|
||||
@ -23,7 +22,7 @@ namespace steam
|
||||
interface::method interface::find_method(const std::string& name)
|
||||
{
|
||||
const auto method_entry = this->methods_.find(name);
|
||||
if(method_entry != this->methods_.end())
|
||||
if (method_entry != this->methods_.end())
|
||||
{
|
||||
return method_entry->second;
|
||||
}
|
||||
@ -42,7 +41,7 @@ namespace steam
|
||||
const auto result = this->analyze_method(*vftbl);
|
||||
if (result.param_size_found && result.name_found)
|
||||
{
|
||||
const method method_result { *vftbl, result.param_size };
|
||||
const method method_result{*vftbl, result.param_size};
|
||||
this->methods_[result.name] = method_result;
|
||||
|
||||
if (result.name == name)
|
||||
@ -102,7 +101,7 @@ namespace steam
|
||||
}
|
||||
}
|
||||
|
||||
if(*reinterpret_cast<unsigned char*>(ud.pc) == 0xCC) break; // int 3
|
||||
if (*reinterpret_cast<unsigned char*>(ud.pc) == 0xCC) break; // int 3
|
||||
if (result.param_size_found && result.name_found) break;
|
||||
}
|
||||
|
||||
@ -113,14 +112,14 @@ namespace steam
|
||||
{
|
||||
const auto pointer_lib = utils::nt::module::get_by_address(pointer);
|
||||
|
||||
for(const auto& section : pointer_lib.get_section_headers())
|
||||
for (const auto& section : pointer_lib.get_section_headers())
|
||||
{
|
||||
const auto size = sizeof(section->Name);
|
||||
char name[size + 1];
|
||||
name[size] = 0;
|
||||
std::memcpy(name, section->Name, size);
|
||||
|
||||
if(name == ".rdata"s)
|
||||
if (name == ".rdata"s)
|
||||
{
|
||||
const auto target = size_t(pointer);
|
||||
const size_t source_start = size_t(pointer_lib.get_ptr()) + section->PointerToRawData;
|
||||
@ -132,4 +131,4 @@ namespace steam
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,11 +54,11 @@ namespace steam
|
||||
{
|
||||
throw std::runtime_error("Unable to find desired method");
|
||||
}
|
||||
|
||||
constexpr size_t passed_argc = argument_size_calculator<sizeof(Args)...>::value;
|
||||
if (passed_argc != method_result.param_size)
|
||||
{
|
||||
throw std::runtime_error("Invalid argument count");
|
||||
|
||||
constexpr size_t passed_argc = argument_size_calculator<sizeof(Args)...>::value;
|
||||
if (passed_argc != method_result.param_size)
|
||||
{
|
||||
throw std::runtime_error("Invalid argument count");
|
||||
}
|
||||
|
||||
return reinterpret_cast<T(__thiscall*)(void*, Args ...)>(method_result.pointer)(
|
||||
|
@ -83,10 +83,10 @@ namespace steam
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Valve\\Steam", 0, KEY_QUERY_VALUE, ®_key) ==
|
||||
ERROR_SUCCESS)
|
||||
{
|
||||
char path[MAX_PATH] = { 0 };
|
||||
char path[MAX_PATH] = {0};
|
||||
DWORD length = sizeof(path);
|
||||
RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(path),
|
||||
&length);
|
||||
&length);
|
||||
RegCloseKey(reg_key);
|
||||
|
||||
std::string steam_path = path;
|
||||
@ -114,7 +114,7 @@ namespace steam
|
||||
if (!overlay)
|
||||
{
|
||||
const auto steam_path = get_steam_install_directory();
|
||||
if(!steam_path.empty())
|
||||
if (!steam_path.empty())
|
||||
{
|
||||
overlay = ::utils::nt::module::load(steam_path + "gameoverlayrenderer.dll");
|
||||
}
|
||||
|
@ -20,16 +20,16 @@ typedef union
|
||||
#pragma pack( push, 1 )
|
||||
struct raw_game_id final
|
||||
{
|
||||
unsigned int app_id : 24;
|
||||
unsigned int type : 8;
|
||||
unsigned int app_id : 24;
|
||||
unsigned int type : 8;
|
||||
unsigned int mod_id : 32;
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
raw_game_id raw;
|
||||
unsigned long long bits;
|
||||
} game_id;
|
||||
|
||||
typedef union
|
||||
{
|
||||
raw_game_id raw;
|
||||
unsigned long long bits;
|
||||
} game_id;
|
||||
#pragma pack( pop )
|
||||
|
||||
#include "interfaces/apps.hpp"
|
||||
|
Loading…
Reference in New Issue
Block a user