Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Build directories
/cmake-build-*/
/build/
/out/
/.idea/

# Dependency directories
*/vendor/*/
.gitignore
.vscode/
nyx_core.txt
nyx_injector.bat
nyx_style.txt
logs
*.logs
.*
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_definitions(-DENGINE_IMGUI -DIMGUI_USE_WCHAR32)

add_subdirectory(Engine)
#add_subdirectory(SampleApp)
add_subdirectory(CheatStengine)
add_subdirectory(CheatStengineDriver)
add_subdirectory(CheatStengineDriver)
93 changes: 87 additions & 6 deletions CheatStengine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,109 @@
# Matches the version required by the top-level CMakeLists.txt. Present here too so
# this file is self-consistent and never emits a "No cmake_minimum_required" warning.
cmake_minimum_required(VERSION 3.30)

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
get_filename_component(_cs_repo_root "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY)
message(FATAL_ERROR
"CheatStengine is a subproject and cannot be configured on its own.\n"
"It links the 'Engine' target and requires C++20, both set up by the "
"top-level CMakeLists.txt. Configure from the repository root instead:\n"
" cmake -S \"${_cs_repo_root}\" -B \"${_cs_repo_root}/out/build/x64-Release\" -G Ninja -DCMAKE_BUILD_TYPE=Release\n"
" cmake --build \"${_cs_repo_root}/out/build/x64-Release\"\n"
"See the 'Compiling from Source' section of the README.")
endif ()

project(CheatStengine)

include(vendor/zasm.cmake)
include(vendor/icon_font_cpp_headers.cmake)
include(vendor/json.cmake)
include(vendor/httplib.cmake)
#include(vendor/imgui_hex_editor.cmake)

file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
add_executable(${PROJECT_NAME}
src/CheatStengine/AddressEvaluator/Ast.cpp
src/CheatStengine/AddressEvaluator/Evaluator.cpp
src/CheatStengine/AddressEvaluator/Lexer.cpp
src/CheatStengine/AddressEvaluator/Parser.cpp
src/CheatStengine/Assembly/Assembler.cpp
src/CheatStengine/Assembly/Formatter.cpp
src/CheatStengine/main.cpp
src/CheatStengine/MainLayer.cpp
src/CheatStengine/Panes/DebugPane.cpp
src/CheatStengine/Panes/DisassemblyPane.cpp
src/CheatStengine/Panes/MemoryScannerPane.cpp
src/CheatStengine/Panes/MemoryViewerPane.cpp
src/CheatStengine/Panes/ModulesPane.cpp
src/CheatStengine/Panes/PatternScannerPane.cpp
src/CheatStengine/Panes/PEViewer.cpp
src/CheatStengine/Panes/StructDissectPane.cpp
src/CheatStengine/Panes/WatchPane.cpp
src/CheatStengine/Process/Device.cpp
src/CheatStengine/Process/KernelProcess.cpp
src/CheatStengine/Process/Monitor.cpp
src/CheatStengine/Process/Process.cpp
src/CheatStengine/Process/WinAPIProcess.cpp
src/CheatStengine/Server/AuthManager.cpp
src/CheatStengine/Server/JobManager.cpp
src/CheatStengine/Server/McpInstaller.cpp
src/CheatStengine/Server/McpServer.cpp
src/CheatStengine/Server/SessionManager.cpp
src/CheatStengine/Server/ToolRegistry.cpp
src/CheatStengine/Settings/ComboSettings.cpp
src/CheatStengine/Settings/KeybindSetting.cpp
src/CheatStengine/Settings/KernelSettings.cpp
src/CheatStengine/Settings/SettingsCategory.cpp
src/CheatStengine/Settings/SettingsManager.cpp
src/CheatStengine/Settings/SliderSetting.cpp
src/CheatStengine/Settings/ToggleSetting.cpp
src/CheatStengine/Tools/MemoryScanner.cpp
src/CheatStengine/Tools/PatternGenerator.cpp
src/CheatStengine/Tools/PatternScanner.cpp
src/CheatStengine/Tools/RTTI.cpp
src/CheatStengine/Tools/StructDissect.cpp
src/CheatStengine/UI/ImGui/EditableLabel.cpp
src/CheatStengine/UI/ImGui/Fonts.cpp
src/CheatStengine/UI/ImGui/IconCache.cpp
src/CheatStengine/UI/ImGui/ImGuiHex.cpp
src/CheatStengine/UI/ImGui/Menu.cpp
src/CheatStengine/UI/MenuBar.cpp
src/CheatStengine/UI/TitleBar.cpp
src/CheatStengine/Utils.cpp
)

if (WIN32)
add_definitions(-DNOMINMAX)
target_compile_definitions(${PROJECT_NAME} PRIVATE
NOMINMAX
WIN32_LEAN_AND_MEAN
PLATFORM_WINDOWS
WINVER=0x0A00
_WIN32_WINNT=0x0A00
NTDDI_VERSION=0x0A000008
)
endif ()

target_include_directories(${PROJECT_NAME} PUBLIC
target_include_directories(${PROJECT_NAME} PRIVATE
src
${CMAKE_CURRENT_SOURCE_DIR}/../Shared
${ICON_FONT_CPP_HEADERS}
)
target_link_libraries(${PROJECT_NAME} PUBLIC
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W4>
)
target_link_libraries(${PROJECT_NAME} PRIVATE
Engine
zasm
nlohmann_json::nlohmann_json
httplib::httplib
Dbghelp
Shell32
Cfgmgr32
d3d11
)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/Resources
$<TARGET_FILE_DIR:${PROJECT_NAME}>/Resources
)
)
Binary file added CheatStengine/Resources/favicon.ico
Binary file not shown.
56 changes: 56 additions & 0 deletions CheatStengine/build/CMakeCache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is the CMakeCache file.
# For build in directory: f:/Downloads/CheatStengine-master/CheatStengine/build
# It was generated by CMake: C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=F:/Downloads/CheatStengine-master/CheatStengine/build/CMakeFiles/pkgRedirects


########################
# INTERNAL cache entries
########################

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=f:/Downloads/CheatStengine-master/CheatStengine/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=31
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=6
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Visual Studio 17 2022
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=F:/Downloads/CheatStengine-master/CheatStengine
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.31

1 change: 1 addition & 0 deletions CheatStengine/build/CMakeFiles/cmake.check_cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
59 changes: 59 additions & 0 deletions CheatStengine/out/build/x64-Release/CMakeCache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This is the CMakeCache file.
# For build in directory: f:/Downloads/CheatStengine-master/CheatStengine/out/build/x64-Release
# It was generated by CMake: C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//No help, variable specified on the command line.
CMAKE_BUILD_TYPE:UNINITIALIZED=Release

//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=F:/Downloads/CheatStengine-master/CheatStengine/out/build/x64-Release/CMakeFiles/pkgRedirects


########################
# INTERNAL cache entries
########################

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=f:/Downloads/CheatStengine-master/CheatStengine/out/build/x64-Release
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=31
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=6
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Ninja
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=F:/Downloads/CheatStengine-master/CheatStengine
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.31

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
7 changes: 5 additions & 2 deletions CheatStengine/src/CheatStengine/Core/ThreadPool.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <atomic>
#include <condition_variable>
#include <functional>
Expand All @@ -6,6 +8,7 @@
#include <queue>
#include <stdexcept>
#include <thread>
#include <type_traits>
#include <vector>

class ThreadPool {
Expand Down Expand Up @@ -51,9 +54,9 @@ class ThreadPool {
}

template <class F, class... Args>
std::future<std::result_of_t<F(Args...)>> Enqueue(F&& f, Args&&... args)
std::future<std::invoke_result_t<F, Args...>> Enqueue(F&& f, Args&&... args)
{
using return_type = std::result_of_t<F(Args...)>;
using return_type = std::invoke_result_t<F, Args...>;

auto task = std::make_shared<std::packaged_task<return_type()>>(
std::bind(std::forward<F>(f), std::forward<Args>(args)...));
Expand Down
Loading