├── deadlock
├── source
│ ├── pch
│ │ ├── pch.cpp
│ │ └── pch.hpp
│ ├── valve
│ │ ├── structs
│ │ │ ├── entities
│ │ │ │ ├── base_player.inl
│ │ │ │ ├── base_entity.cpp
│ │ │ │ ├── base_entity.inl
│ │ │ │ ├── handle_entity.inl
│ │ │ │ ├── handle_entity.hpp
│ │ │ │ ├── base_player.cpp
│ │ │ │ ├── base_entity.hpp
│ │ │ │ └── base_player.hpp
│ │ │ └── data_types
│ │ │ │ ├── utl
│ │ │ │ ├── utl_memory_pool.hpp
│ │ │ │ ├── utl_hash.hpp
│ │ │ │ ├── utl_memory.inl
│ │ │ │ └── utl_hash.inl
│ │ │ │ └── handle
│ │ │ │ ├── handle.inl
│ │ │ │ └── handle.hpp
│ │ ├── interfaces
│ │ │ ├── citadel_input
│ │ │ │ ├── citadel_input.inl
│ │ │ │ └── citadel_input.hpp
│ │ │ ├── mem_alloc
│ │ │ │ └── mem_alloc.hpp
│ │ │ ├── schema_system
│ │ │ │ ├── schema_system.inl
│ │ │ │ └── schema_system.hpp
│ │ │ └── entity_system
│ │ │ │ ├── entity_system.inl
│ │ │ │ └── entity_system.hpp
│ │ ├── entity_utils
│ │ │ ├── entity_utils.inl
│ │ │ ├── entity_utils.cpp
│ │ │ └── entity_utils.hpp
│ │ └── net_vars
│ │ │ ├── net_vars.inl
│ │ │ └── net_vars.hpp
│ ├── core
│ │ ├── ui
│ │ │ ├── ui.inl
│ │ │ ├── ui.hpp
│ │ │ └── ui.cpp
│ │ └── hooks
│ │ │ ├── detours
│ │ │ ├── client.cpp
│ │ │ └── game_overlay_renderer.cpp
│ │ │ └── hooks.hpp
│ ├── systems
│ │ ├── input
│ │ │ ├── input.inl
│ │ │ ├── input.hpp
│ │ │ └── input.cpp
│ │ ├── module_parser
│ │ │ ├── module_parser.cpp
│ │ │ ├── module_parser.hpp
│ │ │ ├── module_parser.inl
│ │ │ └── ldr_module
│ │ │ │ ├── ldr_module.hpp
│ │ │ │ └── ldr_module.inl
│ │ ├── render
│ │ │ ├── render.hpp
│ │ │ ├── render.inl
│ │ │ └── render.cpp
│ │ ├── hooker
│ │ │ ├── hooker.inl
│ │ │ └── hooker.hpp
│ │ └── logger
│ │ │ ├── logger.inl
│ │ │ └── logger.hpp
│ ├── utils
│ │ ├── memory
│ │ │ ├── memory.hpp
│ │ │ └── base_address
│ │ │ │ ├── base_address.inl
│ │ │ │ └── base_address.hpp
│ │ ├── hash
│ │ │ └── hash.hpp
│ │ └── math
│ │ │ └── data_types
│ │ │ └── vector.hpp
│ ├── bootstrap.cpp
│ └── vendor.hpp
├── cpp.hint
├── third_party
│ ├── imgui
│ │ ├── imgui_impl_dx11.h
│ │ ├── imgui_impl_win32.h
│ │ └── imconfig.h
│ └── minhk
│ │ ├── hde
│ │ ├── pstdint.hpp
│ │ ├── hde32.hpp
│ │ ├── hde64.hpp
│ │ ├── table32.hpp
│ │ └── table64.hpp
│ │ ├── buffer.hpp
│ │ ├── trampoline.hpp
│ │ └── minhook.hpp
└── deadlock.vcxproj.filters
├── deadlock.sln.DotSettings
├── deadlock.sln
├── LICENSE.txt
├── README.md
├── .gitattributes
├── .clang-format
└── .gitignore
/deadlock/source/pch/pch.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/base_player.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "base_player.hpp"
3 |
4 | namespace hack::valve::inline entities {
5 |
6 |
7 | } // namespace hack::cs2::inline entities
--------------------------------------------------------------------------------
/deadlock/source/valve/interfaces/citadel_input/citadel_input.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "citadel_input.hpp"
3 |
4 | namespace hack::valve::inline interfaces {
5 | _INLINE void citadel_input_t::set_view_angles( utils::vec3_t &angles ) noexcept {
6 | return g_set_view_angles( this, 0, &angles );
7 | }
8 | } // namespace hack::valve::inline interfaces
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/base_entity.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "base_entity.hpp"
4 | #include "base_player.hpp"
5 | #include "valve/entity_utils/entity_utils.hpp"
6 |
7 | namespace hack::valve::inline entities {
8 | bool entity_t::is_enemy( ) noexcept {
9 | return true;
10 | }
11 | } // namespace hack::valve::inline entities
--------------------------------------------------------------------------------
/deadlock/cpp.hint:
--------------------------------------------------------------------------------
1 | #define _OFFSET(add_offset, var, treturn, __VA_ARGS__) [[nodiscard]] _INLINE std::add_lvalue_reference_t< treturn __VA_OPT__(, ) __VA_ARGS__ > var( ) const noexcept { return *utils::base_address_t { this }.offset( add_offset ).as< std::add_pointer_t< treturn __VA_OPT__(, ) __VA_ARGS__ > >( ); }
2 | #define _HOOK(hooker, func) using fn_##func = decltype( &func ); fn_##func m_orig_##func = hack::systems::hook_impl< fn_##func >( _HASH( #hooker ), hooker, reinterpret_cast< void * >( func ) );
3 |
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/base_entity.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "base_entity.hpp"
3 |
4 | namespace hack::valve::inline entities {
5 | _INLINE bool entity_t::is_player_pawn( ) const noexcept {
6 | return is_class( _HASH( "C_CitadelPlayerPawn" ) );
7 | }
8 |
9 | _INLINE bool entity_t::is_player_controller( ) const noexcept {
10 | return is_class( _HASH( "CCitadelPlayerController" ) );
11 | }
12 |
13 | _INLINE bool entity_t::is_modifier_invis( ) const noexcept {
14 | return is_class( _HASH( "CCitadel_Modifier_Invis" ) );
15 | }
16 | } // namespace hack::cs2::inline entities
17 |
--------------------------------------------------------------------------------
/deadlock/source/valve/interfaces/mem_alloc/mem_alloc.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace hack::valve::inline interfaces {
4 | inline const auto g_alloc_func = systems::get_export< fastcall_t< void *, std::size_t > >( "tier0.dll", "MemAlloc_AllocFunc" );
5 | inline const auto g_realloc_func
6 | = systems::get_export< fastcall_t< void *, void *, std::size_t > >( "tier0.dll", "MemAlloc_ReallocFunc" );
7 | inline const auto g_free_func = systems::get_export< fastcall_t< void, void *> >( "tier0.dll", "MemAlloc_FreeFunc" );
8 | inline const auto g_str_dup_func = systems::get_export< fastcall_t< char *, const char * > >( "tier0.dll", "MemAlloc_StrDupFunc" );
9 | } // namespace hack::valve::inline interfaces
--------------------------------------------------------------------------------
/deadlock/source/core/ui/ui.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ui.hpp"
3 |
4 | namespace hack::core {
5 | _INLINE ui_t::ui_t( ) noexcept {
6 | auto &style { ImGui::GetStyle( ) };
7 |
8 | style.AntiAliasedFill = false;
9 | style.AntiAliasedLines = false;
10 | style.WindowRounding = 0.0f;
11 | style.ChildRounding = 6.f;
12 | style.PopupRounding = 2.f;
13 | style.FrameRounding = 2.f;
14 | style.ScrollbarRounding = 2.f;
15 | style.GrabRounding = 2.f;
16 | style.TabRounding = 2.f;
17 |
18 | ImGui::StyleColorsDark( ); ///< Set a dark theme by default
19 | }
20 |
21 | _INLINE bool &ui_t::opened( ) noexcept {
22 | return m_opened;
23 | }
24 | } // namespace hack::core
25 |
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/handle_entity.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "handle_entity.hpp"
3 |
4 | namespace hack::valve::inline entities {
5 | _INLINE auto i_handle_entity_t::game_get_ent_class_info( void *, class_info_t **ret ) const noexcept {
6 | return hack::utils::get_virtual< void >( 36, this, &ret );
7 | }
8 |
9 | _INLINE interfaces::class_info_t *i_handle_entity_t::get_class_info( ) const noexcept {
10 | interfaces::class_info_t *ret { };
11 | hack::utils::get_virtual< void >( 38, this, &ret );
12 | return ret;
13 | }
14 |
15 | bool i_handle_entity_t::is_class( const std::size_t name_hash ) const noexcept {
16 | const auto class_info { get_class_info( ) };
17 | return class_info ? _HASH( class_info->m_name ) == name_hash : false;
18 | }
19 | } // namespace hack::valve::inline entities
--------------------------------------------------------------------------------
/deadlock/source/core/ui/ui.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "imgui/imgui.h"
3 | #include "vendor.hpp"
4 |
5 | namespace hack::core {
6 | /**
7 | * @brief Structure representing the core UI.
8 | */
9 | struct ui_t {
10 | /**
11 | * @brief Initializes the UI components and sets up the layout.
12 | */
13 | _INLINE ui_t( ) noexcept;
14 |
15 | _INLINE bool &opened( ) noexcept;
16 |
17 | /**
18 | * @brief Renders the main menu interface.
19 | */
20 | void render( ) const noexcept;
21 |
22 | /**
23 | * @brief Cleans up UI resources if needed.
24 | */
25 | static void cleanup( ) noexcept;
26 |
27 | private:
28 | bool m_opened { };
29 | };
30 |
31 | inline auto g_ui { std::unique_ptr< ui_t > {} };
32 | } // namespace hack::core
33 |
34 | #include "ui.inl"
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/data_types/utl/utl_memory_pool.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace hack::valve::inline data_types {
4 | class utl_memory_pool_t {
5 | public:
6 | struct free_list_t {
7 | free_list_t *m_next{ }, *m_prev{ };
8 | void* m_data{ };
9 | };
10 |
11 | struct blob_t {
12 | blob_t* m_next_blob{ };
13 | std::int32_t m_num_bytes{ };
14 | free_list_t m_free_list[ 1 ] = { };
15 | };
16 |
17 | int m_block_size{ }, m_blocks_per_blob{ }, m_grow_mode{ }, m_blocks_allocated{ }, m_peak_alloc{ };
18 | std::uint16_t m_alignment{ }, m_num_blobs{ };
19 | free_list_t *m_head_of_free_list{ }, *m_free_list{ };
20 | blob_t *m_last_blob{ }, *m_first_blob{ };
21 | int m_mem_alloc_attribute{ };
22 | std::uint8_t m_unknown{ };
23 | };
24 | } // namespace hack::cs2::inline data_types
--------------------------------------------------------------------------------
/deadlock.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
4 | True
5 | True
6 | True
7 | True
8 | True
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/data_types/handle/handle.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "handle.hpp"
3 |
4 | namespace hack::valve::inline data_types {
5 | _INLINE constexpr void c_handle::set_index( const std::uint32_t index ) {
6 | m_index = index;
7 | }
8 |
9 | _INLINE constexpr bool c_handle::is_valid( ) const noexcept {
10 | return m_index != k_invalid_ehandle_index;
11 | }
12 |
13 | _INLINE constexpr int c_handle::get_index( ) const noexcept {
14 | return is_valid( ) ? static_cast< int >( m_index & k_ent_entry_mask ) : 0;
15 | }
16 |
17 | _INLINE constexpr std::uint32_t c_handle::get_int( ) const noexcept {
18 | return m_index;
19 | }
20 |
21 | _INLINE constexpr bool c_handle::operator== ( const c_handle rhs ) const noexcept {
22 | return m_index == rhs.m_index;
23 | }
24 |
25 | _INLINE constexpr bool c_handle::operator!= ( const c_handle rhs ) const noexcept {
26 | return m_index != rhs.m_index;
27 | }
28 | } // namespace hack::valve::inline data_types
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/handle_entity.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../data_types/handle/handle.hpp"
3 | #include "valve/net_vars/net_vars.hpp"
4 |
5 | namespace hack::valve::inline entities {
6 | static inline constexpr std::uint32_t k_num_serial_shift_bits { 0xfu };
7 | struct entity_identity_t;
8 |
9 | struct i_handle_entity_t {
10 | i_handle_entity_t( ) = delete;
11 | i_handle_entity_t( i_handle_entity_t && ) = delete;
12 | i_handle_entity_t( const i_handle_entity_t & ) = delete;
13 |
14 | NET_VAR( "CEntityInstance", m_pEntity, entity_identity_t * )
15 |
16 | [[nodiscard]] _INLINE auto game_get_ent_class_info( void *, class_info_t **ret ) const noexcept;
17 |
18 | [[nodiscard]] _INLINE interfaces::class_info_t *get_class_info( ) const noexcept;
19 |
20 | [[nodiscard]] _INLINE bool is_class( const std::size_t name_hash ) const noexcept;
21 | };
22 | } // namespace hack::valve::inline entities
23 |
24 | #include "handle_entity.inl"
--------------------------------------------------------------------------------
/deadlock.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.8.34330.188
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "deadlock", "deadlock\deadlock.vcxproj", "{2459ED8D-1EC2-4E70-8F8C-87B18AF0D702}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | debug|x64 = debug|x64
11 | release|x64 = release|x64
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {2459ED8D-1EC2-4E70-8F8C-87B18AF0D702}.debug|x64.ActiveCfg = dbg|x64
15 | {2459ED8D-1EC2-4E70-8F8C-87B18AF0D702}.debug|x64.Build.0 = dbg|x64
16 | {2459ED8D-1EC2-4E70-8F8C-87B18AF0D702}.release|x64.ActiveCfg = rel|x64
17 | {2459ED8D-1EC2-4E70-8F8C-87B18AF0D702}.release|x64.Build.0 = rel|x64
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {784FDB5C-D4DC-4149-8F45-290BAAA9E739}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/deadlock/source/systems/input/input.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "input.hpp"
3 |
4 | namespace hack::systems {
5 | _INLINE c_input::c_input( const HWND game_window ) noexcept {
6 | m_game_window = game_window;
7 | m_wnd_proc
8 | = reinterpret_cast< WNDPROC >( SetWindowLongPtr( m_game_window, GWLP_WNDPROC, reinterpret_cast< std::intptr_t >( wnd_proc ) ) );
9 | }
10 |
11 | _INLINE c_input::~c_input( ) noexcept {
12 | SetWindowLongPtr( m_game_window, GWLP_WNDPROC, reinterpret_cast< std::intptr_t >( m_wnd_proc ) );
13 |
14 | {
15 | const std::unique_lock lock_wnd_proc( m_wnd_proc_mutex );
16 |
17 | m_wnd_proc = nullptr;
18 | }
19 |
20 | m_game_window = nullptr;
21 | }
22 |
23 | _INLINE void c_input::register_callback( const key_id_t key_id, std::function< void( ) > &&callback ) noexcept {
24 | m_callbacks[ key_id - 1 ] = std::move( callback );
25 | }
26 |
27 | _INLINE auto c_input::get_hwnd( ) noexcept {
28 | return m_game_window;
29 | }
30 |
31 | _INLINE void c_input::remove_callback( const key_id_t key_id ) noexcept {
32 | m_callbacks[ key_id - 1 ] = nullptr;
33 | }
34 | } // namespace hack::systems
--------------------------------------------------------------------------------
/deadlock/source/valve/interfaces/schema_system/schema_system.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "schema_system.hpp"
3 |
4 | namespace hack::valve::inline interfaces {
5 | struct class_info_t;
6 |
7 | struct system_type_scope_t {
8 | system_type_scope_t( ) = delete;
9 | system_type_scope_t( system_type_scope_t && ) = delete;
10 | system_type_scope_t( const system_type_scope_t & ) = delete;
11 |
12 | _VFUNC( class_info_t *, find_decl_class( const char *class_name ), 2, this, class_name )
13 |
14 | _OFFSET( 0x8, get_name, char[ 256 ] )
15 | _OFFSET( 0x500, get_bindings_table, utl_ts_hash_t< class_info_data_t *, 256 > )
16 | };
17 |
18 | struct schema_system_t {
19 | schema_system_t( ) = delete;
20 | schema_system_t( schema_system_t && ) = delete;
21 | schema_system_t( const schema_system_t & ) = delete;
22 |
23 | _VFUNC( system_type_scope_t *, find_type_scope( const char *name, std::uint64_t *unk = nullptr ), 13, this, name, nullptr )
24 | };
25 |
26 | inline auto g_schema_system = systems::get_interface< schema_system_t * >( "schemasystem.dll", "SchemaSystem_001" );
27 | } // namespace hack::valve::inline interfaces
28 |
--------------------------------------------------------------------------------
/deadlock/source/systems/module_parser/module_parser.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "module_parser.hpp"
4 | #include "utils/hash/hash.hpp"
5 |
6 | namespace hack::systems::inline memory {
7 | bool module_parser_t::parse_modules( ) noexcept {
8 | const auto *const peb { get_current_teb( )->m_process_environment_block };
9 |
10 | _ASSERT( peb != nullptr );
11 |
12 | const auto *const modules_order { &peb->m_ldr->m_in_load_order_module_list };
13 |
14 | _ASSERT( modules_order != nullptr );
15 |
16 | for ( const auto *module { modules_order->m_flink }; module != nullptr && module != modules_order; module = module->m_flink ) {
17 | const auto ldr_table { utils::base_address_t { module }.self_offset(
18 | -_OFFSETOF( utils::ldr_data_table_entry, m_in_load_order_links ) ) };
19 |
20 | if ( !ldr_table )
21 | continue;
22 |
23 | auto module_record { std::make_unique< ldr_module_t >( ldr_table ) };
24 |
25 | if ( !module_record )
26 | continue;
27 |
28 | m_modules_list.try_emplace( _HASH( module_record->get_name( ) ), std::move( module_record ) );
29 | }
30 |
31 | return !m_modules_list.empty( );
32 | }
33 | } // namespace hack::systems::inline memory
--------------------------------------------------------------------------------
/deadlock/source/valve/interfaces/entity_system/entity_system.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "entity_system.hpp"
3 |
4 | namespace hack::valve::inline interfaces {
5 | _INLINE valve::entity_identity_t *game_entity_system_t::get_identity( const int idx ) const noexcept {
6 | if ( idx <= -1 || idx >= ( k_max_total_entities - 1 ) )
7 | return nullptr;
8 |
9 | const auto chunk_to_use { get_identity_chunks( )[ ( idx / k_max_entities_in_list ) ] }; // equal to ( index >> 9 )
10 |
11 | if ( !chunk_to_use )
12 | return nullptr;
13 |
14 | const auto identity { &chunk_to_use->m_identities[ idx % k_max_entities_in_list ] }; // equal to ( index & 1FF )
15 | if ( !identity )
16 | return nullptr;
17 |
18 | return identity;
19 | }
20 |
21 | _INLINE entity_identity_t *game_entity_system_t::get_entity( const c_handle ent ) const noexcept {
22 | return get_identity( ent.get_index( ) );
23 | }
24 |
25 | template < typename type_t >
26 | std::add_pointer_t< type_t > game_entity_system_t::get_entity( const int idx ) noexcept {
27 | if ( const auto identity { get_identity( idx ) }; identity && identity->m_handle.get_index( ) == idx ) {
28 | return std::to_address( identity->m_entity );
29 | }
30 | return nullptr;
31 | }
32 | } // namespace hack::valve::inline interfaces
--------------------------------------------------------------------------------
/deadlock/source/core/hooks/detours/client.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "../hooks.hpp"
4 | #include "valve/entity_utils/entity_utils.hpp"
5 | #include "valve/interfaces/citadel_input/citadel_input.hpp"
6 |
7 | namespace hack::core {
8 | void get_matrices( void *render_game_system, void *view_params, void *world_to_view, void *view_to_projection,
9 | void *world_to_projection, void *world_to_screen ) noexcept {
10 | g_orig_get_matrices( render_game_system, view_params, world_to_view, view_to_projection, world_to_projection, world_to_screen );
11 | }
12 |
13 | void create_move( valve::citadel_input_t *citadel_input, const int slot, const bool is_active ) {
14 | g_orig_create_move( citadel_input, slot, is_active );
15 |
16 | const auto local_controller { valve::g_entity_list->get_local_controller( ) };
17 | if ( !local_controller )
18 | return g_orig_create_move( citadel_input, slot, is_active );
19 |
20 | const auto cmd { local_controller->get_cmd( ) };
21 | if ( !cmd || !cmd->m_base_user_cmd || !cmd->m_camera_angle )
22 | return g_orig_create_move( citadel_input, slot, is_active );
23 |
24 | const auto base_cmd { cmd->m_base_user_cmd };
25 | if ( !base_cmd->m_angle )
26 | return g_orig_create_move( citadel_input, slot, is_active );
27 |
28 | // todo: legitbot :)
29 | }
30 | } // namespace hack::core
--------------------------------------------------------------------------------
/deadlock/source/valve/interfaces/schema_system/schema_system.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "systems/module_parser/module_parser.hpp"
3 | #include "utils/memory/memory.hpp"
4 | #include "valve/structs/data_types/utl/utl_hash.hpp"
5 |
6 | namespace hack::valve::inline interfaces {
7 | struct class_field_t;
8 | struct class_info_t;
9 |
10 | struct [[nodiscard]] base_class_info_data_t {
11 | std::int32_t m_offset { };
12 | class_info_t *m_class { };
13 | };
14 |
15 | struct base_class_info_t : base_class_info_data_t { };
16 |
17 | struct class_info_data_t {
18 | _PAD( 0x8 )
19 | const char *m_name { }, *m_description { };
20 | std::int32_t m_size_of { };
21 | std::uint8_t m_fields_count { };
22 | _PAD( 0x5 )
23 | std::uint8_t m_align_of { }, m_base_classes_count { };
24 | _PAD( 0x4 )
25 | class_field_t *m_fields { };
26 | _PAD( 0x8 )
27 | base_class_info_t *m_base_classes { };
28 | _PAD( 0x28 )
29 | };
30 |
31 | struct class_info_t : class_info_data_t { };
32 |
33 | struct [[nodiscard]] class_field_data_t {
34 | const char *m_name { };
35 | _PAD( 0x8 )
36 | std::int32_t m_offset { };
37 | _PAD( 0xC )
38 | };
39 |
40 | struct class_field_t : class_field_data_t {
41 | public:
42 | };
43 | } // namespace hack::valve::inline interfaces
44 |
45 | #include "schema_system.inl"
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/base_player.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "base_player.hpp"
4 | #include "valve/entity_utils/entity_utils.hpp"
5 | #include "valve/interfaces/citadel_input/citadel_input.hpp"
6 | #include "valve/interfaces/entity_system/entity_system.hpp"
7 |
8 | namespace hack::valve::inline entities {
9 | inline const auto g_get_index
10 | = systems::get_pattern< fastcall_t< void, void *, void * > >( "client.dll", "40 53 48 83 EC 20 4C 8B 41 10 48 8B DA" );
11 |
12 | user_cmd_pb_t *player_controller_t::get_cmd( ) const noexcept {
13 | const auto local_controller { g_entity_list->get_local_controller( ) };
14 | if ( !local_controller || local_controller != this )
15 | return { };
16 |
17 | int index { };
18 | g_get_index( local_controller, &index );
19 |
20 | std::intptr_t corrected_index;
21 | if ( index != -1 ) {
22 | if ( static_cast< std::uint32_t >( index - 1 ) > k_max_entity_lists - 1 )
23 | return { };
24 |
25 | corrected_index = static_cast< std::uint32_t >( index - 1 );
26 | } else {
27 | corrected_index = 0xFFFFFFFF;
28 | }
29 |
30 | const auto base_cmd_ptr { *utils::base_address_t { g_cmd_base }.offset( corrected_index * 0x8 ).as< base_user_cmd_t ** >( ) };
31 | return g_get_user_cmd( local_controller, *utils::base_address_t { base_cmd_ptr }.offset( 21136 ).as< std::uint32_t * >( ) );
32 | }
33 | } // namespace hack::valve::inline entities
--------------------------------------------------------------------------------
/deadlock/source/utils/memory/memory.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "base_address/base_address.hpp"
3 |
4 | #define _OFFSET( add_offset, var, treturn, ... ) \
5 | [[nodiscard]] _INLINE std::add_lvalue_reference_t< treturn __VA_OPT__(, ) __VA_ARGS__ > var( ) const noexcept { \
6 | return *utils::base_address_t { this }.offset( add_offset ).as< std::add_pointer_t< treturn __VA_OPT__(, ) __VA_ARGS__ > >( ); \
7 | }
8 |
9 | #define _VFUNC( ret_type, name, index, ... ) \
10 | [[nodiscard]] _INLINE constexpr auto name const noexcept { \
11 | return hack::utils::get_virtual< ret_type >( index, __VA_ARGS__ ); \
12 | }
13 |
14 | namespace hack::utils::inline memory {
15 | /**
16 | * Retrieves the function pointer at the specified index in the virtual function table
17 | * @tparam T Integral type
18 | * @param base Base address of the vtable
19 | * @param args Argument list
20 | * @param index Index of the function pointer in the vtable
21 | * @return Function call
22 | */
23 | template < typename T, typename... args_t >
24 | _INLINE T get_virtual( const std::uint32_t index, const void *base, args_t... args ) noexcept {
25 | const auto vtable { *reinterpret_cast< fastcall_t< T, void *, args_t... > ** >( const_cast< void * >( base ) ) };
26 | return vtable[ index ]( const_cast< void * >( base ), args... );
27 | }
28 | } // namespace hack::utils::inline memory
--------------------------------------------------------------------------------
/deadlock/source/core/ui/ui.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "ui.hpp"
4 |
5 | namespace hack::core {
6 | void ui_t::render( ) const noexcept {
7 | if ( !m_opened )
8 | return;
9 |
10 | ImGui::SetNextWindowSize( { 630, 460 } );
11 |
12 | // Begin rendering a simple main menu
13 | ImGui::Begin( "Hack Menu" );
14 |
15 | // Display tabs or main options
16 | if ( ImGui::CollapsingHeader( "Settings" ) ) {
17 | ImGui::Text( "Configuration Settings" );
18 |
19 | static auto feature_enabled { false };
20 | ImGui::Checkbox( "Enable Feature", &feature_enabled );
21 |
22 | static auto slider_value { 0.5f };
23 | ImGui::SliderFloat( "Intensity", &slider_value, 0.0f, 1.0f, "%.2f" );
24 |
25 | static auto choice { 0 };
26 | const char *items[] = { "Option 1", "Option 2", "Option 3" };
27 | ImGui::Combo( "Choose Option", &choice, items, IM_ARRAYSIZE( items ) );
28 | }
29 |
30 | if ( ImGui::CollapsingHeader( "Debug Tools" ) ) {
31 | ImGui::Text( "Debugging Options" );
32 | static auto show_metrics { false };
33 | ImGui::Checkbox( "Show Metrics Window", &show_metrics );
34 |
35 | if ( show_metrics ) {
36 | ImGui::ShowMetricsWindow( &show_metrics );
37 | }
38 | }
39 |
40 | ImGui::End( );
41 | }
42 |
43 | void ui_t::cleanup( ) noexcept {
44 | // todo: cleanup resources if necessary
45 | }
46 | } // namespace hack::core
47 |
--------------------------------------------------------------------------------
/deadlock/source/valve/entity_utils/entity_utils.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "entity_utils.hpp"
3 |
4 | namespace hack::valve {
5 | _INLINE c_entity_list::c_entity_list( ) {
6 | m_entities.reserve( k_ent_entry_mask );
7 | m_player_pawns.reserve( k_max_entity_lists );
8 | m_player_controllers.reserve( k_max_entity_lists );
9 |
10 | m_entity_system->get_listeners( ).add_to_head( &m_entity_listener );
11 |
12 | for ( int idx { }; idx <= m_entity_system->get_highest_entity_index( ); ++idx ) {
13 | const auto entity_instance { m_entity_system->get_entity( idx ) };
14 | if ( !entity_instance )
15 | continue;
16 |
17 | add_entity( entity_instance );
18 | }
19 |
20 | sort( );
21 | };
22 |
23 | _INLINE c_entity_list::~c_entity_list( ) noexcept {
24 | m_entity_system->get_listeners( ).find_and_remove( &m_entity_listener );
25 | }
26 |
27 | _INLINE std::span< entity_t *const > c_entity_list::get_entities( ) const noexcept {
28 | return m_entities;
29 | }
30 |
31 | _INLINE std::span< player_pawn_t *const > c_entity_list::get_player_pawns( ) const noexcept {
32 | return m_player_pawns;
33 | }
34 |
35 | _INLINE std::span< player_controller_t *const > c_entity_list::get_player_controllers( ) const noexcept {
36 | return m_player_controllers;
37 | }
38 |
39 | _INLINE player_controller_t *c_entity_list::get_local_controller( ) noexcept {
40 | return g_get_player_controller_by_id( -1 );
41 | }
42 | } // namespace hack::valve
--------------------------------------------------------------------------------
/deadlock/source/utils/hash/hash.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "vendor.hpp"
4 |
5 | #define _HASH \
6 | ::hack::utils::c_string_hash< std::string_view > { }
7 |
8 | namespace hack::utils {
9 | template < typename string_type >
10 | requires is_any_of< string_type, char, wchar_t, std::string, std::wstring, std::string_view, std::wstring_view >
11 | class c_string_hash {
12 | public:
13 | using basic_string
14 | = std::conditional_t< is_any_of< string_type, char, wchar_t >, std::basic_string_view< const string_type >, const string_type >;
15 |
16 | _INLINE constexpr std::size_t operator( ) ( const basic_string &string, std::size_t basis = m_basis ) const noexcept {
17 | for ( const auto &character : string )
18 | basis = ( basis ^ static_cast< std::uint8_t >( character ) ) * m_prime;
19 |
20 | return basis;
21 | }
22 |
23 | private:
24 | static constexpr auto m_prime { 0x100000001B3 };
25 | static constexpr auto m_basis { 0xCBF29CE484222325 };
26 | };
27 |
28 | namespace literals {
29 | _INLINE constexpr std::size_t operator""_hash ( const char *const string, [[maybe_unused]] const std::size_t length ) noexcept {
30 | return c_string_hash< char > { }( string );
31 | }
32 |
33 | _INLINE constexpr std::size_t operator""_hash ( const wchar_t *const string, [[maybe_unused]] const std::size_t length ) noexcept {
34 | return c_string_hash< wchar_t > { }( string );
35 | }
36 | } // namespace literals
37 | } // namespace hack::utils
--------------------------------------------------------------------------------
/deadlock/third_party/imgui/imgui_impl_dx11.h:
--------------------------------------------------------------------------------
1 | // dear imgui: Renderer Backend for DirectX11
2 | // This needs to be used along with a Platform Backend (e.g. Win32)
3 |
4 | // Implemented features:
5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID!
6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
7 |
8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
10 | // Learn about Dear ImGui:
11 | // - FAQ https://dearimgui.com/faq
12 | // - Getting Started https://dearimgui.com/getting-started
13 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
14 | // - Introduction, links and more at the top of imgui.cpp
15 |
16 | #pragma once
17 | #include "imgui.h" // IMGUI_IMPL_API
18 | #ifndef IMGUI_DISABLE
19 |
20 | struct ID3D11Device;
21 | struct ID3D11DeviceContext;
22 |
23 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context);
24 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown();
25 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame();
26 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data);
27 |
28 | // Use if you want to reset your rendering device without losing Dear ImGui state.
29 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects();
30 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects();
31 |
32 | #endif // #ifndef IMGUI_DISABLE
33 |
--------------------------------------------------------------------------------
/deadlock/source/core/hooks/detours/game_overlay_renderer.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "../hooks.hpp"
4 | #include "core/ui/ui.hpp"
5 | #include "systems/render/render.hpp"
6 |
7 | namespace hack::core {
8 | std::int32_t present( IDXGISwapChain *const swap_chain, const std::uint32_t sync_interval,
9 | const std::uint32_t flags ) noexcept {
10 | if ( !systems::g_render )
11 | return g_orig_present( swap_chain, sync_interval, flags );
12 |
13 | // Prepare some imgui data
14 | {
15 | systems::g_render->prepare( swap_chain );
16 | systems::g_render->new_frame( );
17 | }
18 |
19 | // Render draw data
20 | {
21 | core::g_ui->render( );
22 |
23 | ImGui::Render( );
24 | ImGui_ImplDX11_RenderDrawData( ImGui::GetDrawData( ) );
25 | }
26 |
27 | // End of present
28 | const auto result { g_orig_present( swap_chain, sync_interval, flags ) };
29 | if ( systems::g_render )
30 | systems::g_render->reset( );
31 |
32 | return result;
33 | }
34 |
35 | std::int32_t resize_buffers( IDXGISwapChain *const swap_chain, const std::uint32_t buffer_count,
36 | const std::uint32_t width, const std::uint32_t height, const std::int32_t new_format,
37 | const std::uint32_t swap_chain_flags ) noexcept {
38 | systems::g_render->resize_buffers( );
39 | return g_orig_resize_buffers( swap_chain, buffer_count, width, height, new_format, swap_chain_flags );
40 | }
41 | } // namespace hack::core
--------------------------------------------------------------------------------
/deadlock/source/valve/structs/entities/base_entity.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "handle_entity.hpp"
3 | #include "utils/math/data_types/vector.hpp"
4 | #include "valve/net_vars/net_vars.hpp"
5 |
6 | namespace hack::valve::inline data_types {
7 | struct collision_property_t;
8 | struct game_scene_node_t;
9 | } // namespace hack::valve::inline data_types
10 |
11 | namespace hack::valve::inline entities {
12 | struct entity_identity_t;
13 |
14 | struct entity_t : i_handle_entity_t {
15 | entity_t( ) = delete;
16 | entity_t( entity_t && ) = delete;
17 | entity_t( const entity_t & ) = delete;
18 |
19 | NET_VAR( "C_BaseEntity", m_iHealth, int );
20 | NET_VAR( "C_BaseEntity", m_iMaxHealth, int );
21 | NET_VAR( "C_BaseEntity", m_pCollision, collision_property_t * );
22 | NET_VAR( "C_BaseEntity", m_iTeamNum, std::uint8_t )
23 |
24 | [[nodiscard]] _INLINE bool is_player_pawn( ) const noexcept, is_player_controller( ) const noexcept,
25 | is_modifier_invis( ) const noexcept;
26 | [[nodiscard]] bool is_enemy( ) noexcept;
27 | };
28 |
29 | struct base_model_entity_t : entity_t {
30 | base_model_entity_t( ) = delete;
31 | base_model_entity_t( base_model_entity_t && ) = delete;
32 | base_model_entity_t( const base_model_entity_t & ) = delete;
33 | };
34 |
35 | struct entity_instance_t {
36 | entity_instance_t( ) = delete;
37 | entity_instance_t( entity_instance_t && ) = delete;
38 | entity_instance_t( const entity_instance_t & ) = delete;
39 |
40 | NET_VAR( "CEntityInstance", m_entity, entity_identity_t * );
41 | };
42 |
43 | } // namespace hack::valve::inline entities
44 |
45 | #include "base_entity.inl"
--------------------------------------------------------------------------------
/deadlock/third_party/minhk/hde/pstdint.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * MinHook - The Minimalistic API Hooking Library for x64/x86
3 | * Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * 2. Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in the
13 | * documentation and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | #pragma once
28 |
29 | #include
30 |
31 | // Integer types for HDE.
32 | typedef INT8 int8_t;
33 | typedef INT16 int16_t;
34 | typedef INT32 int32_t;
35 | typedef INT64 int64_t;
36 | typedef UINT8 uint8_t;
37 | typedef UINT16 uint16_t;
38 | typedef UINT32 uint32_t;
39 | typedef UINT64 uint64_t;
40 |
--------------------------------------------------------------------------------
/deadlock/source/valve/net_vars/net_vars.inl:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "net_vars.hpp"
3 |
4 | namespace hack::valve {
5 | _INLINE net_vars_t::net_vars_t( ) noexcept {
6 | const auto type_scope { g_schema_system->find_type_scope( "client.dll" ) };
7 | if ( !type_scope )
8 | return;
9 |
10 | auto &binding_table { type_scope->get_bindings_table( ) };
11 | const auto elements { std::make_unique_for_overwrite< utl_ts_hash_handle_t[] >( binding_table.count( ) ) };
12 | const auto elements_count { binding_table.get_elements( 0, binding_table.count( ), elements.get( ) ) };
13 |
14 | for ( int i { }; i < elements_count; i++ ) {
15 | const auto element { elements[ i ] };
16 | if ( !element )
17 | continue;
18 |
19 | const auto class_binding { binding_table.element( element ) };
20 | if ( !class_binding )
21 | continue;
22 |
23 | const auto class_hashed { _HASH( class_binding->m_name ) };
24 | const auto delimiter_hashed { _HASH( "->", class_hashed ) };
25 | for ( int j { }; j < class_binding->m_fields_count; j++ ) {
26 | auto &schema_field { class_binding->m_fields[ j ] };
27 | const auto field_hashed { _HASH( schema_field.m_name, delimiter_hashed ) };
28 |
29 | m_cache.try_emplace( field_hashed, schema_field.m_offset );
30 | }
31 | }
32 | }
33 |
34 | net_vars_t::~net_vars_t( ) noexcept {
35 | m_cache.clear( );
36 | }
37 |
38 | _INLINE std::uint32_t net_vars_t::get_offset( const std::size_t property_key ) noexcept {
39 | const auto &offset { m_cache.find( property_key ) };
40 | return offset == m_cache.end( ) ? 0 : offset->second;
41 | }
42 | } // namespace hack::valve
--------------------------------------------------------------------------------
/deadlock/source/bootstrap.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.hpp"
2 |
3 | #include "core/hooks/hooks.hpp"
4 | #include "core/ui/ui.hpp"
5 | #include "systems/input/input.hpp"
6 | #include "systems/logger/logger.hpp"
7 | #include "systems/render/render.hpp"
8 | #include "valve/entity_utils/entity_utils.hpp"
9 | #include "valve/net_vars/net_vars.hpp"
10 |
11 | namespace hack::bootstrap {
12 | void on_dll_detach( void *handle ) noexcept;
13 |
14 | void on_dll_attach( [[maybe_unused]] void *handle ) noexcept {
15 | systems::g_logger = std::make_unique< systems::logger_t >( "C:\\deadlock\\cheat.log" );
16 | systems::g_render = std::make_unique< systems::render_t >( );
17 | valve::g_net_vars = std::make_unique< valve::net_vars_t >( );
18 | valve::g_entity_list = std::make_unique< valve::c_entity_list >( );
19 |
20 | systems::g_input->register_callback( VK_END, [ handle ] {
21 | systems::g_input->remove_callback( VK_END );
22 | std::jthread( on_dll_detach, handle ).detach( );
23 | } );
24 | }
25 |
26 | void on_dll_detach( void *handle ) noexcept {
27 | _INFO_LOG( "Unloading..." );
28 |
29 | systems::g_hook_manager.reset( );
30 | core::g_ui.reset( );
31 | systems::g_render.reset( );
32 | systems::g_input.reset( );
33 | valve::g_net_vars.reset( );
34 | valve::g_entity_list.reset( );
35 |
36 | systems::g_logger.reset( );
37 |
38 | FreeLibrary( static_cast< HMODULE >( handle ) );
39 | }
40 | } // namespace hack::bootstrap
41 |
42 | bool _STDCALL DllMain( void *handle, const std::uint8_t reason, [[maybe_unused]] void *const reserved ) {
43 | if ( reason == DLL_PROCESS_ATTACH ) {
44 | std::jthread( hack::bootstrap::on_dll_attach, handle ).detach( );
45 | return true;
46 | }
47 | return false;
48 | }
--------------------------------------------------------------------------------
/deadlock/source/systems/render/render.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "imgui/imgui_impl_dx11.h"
3 | #include "imgui/imgui_impl_win32.h"
4 |
5 | #include "utils/math/data_types/vector.hpp"
6 | #include "vendor.hpp"
7 |
8 | namespace hack::systems {
9 | /// @brief A struct for rendering ImGui in a DirectX 11 environment.
10 | struct render_t {
11 | /// @brief Initialize render.
12 | _INLINE render_t( ) noexcept;
13 |
14 | /// @brief Destructor.
15 | _INLINE ~render_t( ) noexcept;
16 |
17 | /**
18 | * @brief Prepares ImGui rendering.
19 | *
20 | * @param swap_chain Pointer to the IDXGISwapChain interface. This interface is used to manipulate an image
21 | * buffer (a swap chain).
22 | */
23 | void prepare( IDXGISwapChain *swap_chain ) noexcept;
24 |
25 | /// @brief Resets the rendering environment.
26 | void reset( ) noexcept;
27 |
28 | /// @brief Resizes rendering buffers.
29 | void resize_buffers( ) noexcept;
30 |
31 | /// @brief Starts a new frame for rendering.
32 | void new_frame( ) const noexcept;
33 |
34 | private:
35 | struct {
36 | ImFont *m_esp { };
37 | } m_fonts { };
38 |
39 | ImGuiIO *m_imgui_io { }; /**< Pointer to the ImGuiIO structure. */
40 | ID3D11Device *m_d3d11device { }; /**< Pointer to the Direct3D 11 device. */
41 | ID3D11DeviceContext *m_d3d11device_context { }; /**< Pointer to the Direct3D 11 device context. */
42 | ID3D11RenderTargetView *m_render_target_view { }, *m_backup_render_target_view { }; /**< Render target views. */
43 | bool m_initialized { };
44 | };
45 |
46 | inline auto g_render { std::unique_ptr< render_t > {} };
47 | } // namespace hack::systems
48 |
49 | #include "render.inl"
--------------------------------------------------------------------------------
/deadlock/third_party/minhk/buffer.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * MinHook - The Minimalistic API Hooking Library for x64/x86
3 | * Copyright (C) 2009-2017 Tsuda Kageyu.
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | * 2. Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in the
14 | * documentation and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #pragma once
30 |
31 | // Size of each memory slot.
32 | #if defined(_M_X64) || defined(__x86_64__)
33 | #define MEMORY_SLOT_SIZE 64
34 | #else
35 | #define MEMORY_SLOT_SIZE 32
36 | #endif
37 |
38 | VOID InitializeBuffer(VOID);
39 | VOID UninitializeBuffer(VOID);
40 | LPVOID AllocateBuffer(LPVOID pOrigin);
41 | VOID FreeBuffer(LPVOID pBuffer);
42 | BOOL IsExecutableAddress(LPVOID pAddress);
43 |
--------------------------------------------------------------------------------
/deadlock/source/pch/pch.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | // 17.4.1.2 Headers
3 |
4 | // clang-format off
5 | #include
6 | #include
7 | // clang-format on
8 | #include "propvarutil.h"
9 | #include
10 | #include