From 5ba522d2d0d27dc3429456304f115024d569a984 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Wed, 9 Jan 2019 12:09:34 +0100 Subject: [PATCH] Fix indentation --- src/module/command.cpp | 2 +- src/module/game_launcher.cpp | 3 ++- src/module/steam_proxy.cpp | 2 +- src/steam/interface.cpp | 13 ++++++------- src/steam/interface.hpp | 10 +++++----- src/steam/steam.cpp | 6 +++--- src/steam/steam.hpp | 16 ++++++++-------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/module/command.cpp b/src/module/command.cpp index dc5f40d..69a78ca 100644 --- a/src/module/command.cpp +++ b/src/module/command.cpp @@ -23,7 +23,7 @@ void command::add(const std::string& name, const std::functionsteam_pipe_ = nullptr; this->global_user_ = nullptr; - this->steam_client_module_ = utils::nt::module{ nullptr }; + this->steam_client_module_ = utils::nt::module{nullptr}; } }; diff --git a/src/steam/interface.cpp b/src/steam/interface.cpp index df49f38..5bda637 100644 --- a/src/steam/interface.cpp +++ b/src/steam/interface.cpp @@ -12,7 +12,6 @@ namespace steam interface::interface(void* interface_ptr) : interface_ptr_(static_cast(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(ud.pc) == 0xCC) break; // int 3 + if (*reinterpret_cast(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; } -} +} diff --git a/src/steam/interface.hpp b/src/steam/interface.hpp index 6d9903e..0752648 100644 --- a/src/steam/interface.hpp +++ b/src/steam/interface.hpp @@ -54,11 +54,11 @@ namespace steam { throw std::runtime_error("Unable to find desired method"); } - - constexpr size_t passed_argc = argument_size_calculator::value; - if (passed_argc != method_result.param_size) - { - throw std::runtime_error("Invalid argument count"); + + constexpr size_t passed_argc = argument_size_calculator::value; + if (passed_argc != method_result.param_size) + { + throw std::runtime_error("Invalid argument count"); } return reinterpret_cast(method_result.pointer)( diff --git a/src/steam/steam.cpp b/src/steam/steam.cpp index d027751..d4e87a7 100644 --- a/src/steam/steam.cpp +++ b/src/steam/steam.cpp @@ -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(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"); } diff --git a/src/steam/steam.hpp b/src/steam/steam.hpp index 80dab72..3a1a248 100644 --- a/src/steam/steam.hpp +++ b/src/steam/steam.hpp @@ -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"