From e52b7b446ae198b2eae5060865d3e6a5dd3d32ee Mon Sep 17 00:00:00 2001
From: Jous99 <95310824+Jous99@users.noreply.github.com>
Date: Tue, 6 Jan 2026 18:52:24 +0100
Subject: [PATCH] subida de archivos
archivos originales del proyecto F4MP
---
f4mp_originalcode/F4MPClient/.gitignore | 38 +
f4mp_originalcode/F4MPClient/CMakeLists.txt | 48 +
.../F4MPClient/CMakeSettings.json | 28 +
f4mp_originalcode/F4MPClient/LICENSE | 674 +
f4mp_originalcode/F4MPClient/README.md | 1 +
.../F4MPClient/common/CMakeLists.txt | 14 +
.../F4MPClient/common/include/Exceptions.h | 126 +
.../F4MPClient/common/include/GamePtr.h | 81 +
.../F4MPClient/common/include/Hook.h | 257 +
.../F4MPClient/common/include/Types.h | 20 +
.../F4MPClient/common/include/Utilities.h | 215 +
.../F4MPClient/common/include/detours.h | 1059 +
.../F4MPClient/common/include/main.h | 1 +
.../F4MPClient/common/src/GamePtr.cpp | 12 +
.../F4MPClient/include/spdlog/async.h | 93 +
.../include/spdlog/async_logger-inl.h | 92 +
.../F4MPClient/include/spdlog/async_logger.h | 68 +
.../F4MPClient/include/spdlog/cfg/argv.h | 45 +
.../F4MPClient/include/spdlog/cfg/env.h | 36 +
.../include/spdlog/cfg/helpers-inl.h | 103 +
.../F4MPClient/include/spdlog/cfg/helpers.h | 28 +
.../include/spdlog/cfg/log_levels.h | 47 +
.../F4MPClient/include/spdlog/common-inl.h | 76 +
.../F4MPClient/include/spdlog/common.h | 246 +
.../include/spdlog/details/backtracer-inl.h | 69 +
.../include/spdlog/details/backtracer.h | 45 +
.../include/spdlog/details/circular_q.h | 141 +
.../include/spdlog/details/console_globals.h | 32 +
.../include/spdlog/details/file_helper-inl.h | 132 +
.../include/spdlog/details/file_helper.h | 59 +
.../include/spdlog/details/fmt_helper.h | 116 +
.../include/spdlog/details/log_msg-inl.h | 37 +
.../include/spdlog/details/log_msg.h | 36 +
.../spdlog/details/log_msg_buffer-inl.h | 58 +
.../include/spdlog/details/log_msg_buffer.h | 33 +
.../include/spdlog/details/mpmc_blocking_q.h | 120 +
.../include/spdlog/details/null_mutex.h | 49 +
.../include/spdlog/details/os-inl.h | 554 +
.../F4MPClient/include/spdlog/details/os.h | 111 +
.../spdlog/details/periodic_worker-inl.h | 49 +
.../include/spdlog/details/periodic_worker.h | 40 +
.../include/spdlog/details/registry-inl.h | 299 +
.../include/spdlog/details/registry.h | 112 +
.../spdlog/details/synchronous_factory.h | 24 +
.../spdlog/details/tcp_client-windows.h | 175 +
.../include/spdlog/details/tcp_client.h | 145 +
.../include/spdlog/details/thread_pool-inl.h | 124 +
.../include/spdlog/details/thread_pool.h | 120 +
.../include/spdlog/details/windows_include.h | 11 +
.../include/spdlog/fmt/bin_to_hex.h | 216 +
.../include/spdlog/fmt/bundled/LICENSE.rst | 27 +
.../include/spdlog/fmt/bundled/chrono.h | 1119 +
.../include/spdlog/fmt/bundled/color.h | 568 +
.../include/spdlog/fmt/bundled/compile.h | 595 +
.../include/spdlog/fmt/bundled/core.h | 1796 ++
.../include/spdlog/fmt/bundled/format-inl.h | 1403 +
.../include/spdlog/fmt/bundled/format.h | 3648 +++
.../include/spdlog/fmt/bundled/locale.h | 78 +
.../include/spdlog/fmt/bundled/ostream.h | 166 +
.../include/spdlog/fmt/bundled/posix.h | 2 +
.../include/spdlog/fmt/bundled/printf.h | 726 +
.../include/spdlog/fmt/bundled/ranges.h | 387 +
.../F4MPClient/include/spdlog/fmt/fmt.h | 25 +
.../F4MPClient/include/spdlog/fmt/ostr.h | 20 +
.../F4MPClient/include/spdlog/formatter.h | 18 +
.../F4MPClient/include/spdlog/fwd.h | 14 +
.../F4MPClient/include/spdlog/logger-inl.h | 253 +
.../F4MPClient/include/spdlog/logger.h | 366 +
.../include/spdlog/pattern_formatter-inl.h | 1358 +
.../include/spdlog/pattern_formatter.h | 126 +
.../include/spdlog/sinks/android_sink.h | 119 +
.../include/spdlog/sinks/ansicolor_sink-inl.h | 143 +
.../include/spdlog/sinks/ansicolor_sink.h | 118 +
.../include/spdlog/sinks/base_sink-inl.h | 63 +
.../include/spdlog/sinks/base_sink.h | 52 +
.../spdlog/sinks/basic_file_sink-inl.h | 43 +
.../include/spdlog/sinks/basic_file_sink.h | 58 +
.../include/spdlog/sinks/daily_file_sink.h | 204 +
.../include/spdlog/sinks/dist_sink.h | 97 +
.../include/spdlog/sinks/dup_filter_sink.h | 90 +
.../include/spdlog/sinks/msvc_sink.h | 49 +
.../include/spdlog/sinks/null_sink.h | 44 +
.../include/spdlog/sinks/ostream_sink.h | 50 +
.../include/spdlog/sinks/ringbuffer_sink.h | 74 +
.../spdlog/sinks/rotating_file_sink-inl.h | 131 +
.../include/spdlog/sinks/rotating_file_sink.h | 78 +
.../include/spdlog/sinks/sink-inl.h | 25 +
.../F4MPClient/include/spdlog/sinks/sink.h | 35 +
.../spdlog/sinks/stdout_color_sinks-inl.h | 38 +
.../include/spdlog/sinks/stdout_color_sinks.h | 45 +
.../include/spdlog/sinks/stdout_sinks-inl.h | 94 +
.../include/spdlog/sinks/stdout_sinks.h | 80 +
.../include/spdlog/sinks/syslog_sink.h | 109 +
.../include/spdlog/sinks/systemd_sink.h | 103 +
.../include/spdlog/sinks/tcp_sink.h | 81 +
.../include/spdlog/sinks/win_eventlog_sink.h | 266 +
.../include/spdlog/sinks/wincolor_sink-inl.h | 180 +
.../include/spdlog/sinks/wincolor_sink.h | 94 +
.../F4MPClient/include/spdlog/spdlog-inl.h | 115 +
.../F4MPClient/include/spdlog/spdlog.h | 289 +
.../F4MPClient/include/spdlog/tweakme.h | 116 +
.../F4MPClient/include/spdlog/version.h | 10 +
.../F4MPClient/include/steam/isteamapplist.h | 63 +
.../F4MPClient/include/steam/isteamapps.h | 154 +
.../include/steam/isteamappticket.h | 28 +
.../F4MPClient/include/steam/isteamclient.h | 503 +
.../include/steam/isteamcontroller.h | 210 +
.../F4MPClient/include/steam/isteamfriends.h | 629 +
.../include/steam/isteamgamecoordinator.h | 75 +
.../include/steam/isteamgameserver.h | 384 +
.../include/steam/isteamgameserverstats.h | 99 +
.../include/steam/isteamhtmlsurface.h | 444 +
.../F4MPClient/include/steam/isteamhttp.h | 210 +
.../include/steam/isteaminventory.h | 354 +
.../include/steam/isteammasterserverupdater.h | 1 +
.../include/steam/isteammatchmaking.h | 747 +
.../F4MPClient/include/steam/isteammusic.h | 67 +
.../include/steam/isteammusicremote.h | 129 +
.../include/steam/isteamnetworking.h | 306 +
.../include/steam/isteamps3overlayrenderer.h | 91 +
.../include/steam/isteamremotestorage.h | 675 +
.../include/steam/isteamscreenshots.h | 96 +
.../F4MPClient/include/steam/isteamugc.h | 385 +
.../include/steam/isteamunifiedmessages.h | 63 +
.../F4MPClient/include/steam/isteamuser.h | 380 +
.../include/steam/isteamuserstats.h | 465 +
.../F4MPClient/include/steam/isteamutils.h | 310 +
.../F4MPClient/include/steam/isteamvideo.h | 60 +
.../include/steam/matchmakingtypes.h | 251 +
.../F4MPClient/include/steam/steam_api.h | 650 +
.../F4MPClient/include/steam/steam_api.json | 7241 +++++
.../F4MPClient/include/steam/steam_api_flat.h | 657 +
.../include/steam/steam_api_interop.cs | 8803 ++++++
.../include/steam/steam_gameserver.h | 191 +
.../include/steam/steamclientpublic.h | 1165 +
.../include/steam/steamencryptedappticket.h | 32 +
.../F4MPClient/include/steam/steamhttpenums.h | 97 +
.../F4MPClient/include/steam/steamps3params.h | 112 +
.../F4MPClient/include/steam/steamtypes.h | 179 +
.../F4MPClient/include/steam/steamuniverse.h | 27 +
.../steamnetwork/isteamnetworkingsockets.h | 557 +
.../steamnetwork/isteamnetworkingutils.h | 208 +
.../include/steamnetwork/steamclientpublic.h | 1288 +
.../steamnetwork/steamnetworkingsockets.h | 45 +
.../steamnetworkingsockets_flat.h | 149 +
.../steamnetwork/steamnetworkingtypes.h | 1303 +
.../include/steamnetwork/steamtypes.h | 187 +
.../include/steamnetwork/steamuniverse.h | 27 +
.../F4MPClient/lib/F4MPReverse.lib | Bin 0 -> 152584 bytes
.../lib/GameNetworkingSockets_s.lib | Bin 0 -> 26279732 bytes
f4mp_originalcode/F4MPClient/lib/detours.lib | Bin 0 -> 662208 bytes
f4mp_originalcode/F4MPClient/lib/spdlogd.lib | Bin 0 -> 21527820 bytes
.../F4MPClient/lib/steam_api64.lib | Bin 0 -> 235086 bytes
.../F4MPClient/redist/steam_api64.dll | Bin 0 -> 206760 bytes
.../F4MPClient/src/DirectXHook.h | 162 +
f4mp_originalcode/F4MPClient/src/Global.h | 29 +
f4mp_originalcode/F4MPClient/src/Hooks/DXGI.h | 92 +
.../F4MPClient/src/Hooks/Direct3D11.cpp | 114 +
.../F4MPClient/src/Hooks/Direct3D11.h | 79 +
.../F4MPClient/src/Hooks/Direct3DBase.h | 27 +
.../F4MPClient/src/Hooks/Window.cpp | 53 +
.../F4MPClient/src/Hooks/Window.h | 23 +
.../F4MPClient/src/imgui/imconfig.h | 73 +
.../F4MPClient/src/imgui/imgui.cpp | 9234 ++++++
.../F4MPClient/src/imgui/imgui.h | 2121 ++
.../F4MPClient/src/imgui/imgui_demo.cpp | 4176 +++
.../F4MPClient/src/imgui/imgui_draw.cpp | 3181 ++
.../F4MPClient/src/imgui/imgui_impl_dx11.cpp | 512 +
.../F4MPClient/src/imgui/imgui_impl_dx11.h | 23 +
.../F4MPClient/src/imgui/imgui_impl_win32.cpp | 219 +
.../F4MPClient/src/imgui/imgui_impl_win32.h | 22 +
.../F4MPClient/src/imgui/imgui_internal.h | 1442 +
.../F4MPClient/src/imgui/imgui_widgets.cpp | 6550 ++++
.../F4MPClient/src/imgui/imstb_rectpack.h | 623 +
.../F4MPClient/src/imgui/imstb_textedit.h | 1409 +
.../F4MPClient/src/imgui/imstb_truetype.h | 4854 +++
f4mp_originalcode/F4MPClient/src/main.cpp | 103 +
f4mp_originalcode/F4MPServer/.gitignore | 37 +
f4mp_originalcode/F4MPServer/CMakeLists.txt | 87 +
.../F4MPServer/CMakeSettings.json | 28 +
f4mp_originalcode/F4MPServer/LICENSE | 674 +
f4mp_originalcode/F4MPServer/README.md | 35 +
.../include/minbase/minbase_decls.h | 205 +
.../include/minbase/minbase_identify.h | 197 +
.../F4MPServer/include/spdlog/async.h | 93 +
.../include/spdlog/async_logger-inl.h | 92 +
.../F4MPServer/include/spdlog/async_logger.h | 68 +
.../F4MPServer/include/spdlog/cfg/argv.h | 45 +
.../F4MPServer/include/spdlog/cfg/env.h | 36 +
.../include/spdlog/cfg/helpers-inl.h | 103 +
.../F4MPServer/include/spdlog/cfg/helpers.h | 28 +
.../include/spdlog/cfg/log_levels.h | 47 +
.../F4MPServer/include/spdlog/common-inl.h | 76 +
.../F4MPServer/include/spdlog/common.h | 246 +
.../include/spdlog/details/backtracer-inl.h | 69 +
.../include/spdlog/details/backtracer.h | 45 +
.../include/spdlog/details/circular_q.h | 141 +
.../include/spdlog/details/console_globals.h | 32 +
.../include/spdlog/details/file_helper-inl.h | 132 +
.../include/spdlog/details/file_helper.h | 59 +
.../include/spdlog/details/fmt_helper.h | 116 +
.../include/spdlog/details/log_msg-inl.h | 37 +
.../include/spdlog/details/log_msg.h | 36 +
.../spdlog/details/log_msg_buffer-inl.h | 58 +
.../include/spdlog/details/log_msg_buffer.h | 33 +
.../include/spdlog/details/mpmc_blocking_q.h | 120 +
.../include/spdlog/details/null_mutex.h | 49 +
.../include/spdlog/details/os-inl.h | 554 +
.../F4MPServer/include/spdlog/details/os.h | 111 +
.../spdlog/details/periodic_worker-inl.h | 49 +
.../include/spdlog/details/periodic_worker.h | 40 +
.../include/spdlog/details/registry-inl.h | 299 +
.../include/spdlog/details/registry.h | 112 +
.../spdlog/details/synchronous_factory.h | 24 +
.../spdlog/details/tcp_client-windows.h | 175 +
.../include/spdlog/details/tcp_client.h | 145 +
.../include/spdlog/details/thread_pool-inl.h | 124 +
.../include/spdlog/details/thread_pool.h | 120 +
.../include/spdlog/details/windows_include.h | 11 +
.../include/spdlog/fmt/bin_to_hex.h | 216 +
.../include/spdlog/fmt/bundled/LICENSE.rst | 27 +
.../include/spdlog/fmt/bundled/chrono.h | 1119 +
.../include/spdlog/fmt/bundled/color.h | 568 +
.../include/spdlog/fmt/bundled/compile.h | 595 +
.../include/spdlog/fmt/bundled/core.h | 1796 ++
.../include/spdlog/fmt/bundled/format-inl.h | 1403 +
.../include/spdlog/fmt/bundled/format.h | 3648 +++
.../include/spdlog/fmt/bundled/locale.h | 78 +
.../include/spdlog/fmt/bundled/ostream.h | 166 +
.../include/spdlog/fmt/bundled/posix.h | 2 +
.../include/spdlog/fmt/bundled/printf.h | 726 +
.../include/spdlog/fmt/bundled/ranges.h | 387 +
.../F4MPServer/include/spdlog/fmt/fmt.h | 25 +
.../F4MPServer/include/spdlog/fmt/ostr.h | 20 +
.../F4MPServer/include/spdlog/formatter.h | 18 +
.../F4MPServer/include/spdlog/fwd.h | 14 +
.../F4MPServer/include/spdlog/logger-inl.h | 253 +
.../F4MPServer/include/spdlog/logger.h | 366 +
.../include/spdlog/pattern_formatter-inl.h | 1358 +
.../include/spdlog/pattern_formatter.h | 126 +
.../include/spdlog/sinks/android_sink.h | 119 +
.../include/spdlog/sinks/ansicolor_sink-inl.h | 143 +
.../include/spdlog/sinks/ansicolor_sink.h | 118 +
.../include/spdlog/sinks/base_sink-inl.h | 63 +
.../include/spdlog/sinks/base_sink.h | 52 +
.../spdlog/sinks/basic_file_sink-inl.h | 43 +
.../include/spdlog/sinks/basic_file_sink.h | 58 +
.../include/spdlog/sinks/daily_file_sink.h | 204 +
.../include/spdlog/sinks/dist_sink.h | 97 +
.../include/spdlog/sinks/dup_filter_sink.h | 90 +
.../include/spdlog/sinks/msvc_sink.h | 49 +
.../include/spdlog/sinks/null_sink.h | 44 +
.../include/spdlog/sinks/ostream_sink.h | 50 +
.../include/spdlog/sinks/ringbuffer_sink.h | 74 +
.../spdlog/sinks/rotating_file_sink-inl.h | 131 +
.../include/spdlog/sinks/rotating_file_sink.h | 78 +
.../include/spdlog/sinks/sink-inl.h | 25 +
.../F4MPServer/include/spdlog/sinks/sink.h | 35 +
.../spdlog/sinks/stdout_color_sinks-inl.h | 38 +
.../include/spdlog/sinks/stdout_color_sinks.h | 45 +
.../include/spdlog/sinks/stdout_sinks-inl.h | 94 +
.../include/spdlog/sinks/stdout_sinks.h | 80 +
.../include/spdlog/sinks/syslog_sink.h | 109 +
.../include/spdlog/sinks/systemd_sink.h | 103 +
.../include/spdlog/sinks/tcp_sink.h | 81 +
.../include/spdlog/sinks/win_eventlog_sink.h | 266 +
.../include/spdlog/sinks/wincolor_sink-inl.h | 180 +
.../include/spdlog/sinks/wincolor_sink.h | 94 +
.../F4MPServer/include/spdlog/spdlog-inl.h | 115 +
.../F4MPServer/include/spdlog/spdlog.h | 289 +
.../F4MPServer/include/spdlog/tweakme.h | 116 +
.../F4MPServer/include/spdlog/version.h | 10 +
.../include/steam/isteamnetworkingsockets.h | 557 +
.../include/steam/isteamnetworkingutils.h | 208 +
.../include/steam/steamclientpublic.h | 1288 +
.../include/steam/steamnetworkingsockets.h | 45 +
.../steam/steamnetworkingsockets_flat.h | 149 +
.../include/steam/steamnetworkingtypes.h | 1303 +
.../F4MPServer/include/steam/steamtypes.h | 187 +
.../F4MPServer/include/steam/steamuniverse.h | 27 +
.../lib/GameNetworkingSockets_s.lib | Bin 0 -> 26279732 bytes
f4mp_originalcode/F4MPServer/lib/spdlogd.lib | Bin 0 -> 21527820 bytes
f4mp_originalcode/F4MPServer/src/Config.hpp | 57 +
f4mp_originalcode/F4MPServer/src/Helpers.hpp | 6 +
f4mp_originalcode/F4MPServer/src/Logger.cpp | 121 +
f4mp_originalcode/F4MPServer/src/Logger.hpp | 311 +
f4mp_originalcode/F4MPServer/src/Server.cpp | 47 +
f4mp_originalcode/F4MPServer/src/Server.hpp | 38 +
.../src/ThirdParty/nlohmann/json.hpp | 25471 ++++++++++++++++
f4mp_originalcode/F4MPServer/src/main.cpp | 121 +
290 files changed, 138049 insertions(+)
create mode 100644 f4mp_originalcode/F4MPClient/.gitignore
create mode 100644 f4mp_originalcode/F4MPClient/CMakeLists.txt
create mode 100644 f4mp_originalcode/F4MPClient/CMakeSettings.json
create mode 100644 f4mp_originalcode/F4MPClient/LICENSE
create mode 100644 f4mp_originalcode/F4MPClient/README.md
create mode 100644 f4mp_originalcode/F4MPClient/common/CMakeLists.txt
create mode 100644 f4mp_originalcode/F4MPClient/common/include/Exceptions.h
create mode 100644 f4mp_originalcode/F4MPClient/common/include/GamePtr.h
create mode 100644 f4mp_originalcode/F4MPClient/common/include/Hook.h
create mode 100644 f4mp_originalcode/F4MPClient/common/include/Types.h
create mode 100644 f4mp_originalcode/F4MPClient/common/include/Utilities.h
create mode 100644 f4mp_originalcode/F4MPClient/common/include/detours.h
create mode 100644 f4mp_originalcode/F4MPClient/common/include/main.h
create mode 100644 f4mp_originalcode/F4MPClient/common/src/GamePtr.cpp
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/async.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/async_logger-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/async_logger.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/cfg/argv.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/cfg/env.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/cfg/log_levels.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/common-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/common.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/circular_q.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/console_globals.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/fmt_helper.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/mpmc_blocking_q.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/null_mutex.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/os-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/os.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/periodic_worker-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/periodic_worker.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/registry-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/registry.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/synchronous_factory.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/tcp_client-windows.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/tcp_client.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/thread_pool-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/thread_pool.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/details/windows_include.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bin_to_hex.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/LICENSE.rst
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/chrono.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/color.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/compile.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/core.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/format-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/format.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/locale.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/ostream.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/posix.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/printf.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/bundled/ranges.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/fmt.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fmt/ostr.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/formatter.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/fwd.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/logger-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/logger.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/pattern_formatter-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/pattern_formatter.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/android_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/ansicolor_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/ansicolor_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/base_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/base_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/basic_file_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/basic_file_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/daily_file_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/dist_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/dup_filter_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/msvc_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/null_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/ostream_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/ringbuffer_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/rotating_file_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/rotating_file_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/sink-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/stdout_color_sinks-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/stdout_color_sinks.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/stdout_sinks-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/stdout_sinks.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/syslog_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/systemd_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/tcp_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/win_eventlog_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/wincolor_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/sinks/wincolor_sink.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/spdlog-inl.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/spdlog.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/tweakme.h
create mode 100644 f4mp_originalcode/F4MPClient/include/spdlog/version.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamapplist.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamapps.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamappticket.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamclient.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamcontroller.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamfriends.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamgamecoordinator.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamgameserver.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamgameserverstats.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamhtmlsurface.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamhttp.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteaminventory.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteammasterserverupdater.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteammatchmaking.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteammusic.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteammusicremote.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamnetworking.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamps3overlayrenderer.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamremotestorage.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamscreenshots.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamugc.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamunifiedmessages.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamuser.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamuserstats.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamutils.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/isteamvideo.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/matchmakingtypes.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steam_api.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steam_api.json
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steam_api_flat.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steam_api_interop.cs
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steam_gameserver.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steamclientpublic.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steamencryptedappticket.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steamhttpenums.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steamps3params.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steamtypes.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steam/steamuniverse.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/isteamnetworkingsockets.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/isteamnetworkingutils.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/steamclientpublic.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/steamnetworkingsockets.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/steamnetworkingsockets_flat.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/steamnetworkingtypes.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/steamtypes.h
create mode 100644 f4mp_originalcode/F4MPClient/include/steamnetwork/steamuniverse.h
create mode 100644 f4mp_originalcode/F4MPClient/lib/F4MPReverse.lib
create mode 100644 f4mp_originalcode/F4MPClient/lib/GameNetworkingSockets_s.lib
create mode 100644 f4mp_originalcode/F4MPClient/lib/detours.lib
create mode 100644 f4mp_originalcode/F4MPClient/lib/spdlogd.lib
create mode 100644 f4mp_originalcode/F4MPClient/lib/steam_api64.lib
create mode 100644 f4mp_originalcode/F4MPClient/redist/steam_api64.dll
create mode 100644 f4mp_originalcode/F4MPClient/src/DirectXHook.h
create mode 100644 f4mp_originalcode/F4MPClient/src/Global.h
create mode 100644 f4mp_originalcode/F4MPClient/src/Hooks/DXGI.h
create mode 100644 f4mp_originalcode/F4MPClient/src/Hooks/Direct3D11.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/Hooks/Direct3D11.h
create mode 100644 f4mp_originalcode/F4MPClient/src/Hooks/Direct3DBase.h
create mode 100644 f4mp_originalcode/F4MPClient/src/Hooks/Window.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/Hooks/Window.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imconfig.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_demo.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_draw.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_impl_dx11.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_impl_dx11.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_impl_win32.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_impl_win32.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_internal.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imgui_widgets.cpp
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imstb_rectpack.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imstb_textedit.h
create mode 100644 f4mp_originalcode/F4MPClient/src/imgui/imstb_truetype.h
create mode 100644 f4mp_originalcode/F4MPClient/src/main.cpp
create mode 100644 f4mp_originalcode/F4MPServer/.gitignore
create mode 100644 f4mp_originalcode/F4MPServer/CMakeLists.txt
create mode 100644 f4mp_originalcode/F4MPServer/CMakeSettings.json
create mode 100644 f4mp_originalcode/F4MPServer/LICENSE
create mode 100644 f4mp_originalcode/F4MPServer/README.md
create mode 100644 f4mp_originalcode/F4MPServer/include/minbase/minbase_decls.h
create mode 100644 f4mp_originalcode/F4MPServer/include/minbase/minbase_identify.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/async.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/async_logger-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/async_logger.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/cfg/argv.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/cfg/env.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/cfg/helpers-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/cfg/helpers.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/cfg/log_levels.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/common-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/common.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/backtracer-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/backtracer.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/circular_q.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/console_globals.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/file_helper-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/file_helper.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/fmt_helper.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/log_msg-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/log_msg.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/log_msg_buffer-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/log_msg_buffer.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/mpmc_blocking_q.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/null_mutex.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/os-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/os.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/periodic_worker-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/periodic_worker.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/registry-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/registry.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/synchronous_factory.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/tcp_client-windows.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/tcp_client.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/thread_pool-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/thread_pool.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/details/windows_include.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bin_to_hex.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/LICENSE.rst
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/chrono.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/color.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/compile.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/core.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/format-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/format.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/locale.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/ostream.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/posix.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/printf.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/bundled/ranges.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/fmt.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fmt/ostr.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/formatter.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/fwd.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/logger-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/logger.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/pattern_formatter-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/pattern_formatter.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/android_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/ansicolor_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/ansicolor_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/base_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/base_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/basic_file_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/basic_file_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/daily_file_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/dist_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/dup_filter_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/msvc_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/null_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/ostream_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/ringbuffer_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/rotating_file_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/rotating_file_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/sink-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/stdout_color_sinks-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/stdout_color_sinks.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/stdout_sinks-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/stdout_sinks.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/syslog_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/systemd_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/tcp_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/win_eventlog_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/wincolor_sink-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/sinks/wincolor_sink.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/spdlog-inl.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/spdlog.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/tweakme.h
create mode 100644 f4mp_originalcode/F4MPServer/include/spdlog/version.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/isteamnetworkingsockets.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/isteamnetworkingutils.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/steamclientpublic.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/steamnetworkingsockets.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/steamnetworkingsockets_flat.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/steamnetworkingtypes.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/steamtypes.h
create mode 100644 f4mp_originalcode/F4MPServer/include/steam/steamuniverse.h
create mode 100644 f4mp_originalcode/F4MPServer/lib/GameNetworkingSockets_s.lib
create mode 100644 f4mp_originalcode/F4MPServer/lib/spdlogd.lib
create mode 100644 f4mp_originalcode/F4MPServer/src/Config.hpp
create mode 100644 f4mp_originalcode/F4MPServer/src/Helpers.hpp
create mode 100644 f4mp_originalcode/F4MPServer/src/Logger.cpp
create mode 100644 f4mp_originalcode/F4MPServer/src/Logger.hpp
create mode 100644 f4mp_originalcode/F4MPServer/src/Server.cpp
create mode 100644 f4mp_originalcode/F4MPServer/src/Server.hpp
create mode 100644 f4mp_originalcode/F4MPServer/src/ThirdParty/nlohmann/json.hpp
create mode 100644 f4mp_originalcode/F4MPServer/src/main.cpp
diff --git a/f4mp_originalcode/F4MPClient/.gitignore b/f4mp_originalcode/F4MPClient/.gitignore
new file mode 100644
index 0000000..80d0a1a
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/.gitignore
@@ -0,0 +1,38 @@
+#Cmake
+.vs/
+.vscode/
+out/
+cmake-build-debug/
+cmake-build-release/
+build/
+.idea/
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+
+# Executables
+*.exe
+*.out
+*.app
diff --git a/f4mp_originalcode/F4MPClient/CMakeLists.txt b/f4mp_originalcode/F4MPClient/CMakeLists.txt
new file mode 100644
index 0000000..bf52c5a
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/CMakeLists.txt
@@ -0,0 +1,48 @@
+cmake_minimum_required(VERSION 3.7)
+project(F4MPClient)
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CMakeModules/)
+
+set(EXECUTABLE F4MPClient)
+set(SRC_DIR ./src)
+set(INCLUDE_DIR ./include)
+
+# Setting resource path
+add_definitions(-D_RESOURCES="${CMAKE_CURRENT_SOURCE_DIR}/resources/")
+message(${CMAKE_CURRENT_SOURCE_DIR}/resources)
+
+set(THREADS_PREFER_PTHREAD_FLAD ON)
+find_package(Threads REQUIRED)
+
+include_directories(${EXECUTABLE}
+ ${INCLUDE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+file(GLOB SourceFiles
+ ${SRC_DIR}/*
+ ${SRC_DIR}/Utils/*
+ ${SRC_DIR}/ThirdParty/*
+ ${SRC_DIR}/Hooks/*
+ ${SRC_DIR}/imgui/*
+)
+
+add_subdirectory(Common)
+
+add_library(${EXECUTABLE} SHARED ${SourceFiles})
+
+set_target_properties(${EXECUTABLE} PROPERTIES
+ CXX_STANDARD 17
+ CXX_EXTENSIONS ON
+)
+
+target_link_libraries(${EXECUTABLE}
+ ${CMAKE_DL_LIBS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/steam_api64.lib
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/detours.lib
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/spdlogd.lib
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/GameNetworkingSockets_s.lib
+ Common
+ d3d11.lib
+ dxgi.dll
+)
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/CMakeSettings.json b/f4mp_originalcode/F4MPClient/CMakeSettings.json
new file mode 100644
index 0000000..cdc79fe
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/CMakeSettings.json
@@ -0,0 +1,28 @@
+{
+ "configurations": [
+ {
+ "name": "x64-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "variables": []
+ },
+ {
+ "name": "x64-Release",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "variables": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/LICENSE b/f4mp_originalcode/F4MPClient/LICENSE
new file mode 100644
index 0000000..e72bfdd
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/README.md b/f4mp_originalcode/F4MPClient/README.md
new file mode 100644
index 0000000..68734b0
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/README.md
@@ -0,0 +1 @@
+# client
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/common/CMakeLists.txt b/f4mp_originalcode/F4MPClient/common/CMakeLists.txt
new file mode 100644
index 0000000..c7793ad
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/CMakeLists.txt
@@ -0,0 +1,14 @@
+set(PROJ Common)
+
+set(SRC_DIR ./src)
+set(INCLUDE_DIR ./include)
+
+file(GLOB SOURCE_FILES
+ ${SRC_DIR}/*
+ )
+
+add_library (${PROJ} STATIC ${SOURCE_FILES})
+
+include_directories(${PROJ} ${INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+
+target_include_directories (${PROJ} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/*)
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/common/include/Exceptions.h b/f4mp_originalcode/F4MPClient/common/include/Exceptions.h
new file mode 100644
index 0000000..c181928
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/Exceptions.h
@@ -0,0 +1,126 @@
+#ifndef COMMON_EXCEPTIONS_H
+#define COMMON_EXCEPTIONS_H
+
+#include
+#include
+
+namespace Exceptions {
+
+ namespace Core {
+
+ namespace Exceptions {
+ class RuntimeException : public std::runtime_error
+ {
+ public:
+ explicit RuntimeException(const std::string &msg) :
+ std::runtime_error(msg.c_str())
+ { }
+
+ explicit RuntimeException(const char *msg) :
+ std::runtime_error(msg)
+ { }
+ };
+
+ class DetourException : public RuntimeException
+ {
+ public:
+ explicit DetourException(const std::string &msg) :
+ RuntimeException(msg.c_str())
+ { }
+
+ explicit DetourException(const char *msg) :
+ RuntimeException(msg)
+ { }
+ };
+
+ class GenericWinAPIException : public std::runtime_error
+ {
+ DWORD last_error_;
+
+ public:
+ explicit GenericWinAPIException(const std::string &msg) :
+ std::runtime_error(msg.c_str()), last_error_(GetLastError())
+ { }
+
+ explicit GenericWinAPIException(const char *msg) :
+ std::runtime_error(msg), last_error_(GetLastError())
+ { }
+
+ virtual DWORD get_last_error() const
+ {
+ return last_error_;
+ }
+ };
+
+ class ModuleNotFoundException : public GenericWinAPIException
+ {
+ public:
+ explicit ModuleNotFoundException(const std::string &msg) :
+ GenericWinAPIException(msg)
+ { }
+
+ explicit ModuleNotFoundException(const char *msg) :
+ GenericWinAPIException(msg)
+ { }
+ };
+
+ class ProcAddressNotFoundException : public GenericWinAPIException
+ {
+ public:
+ explicit ProcAddressNotFoundException(const std::string &msg) :
+ GenericWinAPIException(msg)
+ { }
+
+ explicit ProcAddressNotFoundException(const char *msg) :
+ GenericWinAPIException(msg)
+ { }
+ };
+
+ class COMInterfaceException : public RuntimeException
+ {
+ HRESULT hresult_;
+
+ public:
+ explicit COMInterfaceException(const std::string &msg, HRESULT result) :
+ RuntimeException(msg), hresult_(result)
+ { }
+
+ explicit COMInterfaceException(const char *msg, HRESULT result) :
+ RuntimeException(msg), hresult_(result)
+ { }
+
+ HRESULT hresult() const
+ {
+ return hresult_;
+ }
+ };
+
+ class DXAPIException : public COMInterfaceException
+ {
+ public:
+ explicit DXAPIException(const std::string &msg, HRESULT result) :
+ COMInterfaceException(msg, result)
+ { }
+
+ explicit DXAPIException(const char *msg, HRESULT result) :
+ COMInterfaceException(msg, result)
+ { }
+ };
+
+ class ARCException : public COMInterfaceException
+ {
+ public:
+ explicit ARCException(const std::string &msg, HRESULT result) :
+ COMInterfaceException(msg, result)
+ { }
+
+ explicit ARCException(const char *msg, HRESULT result) :
+ COMInterfaceException(msg, result)
+ { }
+ };
+ };
+
+ };
+
+};
+#endif
diff --git a/f4mp_originalcode/F4MPClient/common/include/GamePtr.h b/f4mp_originalcode/F4MPClient/common/include/GamePtr.h
new file mode 100644
index 0000000..b7910af
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/GamePtr.h
@@ -0,0 +1,81 @@
+#ifndef COMMON_GAMEPTR_H
+#define COMMON_GAMEPTR_H
+
+#include
+#include
+#include
+
+namespace Memory {
+
+ class GamePtr_Manager {
+ public:
+ GamePtr_Manager();
+
+ static uintptr_t s_baseAddress;
+ };
+
+ template
+ class GamePtr {
+ public :
+ GamePtr(uintptr_t offset) : offset(offset + Memory::GamePtr_Manager::s_baseAddress){}
+
+ T * GetPtr() const {
+ return reinterpret_cast (offset);
+ }
+
+ T * operator->() const
+ {
+ return GetPtr();
+ }
+
+ operator T *() const
+ {
+ return GetPtr();
+ }
+
+ bool operator!() const {
+ return !GetPtr();
+ }
+
+ const T * GetConstPtr() const {
+ return reinterpret_cast (offset);
+ }
+
+ uintptr_t GetUIntPtr() const
+ {
+ return offset;
+ }
+ private:
+ uintptr_t offset;
+
+ GamePtr();
+ GamePtr(GamePtr & rhs);
+ GamePtr & operator=(GamePtr & rhs);
+ };
+
+ template
+ class GameAddr{
+ public:
+ GameAddr(uintptr_t offset) : offset(reinterpret_cast(offset + Memory::GamePtr_Manager::s_baseAddress)){}
+
+ operator T() {
+ return reinterpret_cast(offset);
+ }
+
+ uintptr_t GetUIntPtr(){
+ return reinterpret_cast(offset);
+ }
+ private:
+ struct ConversionType {};
+
+ ConversionType * offset;
+
+ GameAddr();
+ GameAddr(GameAddr & rhs);
+ GameAddr & operator=(GameAddr & rhs);
+ };
+
+
+}
+
+#endif
diff --git a/f4mp_originalcode/F4MPClient/common/include/Hook.h b/f4mp_originalcode/F4MPClient/common/include/Hook.h
new file mode 100644
index 0000000..6b882cf
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/Hook.h
@@ -0,0 +1,257 @@
+#ifndef COMMON_HOOK_H
+#define COMMON_HOOK_H
+
+#include
+#include
+#include "detours.h"
+#include "Types.h"
+
+#include "Exceptions.h"
+
+namespace Hooks {
+
+ enum class CallConvention
+ {
+ stdcall_t,
+ cdecl_t
+ };
+
+ template
+ struct convention;
+
+ template
+ struct convention
+ {
+ typedef retn (__stdcall *type)(args ...);
+ };
+
+ template
+ struct convention
+ {
+ typedef retn (__cdecl *type)(args ...);
+ };
+
+ template
+ class Hook
+ {
+ typedef typename convention::type type;
+
+ size_t orig_;
+ type detour_;
+
+ bool is_applied_;
+ bool has_open_transaction_;
+
+ void transaction_begin()
+ {
+ const auto result = DetourTransactionBegin();
+
+ if (result != NO_ERROR)
+ {
+ if (result == ERROR_INVALID_OPERATION)
+ {
+ throw Exceptions::Core::Exceptions::DetourException(
+ "A pending transaction already exists"
+ );
+ }
+
+ throw Exceptions::Core::Exceptions::DetourException("Unknown error");
+ }
+
+ has_open_transaction_ = true;
+ }
+
+ void transaction_commit()
+ {
+ const auto result = DetourTransactionCommit();
+
+ if (result != NO_ERROR)
+ {
+ switch (result)
+ {
+ case ERROR_INVALID_DATA:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Target function was changed by third party between steps of the transaction"
+ );
+
+ case ERROR_INVALID_OPERATION:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "No pending transaction exists"
+ );
+
+ case ERROR_INVALID_BLOCK:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "The function referenced is too small to be detoured"
+ );
+
+ case ERROR_INVALID_HANDLE:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "The ppPointer parameter is null or points to a null pointer"
+ );
+
+ case ERROR_NOT_ENOUGH_MEMORY:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Not enough memory exists to complete the operation"
+ );
+
+ default:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Unknown error"
+ );
+ }
+ }
+
+ has_open_transaction_ = false;
+ }
+
+ static void update_thread(HANDLE hThread)
+ {
+ const auto result = DetourUpdateThread(hThread);
+
+ if (result != NO_ERROR)
+ {
+ if (result == ERROR_NOT_ENOUGH_MEMORY)
+ {
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Not enough memory to record identity of thread"
+ );
+ }
+
+ throw Exceptions::Core::Exceptions::DetourException("Unknown error");
+ }
+ }
+
+ public:
+ Hook() : orig_(0), detour_(0), is_applied_(false), has_open_transaction_(false)
+ {
+ }
+
+ ~Hook() noexcept(false)
+ {
+ if (has_open_transaction_)
+ {
+ const auto result = DetourTransactionAbort();
+
+ if (result != NO_ERROR)
+ {
+ if (result == ERROR_INVALID_OPERATION)
+ {
+ throw Exceptions::Core::Exceptions::DetourException(
+ "No pending transaction exists"
+ );
+ }
+ throw Exceptions::Core::Exceptions::DetourException("Unknown error");
+ }
+ }
+
+ remove();
+ }
+
+ template
+ void apply(T pFunc, type detour)
+ {
+ detour_ = detour;
+ orig_ = static_cast(pFunc);
+
+ transaction_begin();
+ update_thread(GetCurrentThread());
+ const auto result = DetourAttach(reinterpret_cast(&orig_), reinterpret_cast(detour_));
+
+ if (result != NO_ERROR)
+ {
+ switch (result)
+ {
+ case ERROR_INVALID_BLOCK:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "The function referenced is too small to be detoured"
+ );
+
+ case ERROR_INVALID_HANDLE:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "The ppPointer parameter is null or points to a null pointer"
+ );
+
+ case ERROR_INVALID_OPERATION:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "No pending transaction exists"
+ );
+
+ case ERROR_NOT_ENOUGH_MEMORY:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Not enough memory exists to complete the operation"
+ );
+
+ default:
+ throw Exceptions::Core::Exceptions::DetourException("Unknown error");
+ }
+ }
+
+ transaction_commit();
+
+ is_applied_ = true;
+ }
+
+ void remove()
+ {
+ if (!is_applied_)
+ return;
+
+ is_applied_ = false;
+
+ transaction_begin();
+ update_thread(GetCurrentThread());
+ const auto result = DetourDetach(reinterpret_cast(&orig_), reinterpret_cast(detour_));
+
+ if (result != NO_ERROR)
+ {
+ switch (result)
+ {
+ case ERROR_INVALID_BLOCK:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "The function to be detached was too small to be detoured"
+ );
+
+ case ERROR_INVALID_HANDLE:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "The ppPointer parameter is null or points to a null pointer"
+ );
+
+ case ERROR_INVALID_OPERATION:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "No pending transaction exists"
+ );
+
+ case ERROR_NOT_ENOUGH_MEMORY:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Not enough memory exists to complete the operation"
+ );
+
+ default:
+ throw Exceptions::Core::Exceptions::DetourException(
+ "Unknown error"
+ );
+ }
+ }
+
+ transaction_commit();
+ }
+
+ auto get_orig(){
+ return orig_;
+ }
+
+ retn call_orig(args ... p)
+ {
+ return type(orig_)(p...);
+ }
+
+
+ bool is_applied() const
+ {
+ return is_applied_;
+ }
+ };
+
+}
+
+#endif
diff --git a/f4mp_originalcode/F4MPClient/common/include/Types.h b/f4mp_originalcode/F4MPClient/common/include/Types.h
new file mode 100644
index 0000000..b2ae2c9
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/Types.h
@@ -0,0 +1,20 @@
+
+#ifndef COMMON_TYPES_H
+#define COMMON_TYPES_H
+
+ namespace Types {
+ typedef unsigned char UInt8; //!< An unsigned 8-bit integer value
+ typedef unsigned short UInt16; //!< An unsigned 16-bit integer value
+ typedef unsigned long UInt32; //!< An unsigned 32-bit integer value
+ typedef unsigned long long UInt64; //!< An unsigned 64-bit integer value
+ typedef signed char SInt8; //!< A signed 8-bit integer value
+ typedef signed short SInt16; //!< A signed 16-bit integer value
+ typedef signed long SInt32; //!< A signed 32-bit integer value
+ typedef signed long long SInt64; //!< A signed 64-bit integer value
+ typedef float Float32; //!< A 32-bit floating point value
+ typedef double Float64; //!< A 64-bit floating point value
+
+ }
+
+
+#endif //F4MPREVERSE_TYPES_H
diff --git a/f4mp_originalcode/F4MPClient/common/include/Utilities.h b/f4mp_originalcode/F4MPClient/common/include/Utilities.h
new file mode 100644
index 0000000..f7902d9
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/Utilities.h
@@ -0,0 +1,215 @@
+#ifndef COMMON_UTILITIES_H
+#define COMMON_UTILITIES_H
+
+#include
+#include
+#include "Types.h"
+#include "GamePtr.h"
+
+namespace Utilities {
+
+ #pragma warning (push)
+ #pragma warning (disable : 4200)
+ struct RTTIType
+ {
+ void * typeInfo;
+ Types::UInt64 data;
+ char name[0];
+ };
+
+ struct RTTILocator
+ {
+ Types::UInt32 sig, offset, cdOffset;
+ Types::UInt32 typeDesc;
+ Types::UInt32 classDesc;
+ };
+ #pragma warning (pop)
+
+ const char * GetObjClassName(void * objBase);
+ void DumpClass(void * theClassPtr, Types::UInt64 nIntsToDump);
+
+ template
+ uintptr_t GetFnAddr(T src)
+ {
+ union
+ {
+ uintptr_t u;
+ T t;
+ } data;
+
+ data.t = src;
+
+ return data.u;
+ }
+
+ class IAT {
+ public:
+ IAT(void * module,const char * DllName,const char * ImportName) : module(module), DllName(DllName), ImportName(ImportName) {
+ base = (Types::UInt8 *)module;
+ dosHeader = (IMAGE_DOS_HEADER *)base;
+ ntHeader = (IMAGE_NT_HEADERS *)(base + dosHeader->e_lfanew);
+ importTable = (IMAGE_IMPORT_DESCRIPTOR *)(base + ntHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
+ };
+
+ void * Get();
+ private:
+ void * module;
+ const char * DllName;
+ const char * ImportName;
+
+ Types::UInt8 * base;
+ IMAGE_DOS_HEADER * dosHeader;
+ IMAGE_NT_HEADERS * ntHeader;
+ IMAGE_IMPORT_DESCRIPTOR * importTable;
+ };
+
+ //+++THANKS TO F4SE TEAM
+#define MEMBER_FN_PREFIX(className) \
+ typedef className _MEMBER_FN_BASE_TYPE
+
+#define DEFINE_MEMBER_FN_LONG(className, functionName, retnType, address, ...) \
+ typedef retnType (className::* _##functionName##_type)(__VA_ARGS__); \
+ \
+ inline _##functionName##_type * _##functionName##_GetPtr(void) \
+ { \
+ static uintptr_t _address; \
+ _address = address + Memory::GamePtr_Manager::s_baseAddress; \
+ return (_##functionName##_type *)&_address; \
+ }
+
+#define DEFINE_MEMBER_FN(functionName, retnType, address, ...) \
+ DEFINE_MEMBER_FN_LONG(_MEMBER_FN_BASE_TYPE, functionName, retnType, address, __VA_ARGS__)
+
+#define DEFINE_STATIC_HEAP(staticAllocate, staticFree) \
+ static void * operator new(std::size_t size) \
+ { \
+ return staticAllocate(size); \
+ } \
+ static void * operator new(std::size_t size, const std::nothrow_t &) \
+ { \
+ return staticAllocate(size); \
+ } \
+ static void * operator new(std::size_t size, void * ptr) \
+ { \
+ return ptr; \
+ } \
+ static void operator delete(void * ptr) \
+ { \
+ staticFree(ptr); \
+ } \
+ static void operator delete(void * ptr, const std::nothrow_t &) \
+ { \
+ staticFree(ptr); \
+ } \
+ static void operator delete(void *, void *) \
+ { \
+ }
+
+#define CALL_MEMBER_FN(obj, fn) \
+ ((*(obj)).*(*((obj)->_##fn##_GetPtr())))
+
+
+// Using the original implementation does very broken things in a Release build
+// For classes like BSGFxShaderFXTarget and GameMenuBase
+#define FORCE_INLINE __forceinline
+#define DEFINE_MEMBER_FN_0(fnName, retnType, addr) \
+ FORCE_INLINE retnType fnName() { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(); \
+ }
+#define DEFINE_MEMBER_FN_1(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1); \
+ }
+#define DEFINE_MEMBER_FN_2(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2); \
+ }
+#define DEFINE_MEMBER_FN_3(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3); \
+ }
+#define DEFINE_MEMBER_FN_4(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4); \
+ }
+#define DEFINE_MEMBER_FN_5(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5); \
+ }
+#define DEFINE_MEMBER_FN_6(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6); \
+ }
+#define DEFINE_MEMBER_FN_7(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7); \
+ }
+#define DEFINE_MEMBER_FN_8(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7, T8 && t8) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7, t8); \
+ }
+#define DEFINE_MEMBER_FN_9(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7, T8 && t8, T9 && t9) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7, t8, t9); \
+ }
+#define DEFINE_MEMBER_FN_10(fnName, retnType, addr, ...) \
+ template \
+ FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7, T8 && t8, T9 && t9, T10 && t10) { \
+ struct empty_struct {}; \
+ typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \
+ const static uintptr_t address = addr + Memory::GamePtr_Manager::s_baseAddress; \
+ _##fnName##_type fn = *(_##fnName##_type*)&address; \
+ return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); \
+ }
+}
+
+#endif
diff --git a/f4mp_originalcode/F4MPClient/common/include/detours.h b/f4mp_originalcode/F4MPClient/common/include/detours.h
new file mode 100644
index 0000000..fe7acf1
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/detours.h
@@ -0,0 +1,1059 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// Core Detours Functionality (detours.h of detours.lib)
+//
+// Microsoft Research Detours Package, Version 4.0.1
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+
+#pragma once
+#ifndef _DETOURS_H_
+#define _DETOURS_H_
+
+#define DETOURS_VERSION 0x4c0c1 // 0xMAJORcMINORcPATCH
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+#undef DETOURS_X64
+#undef DETOURS_X86
+#undef DETOURS_IA64
+#undef DETOURS_ARM
+#undef DETOURS_ARM64
+#undef DETOURS_BITS
+#undef DETOURS_32BIT
+#undef DETOURS_64BIT
+
+#if defined(_X86_)
+#define DETOURS_X86
+#define DETOURS_OPTION_BITS 64
+
+#elif defined(_AMD64_)
+#define DETOURS_X64
+#define DETOURS_OPTION_BITS 32
+
+#elif defined(_IA64_)
+#define DETOURS_IA64
+#define DETOURS_OPTION_BITS 32
+
+#elif defined(_ARM_)
+#define DETOURS_ARM
+
+#elif defined(_ARM64_)
+#define DETOURS_ARM64
+
+#else
+#error Unknown architecture (x86, amd64, ia64, arm, arm64)
+#endif
+
+#ifdef _WIN64
+#undef DETOURS_32BIT
+#define DETOURS_64BIT 1
+#define DETOURS_BITS 64
+// If all 64bit kernels can run one and only one 32bit architecture.
+//#define DETOURS_OPTION_BITS 32
+#else
+#define DETOURS_32BIT 1
+#undef DETOURS_64BIT
+#define DETOURS_BITS 32
+// If all 64bit kernels can run one and only one 32bit architecture.
+//#define DETOURS_OPTION_BITS 32
+#endif
+
+#define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+#if (_MSC_VER < 1299)
+typedef LONG LONG_PTR;
+typedef ULONG ULONG_PTR;
+#endif
+
+///////////////////////////////////////////////// SAL 2.0 Annotations w/o SAL.
+//
+// These definitions are include so that Detours will build even if the
+// compiler doesn't have full SAL 2.0 support.
+//
+#ifndef DETOURS_DONT_REMOVE_SAL_20
+
+#ifdef DETOURS_TEST_REMOVE_SAL_20
+#undef _Analysis_assume_
+#undef _Benign_race_begin_
+#undef _Benign_race_end_
+#undef _Field_range_
+#undef _Field_size_
+#undef _In_
+#undef _In_bytecount_
+#undef _In_count_
+#undef _In_opt_
+#undef _In_opt_bytecount_
+#undef _In_opt_count_
+#undef _In_opt_z_
+#undef _In_range_
+#undef _In_reads_
+#undef _In_reads_bytes_
+#undef _In_reads_opt_
+#undef _In_reads_opt_bytes_
+#undef _In_reads_or_z_
+#undef _In_z_
+#undef _Inout_
+#undef _Inout_opt_
+#undef _Inout_z_count_
+#undef _Out_
+#undef _Out_opt_
+#undef _Out_writes_
+#undef _Outptr_result_maybenull_
+#undef _Readable_bytes_
+#undef _Success_
+#undef _Writable_bytes_
+#undef _Pre_notnull_
+#endif
+
+#if defined(_Deref_out_opt_z_) && !defined(_Outptr_result_maybenull_)
+#define _Outptr_result_maybenull_ _Deref_out_opt_z_
+#endif
+
+#if defined(_In_count_) && !defined(_In_reads_)
+#define _In_reads_(x) _In_count_(x)
+#endif
+
+#if defined(_In_opt_count_) && !defined(_In_reads_opt_)
+#define _In_reads_opt_(x) _In_opt_count_(x)
+#endif
+
+#if defined(_In_opt_bytecount_) && !defined(_In_reads_opt_bytes_)
+#define _In_reads_opt_bytes_(x) _In_opt_bytecount_(x)
+#endif
+
+#if defined(_In_bytecount_) && !defined(_In_reads_bytes_)
+#define _In_reads_bytes_(x) _In_bytecount_(x)
+#endif
+
+#ifndef _In_
+#define _In_
+#endif
+
+#ifndef _In_bytecount_
+#define _In_bytecount_(x)
+#endif
+
+#ifndef _In_count_
+#define _In_count_(x)
+#endif
+
+#ifndef _In_opt_
+#define _In_opt_
+#endif
+
+#ifndef _In_opt_bytecount_
+#define _In_opt_bytecount_(x)
+#endif
+
+#ifndef _In_opt_count_
+#define _In_opt_count_(x)
+#endif
+
+#ifndef _In_opt_z_
+#define _In_opt_z_
+#endif
+
+#ifndef _In_range_
+#define _In_range_(x,y)
+#endif
+
+#ifndef _In_reads_
+#define _In_reads_(x)
+#endif
+
+#ifndef _In_reads_bytes_
+#define _In_reads_bytes_(x)
+#endif
+
+#ifndef _In_reads_opt_
+#define _In_reads_opt_(x)
+#endif
+
+#ifndef _In_reads_opt_bytes_
+#define _In_reads_opt_bytes_(x)
+#endif
+
+#ifndef _In_reads_or_z_
+#define _In_reads_or_z_
+#endif
+
+#ifndef _In_z_
+#define _In_z_
+#endif
+
+#ifndef _Inout_
+#define _Inout_
+#endif
+
+#ifndef _Inout_opt_
+#define _Inout_opt_
+#endif
+
+#ifndef _Inout_z_count_
+#define _Inout_z_count_(x)
+#endif
+
+#ifndef _Out_
+#define _Out_
+#endif
+
+#ifndef _Out_opt_
+#define _Out_opt_
+#endif
+
+#ifndef _Out_writes_
+#define _Out_writes_(x)
+#endif
+
+#ifndef _Outptr_result_maybenull_
+#define _Outptr_result_maybenull_
+#endif
+
+#ifndef _Writable_bytes_
+#define _Writable_bytes_(x)
+#endif
+
+#ifndef _Readable_bytes_
+#define _Readable_bytes_(x)
+#endif
+
+#ifndef _Success_
+#define _Success_(x)
+#endif
+
+#ifndef _Pre_notnull_
+#define _Pre_notnull_
+#endif
+
+#ifdef DETOURS_INTERNAL
+
+#pragma warning(disable:4615) // unknown warning type (suppress with older compilers)
+
+#ifndef _Benign_race_begin_
+#define _Benign_race_begin_
+#endif
+
+#ifndef _Benign_race_end_
+#define _Benign_race_end_
+#endif
+
+#ifndef _Field_size_
+#define _Field_size_(x)
+#endif
+
+#ifndef _Field_range_
+#define _Field_range_(x,y)
+#endif
+
+#ifndef _Analysis_assume_
+#define _Analysis_assume_(x)
+#endif
+
+#endif // DETOURS_INTERNAL
+#endif // DETOURS_DONT_REMOVE_SAL_20
+
+//////////////////////////////////////////////////////////////////////////////
+//
+#ifndef GUID_DEFINED
+#define GUID_DEFINED
+typedef struct _GUID
+{
+ DWORD Data1;
+ WORD Data2;
+ WORD Data3;
+ BYTE Data4[ 8 ];
+} GUID;
+
+#ifdef INITGUID
+#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ const GUID name \
+ = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
+#else
+#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ const GUID name
+#endif // INITGUID
+#endif // !GUID_DEFINED
+
+#if defined(__cplusplus)
+#ifndef _REFGUID_DEFINED
+#define _REFGUID_DEFINED
+#define REFGUID const GUID &
+#endif // !_REFGUID_DEFINED
+#else // !__cplusplus
+#ifndef _REFGUID_DEFINED
+#define _REFGUID_DEFINED
+#define REFGUID const GUID * const
+#endif // !_REFGUID_DEFINED
+#endif // !__cplusplus
+
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
+#endif
+
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+/////////////////////////////////////////////////// Instruction Target Macros.
+//
+#define DETOUR_INSTRUCTION_TARGET_NONE ((PVOID)0)
+#define DETOUR_INSTRUCTION_TARGET_DYNAMIC ((PVOID)(LONG_PTR)-1)
+#define DETOUR_SECTION_HEADER_SIGNATURE 0x00727444 // "Dtr\0"
+
+extern const GUID DETOUR_EXE_RESTORE_GUID;
+extern const GUID DETOUR_EXE_HELPER_GUID;
+
+#define DETOUR_TRAMPOLINE_SIGNATURE 0x21727444 // Dtr!
+typedef struct _DETOUR_TRAMPOLINE DETOUR_TRAMPOLINE, *PDETOUR_TRAMPOLINE;
+
+/////////////////////////////////////////////////////////// Binary Structures.
+//
+#pragma pack(push, 8)
+typedef struct _DETOUR_SECTION_HEADER
+{
+ DWORD cbHeaderSize;
+ DWORD nSignature;
+ DWORD nDataOffset;
+ DWORD cbDataSize;
+
+ DWORD nOriginalImportVirtualAddress;
+ DWORD nOriginalImportSize;
+ DWORD nOriginalBoundImportVirtualAddress;
+ DWORD nOriginalBoundImportSize;
+
+ DWORD nOriginalIatVirtualAddress;
+ DWORD nOriginalIatSize;
+ DWORD nOriginalSizeOfImage;
+ DWORD cbPrePE;
+
+ DWORD nOriginalClrFlags;
+ DWORD reserved1;
+ DWORD reserved2;
+ DWORD reserved3;
+
+ // Followed by cbPrePE bytes of data.
+} DETOUR_SECTION_HEADER, *PDETOUR_SECTION_HEADER;
+
+typedef struct _DETOUR_SECTION_RECORD
+{
+ DWORD cbBytes;
+ DWORD nReserved;
+ GUID guid;
+} DETOUR_SECTION_RECORD, *PDETOUR_SECTION_RECORD;
+
+typedef struct _DETOUR_CLR_HEADER
+{
+ // Header versioning
+ ULONG cb;
+ USHORT MajorRuntimeVersion;
+ USHORT MinorRuntimeVersion;
+
+ // Symbol table and startup information
+ IMAGE_DATA_DIRECTORY MetaData;
+ ULONG Flags;
+
+ // Followed by the rest of the IMAGE_COR20_HEADER
+} DETOUR_CLR_HEADER, *PDETOUR_CLR_HEADER;
+
+typedef struct _DETOUR_EXE_RESTORE
+{
+ DWORD cb;
+ DWORD cbidh;
+ DWORD cbinh;
+ DWORD cbclr;
+
+ PBYTE pidh;
+ PBYTE pinh;
+ PBYTE pclr;
+
+ IMAGE_DOS_HEADER idh;
+ union {
+ IMAGE_NT_HEADERS inh;
+ IMAGE_NT_HEADERS32 inh32;
+ IMAGE_NT_HEADERS64 inh64;
+ BYTE raw[sizeof(IMAGE_NT_HEADERS64) +
+ sizeof(IMAGE_SECTION_HEADER) * 32];
+ };
+ DETOUR_CLR_HEADER clr;
+
+} DETOUR_EXE_RESTORE, *PDETOUR_EXE_RESTORE;
+
+typedef struct _DETOUR_EXE_HELPER
+{
+ DWORD cb;
+ DWORD pid;
+ DWORD nDlls;
+ CHAR rDlls[4];
+} DETOUR_EXE_HELPER, *PDETOUR_EXE_HELPER;
+
+#pragma pack(pop)
+
+#define DETOUR_SECTION_HEADER_DECLARE(cbSectionSize) \
+{ \
+ sizeof(DETOUR_SECTION_HEADER),\
+ DETOUR_SECTION_HEADER_SIGNATURE,\
+ sizeof(DETOUR_SECTION_HEADER),\
+ (cbSectionSize),\
+ \
+ 0,\
+ 0,\
+ 0,\
+ 0,\
+ \
+ 0,\
+ 0,\
+ 0,\
+ 0,\
+}
+
+/////////////////////////////////////////////////////////////// Helper Macros.
+//
+#define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x)
+#define DETOURS_STRINGIFY_(x) #x
+
+///////////////////////////////////////////////////////////// Binary Typedefs.
+//
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_BYWAY_CALLBACK)(
+ _In_opt_ PVOID pContext,
+ _In_opt_ LPCSTR pszFile,
+ _Outptr_result_maybenull_ LPCSTR *ppszOutFile);
+
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_FILE_CALLBACK)(
+ _In_opt_ PVOID pContext,
+ _In_ LPCSTR pszOrigFile,
+ _In_ LPCSTR pszFile,
+ _Outptr_result_maybenull_ LPCSTR *ppszOutFile);
+
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_SYMBOL_CALLBACK)(
+ _In_opt_ PVOID pContext,
+ _In_ ULONG nOrigOrdinal,
+ _In_ ULONG nOrdinal,
+ _Out_ ULONG *pnOutOrdinal,
+ _In_opt_ LPCSTR pszOrigSymbol,
+ _In_opt_ LPCSTR pszSymbol,
+ _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol);
+
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_COMMIT_CALLBACK)(
+ _In_opt_ PVOID pContext);
+
+typedef BOOL (CALLBACK *PF_DETOUR_ENUMERATE_EXPORT_CALLBACK)(_In_opt_ PVOID pContext,
+ _In_ ULONG nOrdinal,
+ _In_opt_ LPCSTR pszName,
+ _In_opt_ PVOID pCode);
+
+typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FILE_CALLBACK)(_In_opt_ PVOID pContext,
+ _In_opt_ HMODULE hModule,
+ _In_opt_ LPCSTR pszFile);
+
+typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FUNC_CALLBACK)(_In_opt_ PVOID pContext,
+ _In_ DWORD nOrdinal,
+ _In_opt_ LPCSTR pszFunc,
+ _In_opt_ PVOID pvFunc);
+
+// Same as PF_DETOUR_IMPORT_FUNC_CALLBACK but extra indirection on last parameter.
+typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FUNC_CALLBACK_EX)(_In_opt_ PVOID pContext,
+ _In_ DWORD nOrdinal,
+ _In_opt_ LPCSTR pszFunc,
+ _In_opt_ PVOID* ppvFunc);
+
+typedef VOID * PDETOUR_BINARY;
+typedef VOID * PDETOUR_LOADED_BINARY;
+
+//////////////////////////////////////////////////////////// Transaction APIs.
+//
+LONG WINAPI DetourTransactionBegin(VOID);
+LONG WINAPI DetourTransactionAbort(VOID);
+LONG WINAPI DetourTransactionCommit(VOID);
+LONG WINAPI DetourTransactionCommitEx(_Out_opt_ PVOID **pppFailedPointer);
+
+LONG WINAPI DetourUpdateThread(_In_ HANDLE hThread);
+
+LONG WINAPI DetourAttach(_Inout_ PVOID *ppPointer,
+ _In_ PVOID pDetour);
+
+LONG WINAPI DetourAttachEx(_Inout_ PVOID *ppPointer,
+ _In_ PVOID pDetour,
+ _Out_opt_ PDETOUR_TRAMPOLINE *ppRealTrampoline,
+ _Out_opt_ PVOID *ppRealTarget,
+ _Out_opt_ PVOID *ppRealDetour);
+
+LONG WINAPI DetourDetach(_Inout_ PVOID *ppPointer,
+ _In_ PVOID pDetour);
+
+BOOL WINAPI DetourSetIgnoreTooSmall(_In_ BOOL fIgnore);
+BOOL WINAPI DetourSetRetainRegions(_In_ BOOL fRetain);
+PVOID WINAPI DetourSetSystemRegionLowerBound(_In_ PVOID pSystemRegionLowerBound);
+PVOID WINAPI DetourSetSystemRegionUpperBound(_In_ PVOID pSystemRegionUpperBound);
+
+////////////////////////////////////////////////////////////// Code Functions.
+//
+PVOID WINAPI DetourFindFunction(_In_ LPCSTR pszModule,
+ _In_ LPCSTR pszFunction);
+PVOID WINAPI DetourCodeFromPointer(_In_ PVOID pPointer,
+ _Out_opt_ PVOID *ppGlobals);
+PVOID WINAPI DetourCopyInstruction(_In_opt_ PVOID pDst,
+ _Inout_opt_ PVOID *ppDstPool,
+ _In_ PVOID pSrc,
+ _Out_opt_ PVOID *ppTarget,
+ _Out_opt_ LONG *plExtra);
+BOOL WINAPI DetourSetCodeModule(_In_ HMODULE hModule,
+ _In_ BOOL fLimitReferencesToModule);
+
+///////////////////////////////////////////////////// Loaded Binary Functions.
+//
+HMODULE WINAPI DetourGetContainingModule(_In_ PVOID pvAddr);
+HMODULE WINAPI DetourEnumerateModules(_In_opt_ HMODULE hModuleLast);
+PVOID WINAPI DetourGetEntryPoint(_In_opt_ HMODULE hModule);
+ULONG WINAPI DetourGetModuleSize(_In_opt_ HMODULE hModule);
+BOOL WINAPI DetourEnumerateExports(_In_ HMODULE hModule,
+ _In_opt_ PVOID pContext,
+ _In_ PF_DETOUR_ENUMERATE_EXPORT_CALLBACK pfExport);
+BOOL WINAPI DetourEnumerateImports(_In_opt_ HMODULE hModule,
+ _In_opt_ PVOID pContext,
+ _In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
+ _In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK pfImportFunc);
+
+BOOL WINAPI DetourEnumerateImportsEx(_In_opt_ HMODULE hModule,
+ _In_opt_ PVOID pContext,
+ _In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
+ _In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK_EX pfImportFuncEx);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourFindPayload(_In_opt_ HMODULE hModule,
+ _In_ REFGUID rguid,
+ _Out_ DWORD *pcbData);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourFindPayloadEx(_In_ REFGUID rguid,
+ _Out_ DWORD * pcbData);
+
+DWORD WINAPI DetourGetSizeOfPayloads(_In_opt_ HMODULE hModule);
+
+///////////////////////////////////////////////// Persistent Binary Functions.
+//
+
+PDETOUR_BINARY WINAPI DetourBinaryOpen(_In_ HANDLE hFile);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourBinaryEnumeratePayloads(_In_ PDETOUR_BINARY pBinary,
+ _Out_opt_ GUID *pGuid,
+ _Out_ DWORD *pcbData,
+ _Inout_ DWORD *pnIterator);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourBinaryFindPayload(_In_ PDETOUR_BINARY pBinary,
+ _In_ REFGUID rguid,
+ _Out_ DWORD *pcbData);
+
+PVOID WINAPI DetourBinarySetPayload(_In_ PDETOUR_BINARY pBinary,
+ _In_ REFGUID rguid,
+ _In_reads_opt_(cbData) PVOID pData,
+ _In_ DWORD cbData);
+BOOL WINAPI DetourBinaryDeletePayload(_In_ PDETOUR_BINARY pBinary, _In_ REFGUID rguid);
+BOOL WINAPI DetourBinaryPurgePayloads(_In_ PDETOUR_BINARY pBinary);
+BOOL WINAPI DetourBinaryResetImports(_In_ PDETOUR_BINARY pBinary);
+BOOL WINAPI DetourBinaryEditImports(_In_ PDETOUR_BINARY pBinary,
+ _In_opt_ PVOID pContext,
+ _In_opt_ PF_DETOUR_BINARY_BYWAY_CALLBACK pfByway,
+ _In_opt_ PF_DETOUR_BINARY_FILE_CALLBACK pfFile,
+ _In_opt_ PF_DETOUR_BINARY_SYMBOL_CALLBACK pfSymbol,
+ _In_opt_ PF_DETOUR_BINARY_COMMIT_CALLBACK pfCommit);
+BOOL WINAPI DetourBinaryWrite(_In_ PDETOUR_BINARY pBinary, _In_ HANDLE hFile);
+BOOL WINAPI DetourBinaryClose(_In_ PDETOUR_BINARY pBinary);
+
+/////////////////////////////////////////////////// Create Process & Load Dll.
+//
+typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEA)(
+ _In_opt_ LPCSTR lpApplicationName,
+ _Inout_opt_ LPSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOA lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation);
+
+typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEW)(
+ _In_opt_ LPCWSTR lpApplicationName,
+ _Inout_opt_ LPWSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCWSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOW lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation);
+
+BOOL WINAPI DetourCreateProcessWithDllA(_In_opt_ LPCSTR lpApplicationName,
+ _Inout_opt_ LPSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOA lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+ _In_ LPCSTR lpDllName,
+ _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourCreateProcessWithDllW(_In_opt_ LPCWSTR lpApplicationName,
+ _Inout_opt_ LPWSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCWSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOW lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+ _In_ LPCSTR lpDllName,
+ _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourCreateProcessWithDll DetourCreateProcessWithDllW
+#define PDETOUR_CREATE_PROCESS_ROUTINE PDETOUR_CREATE_PROCESS_ROUTINEW
+#else
+#define DetourCreateProcessWithDll DetourCreateProcessWithDllA
+#define PDETOUR_CREATE_PROCESS_ROUTINE PDETOUR_CREATE_PROCESS_ROUTINEA
+#endif // !UNICODE
+
+BOOL WINAPI DetourCreateProcessWithDllExA(_In_opt_ LPCSTR lpApplicationName,
+ _Inout_opt_ LPSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOA lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+ _In_ LPCSTR lpDllName,
+ _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourCreateProcessWithDllExW(_In_opt_ LPCWSTR lpApplicationName,
+ _Inout_opt_ LPWSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCWSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOW lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+ _In_ LPCSTR lpDllName,
+ _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourCreateProcessWithDllEx DetourCreateProcessWithDllExW
+#else
+#define DetourCreateProcessWithDllEx DetourCreateProcessWithDllExA
+#endif // !UNICODE
+
+BOOL WINAPI DetourCreateProcessWithDllsA(_In_opt_ LPCSTR lpApplicationName,
+ _Inout_opt_ LPSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOA lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+ _In_ DWORD nDlls,
+ _In_reads_(nDlls) LPCSTR *rlpDlls,
+ _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourCreateProcessWithDllsW(_In_opt_ LPCWSTR lpApplicationName,
+ _Inout_opt_ LPWSTR lpCommandLine,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ _In_ BOOL bInheritHandles,
+ _In_ DWORD dwCreationFlags,
+ _In_opt_ LPVOID lpEnvironment,
+ _In_opt_ LPCWSTR lpCurrentDirectory,
+ _In_ LPSTARTUPINFOW lpStartupInfo,
+ _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+ _In_ DWORD nDlls,
+ _In_reads_(nDlls) LPCSTR *rlpDlls,
+ _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourCreateProcessWithDlls DetourCreateProcessWithDllsW
+#else
+#define DetourCreateProcessWithDlls DetourCreateProcessWithDllsA
+#endif // !UNICODE
+
+BOOL WINAPI DetourProcessViaHelperA(_In_ DWORD dwTargetPid,
+ _In_ LPCSTR lpDllName,
+ _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourProcessViaHelperW(_In_ DWORD dwTargetPid,
+ _In_ LPCSTR lpDllName,
+ _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourProcessViaHelper DetourProcessViaHelperW
+#else
+#define DetourProcessViaHelper DetourProcessViaHelperA
+#endif // !UNICODE
+
+BOOL WINAPI DetourProcessViaHelperDllsA(_In_ DWORD dwTargetPid,
+ _In_ DWORD nDlls,
+ _In_reads_(nDlls) LPCSTR *rlpDlls,
+ _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourProcessViaHelperDllsW(_In_ DWORD dwTargetPid,
+ _In_ DWORD nDlls,
+ _In_reads_(nDlls) LPCSTR *rlpDlls,
+ _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourProcessViaHelperDlls DetourProcessViaHelperDllsW
+#else
+#define DetourProcessViaHelperDlls DetourProcessViaHelperDllsA
+#endif // !UNICODE
+
+BOOL WINAPI DetourUpdateProcessWithDll(_In_ HANDLE hProcess,
+ _In_reads_(nDlls) LPCSTR *rlpDlls,
+ _In_ DWORD nDlls);
+
+BOOL WINAPI DetourUpdateProcessWithDllEx(_In_ HANDLE hProcess,
+ _In_ HMODULE hImage,
+ _In_ BOOL bIs32Bit,
+ _In_reads_(nDlls) LPCSTR *rlpDlls,
+ _In_ DWORD nDlls);
+
+BOOL WINAPI DetourCopyPayloadToProcess(_In_ HANDLE hProcess,
+ _In_ REFGUID rguid,
+ _In_reads_bytes_(cbData) PVOID pvData,
+ _In_ DWORD cbData);
+BOOL WINAPI DetourRestoreAfterWith(VOID);
+BOOL WINAPI DetourRestoreAfterWithEx(_In_reads_bytes_(cbData) PVOID pvData,
+ _In_ DWORD cbData);
+BOOL WINAPI DetourIsHelperProcess(VOID);
+VOID CALLBACK DetourFinishHelperProcess(_In_ HWND,
+ _In_ HINSTANCE,
+ _In_ LPSTR,
+ _In_ INT);
+
+//
+//////////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+//////////////////////////////////////////////// Detours Internal Definitions.
+//
+#ifdef __cplusplus
+#ifdef DETOURS_INTERNAL
+
+#define NOTHROW
+// #define NOTHROW (nothrow)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+#if (_MSC_VER < 1299)
+#include
+typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64;
+typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64;
+typedef IMAGEHLP_SYMBOL SYMBOL_INFO;
+typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO;
+
+static inline
+LONG InterlockedCompareExchange(_Inout_ LONG *ptr, _In_ LONG nval, _In_ LONG oval)
+{
+ return (LONG)::InterlockedCompareExchange((PVOID*)ptr, (PVOID)nval, (PVOID)oval);
+}
+#else
+#pragma warning(push)
+#pragma warning(disable:4091) // empty typedef
+#include
+#pragma warning(pop)
+#endif
+
+#ifdef IMAGEAPI // defined by DBGHELP.H
+typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(_In_ LPAPI_VERSION AppVersion);
+
+typedef BOOL (NTAPI *PF_SymInitialize)(_In_ HANDLE hProcess,
+ _In_opt_ LPCSTR UserSearchPath,
+ _In_ BOOL fInvadeProcess);
+typedef DWORD (NTAPI *PF_SymSetOptions)(_In_ DWORD SymOptions);
+typedef DWORD (NTAPI *PF_SymGetOptions)(VOID);
+typedef DWORD64 (NTAPI *PF_SymLoadModule64)(_In_ HANDLE hProcess,
+ _In_opt_ HANDLE hFile,
+ _In_ LPSTR ImageName,
+ _In_opt_ LPSTR ModuleName,
+ _In_ DWORD64 BaseOfDll,
+ _In_opt_ DWORD SizeOfDll);
+typedef BOOL (NTAPI *PF_SymGetModuleInfo64)(_In_ HANDLE hProcess,
+ _In_ DWORD64 qwAddr,
+ _Out_ PIMAGEHLP_MODULE64 ModuleInfo);
+typedef BOOL (NTAPI *PF_SymFromName)(_In_ HANDLE hProcess,
+ _In_ LPSTR Name,
+ _Out_ PSYMBOL_INFO Symbol);
+
+typedef struct _DETOUR_SYM_INFO
+{
+ HANDLE hProcess;
+ HMODULE hDbgHelp;
+ PF_ImagehlpApiVersionEx pfImagehlpApiVersionEx;
+ PF_SymInitialize pfSymInitialize;
+ PF_SymSetOptions pfSymSetOptions;
+ PF_SymGetOptions pfSymGetOptions;
+ PF_SymLoadModule64 pfSymLoadModule64;
+ PF_SymGetModuleInfo64 pfSymGetModuleInfo64;
+ PF_SymFromName pfSymFromName;
+} DETOUR_SYM_INFO, *PDETOUR_SYM_INFO;
+
+PDETOUR_SYM_INFO DetourLoadImageHlp(VOID);
+
+#endif // IMAGEAPI
+
+#if defined(_INC_STDIO) && !defined(_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS)
+#error detours.h must be included before stdio.h (or at least define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS earlier)
+#endif
+#define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS 1
+
+#ifndef DETOUR_TRACE
+#if DETOUR_DEBUG
+#define DETOUR_TRACE(x) printf x
+#define DETOUR_BREAK() __debugbreak()
+#include
+#include
+#else
+#define DETOUR_TRACE(x)
+#define DETOUR_BREAK()
+#endif
+#endif
+
+#if 1 || defined(DETOURS_IA64)
+
+//
+// IA64 instructions are 41 bits, 3 per bundle, plus 5 bit bundle template => 128 bits per bundle.
+//
+
+#define DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE (3)
+
+#define DETOUR_IA64_TEMPLATE_OFFSET (0)
+#define DETOUR_IA64_TEMPLATE_SIZE (5)
+
+#define DETOUR_IA64_INSTRUCTION_SIZE (41)
+#define DETOUR_IA64_INSTRUCTION0_OFFSET (DETOUR_IA64_TEMPLATE_SIZE)
+#define DETOUR_IA64_INSTRUCTION1_OFFSET (DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTION_SIZE)
+#define DETOUR_IA64_INSTRUCTION2_OFFSET (DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTION_SIZE + DETOUR_IA64_INSTRUCTION_SIZE)
+
+C_ASSERT(DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE * DETOUR_IA64_INSTRUCTION_SIZE == 128);
+
+__declspec(align(16)) struct DETOUR_IA64_BUNDLE
+{
+ public:
+ union
+ {
+ BYTE data[16];
+ UINT64 wide[2];
+ };
+
+ enum {
+ A_UNIT = 1u,
+ I_UNIT = 2u,
+ M_UNIT = 3u,
+ B_UNIT = 4u,
+ F_UNIT = 5u,
+ L_UNIT = 6u,
+ X_UNIT = 7u,
+ };
+ struct DETOUR_IA64_METADATA
+ {
+ ULONG nTemplate : 8; // Instruction template.
+ ULONG nUnit0 : 4; // Unit for slot 0
+ ULONG nUnit1 : 4; // Unit for slot 1
+ ULONG nUnit2 : 4; // Unit for slot 2
+ };
+
+ protected:
+ static const DETOUR_IA64_METADATA s_rceCopyTable[33];
+
+ UINT RelocateBundle(_Inout_ DETOUR_IA64_BUNDLE* pDst, _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra) const;
+
+ bool RelocateInstruction(_Inout_ DETOUR_IA64_BUNDLE* pDst,
+ _In_ BYTE slot,
+ _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra) const;
+
+ // 120 112 104 96 88 80 72 64 56 48 40 32 24 16 8 0
+ // f. e. d. c. b. a. 9. 8. 7. 6. 5. 4. 3. 2. 1. 0.
+
+ // 00
+ // f.e. d.c. b.a. 9.8. 7.6. 5.4. 3.2. 1.0.
+ // 0000 0000 0000 0000 0000 0000 0000 001f : Template [4..0]
+ // 0000 0000 0000 0000 0000 03ff ffff ffe0 : Zero [ 41.. 5]
+ // 0000 0000 0000 0000 0000 3c00 0000 0000 : Zero [ 45.. 42]
+ // 0000 0000 0007 ffff ffff c000 0000 0000 : One [ 82.. 46]
+ // 0000 0000 0078 0000 0000 0000 0000 0000 : One [ 86.. 83]
+ // 0fff ffff ff80 0000 0000 0000 0000 0000 : Two [123.. 87]
+ // f000 0000 0000 0000 0000 0000 0000 0000 : Two [127..124]
+ BYTE GetTemplate() const;
+ // Get 4 bit opcodes.
+ BYTE GetInst0() const;
+ BYTE GetInst1() const;
+ BYTE GetInst2() const;
+ BYTE GetUnit(BYTE slot) const;
+ BYTE GetUnit0() const;
+ BYTE GetUnit1() const;
+ BYTE GetUnit2() const;
+ // Get 37 bit data.
+ UINT64 GetData0() const;
+ UINT64 GetData1() const;
+ UINT64 GetData2() const;
+
+ // Get/set the full 41 bit instructions.
+ UINT64 GetInstruction(BYTE slot) const;
+ UINT64 GetInstruction0() const;
+ UINT64 GetInstruction1() const;
+ UINT64 GetInstruction2() const;
+ void SetInstruction(BYTE slot, UINT64 instruction);
+ void SetInstruction0(UINT64 instruction);
+ void SetInstruction1(UINT64 instruction);
+ void SetInstruction2(UINT64 instruction);
+
+ // Get/set bitfields.
+ static UINT64 GetBits(UINT64 Value, UINT64 Offset, UINT64 Count);
+ static UINT64 SetBits(UINT64 Value, UINT64 Offset, UINT64 Count, UINT64 Field);
+
+ // Get specific read-only fields.
+ static UINT64 GetOpcode(UINT64 instruction); // 4bit opcode
+ static UINT64 GetX(UINT64 instruction); // 1bit opcode extension
+ static UINT64 GetX3(UINT64 instruction); // 3bit opcode extension
+ static UINT64 GetX6(UINT64 instruction); // 6bit opcode extension
+
+ // Get/set specific fields.
+ static UINT64 GetImm7a(UINT64 instruction);
+ static UINT64 SetImm7a(UINT64 instruction, UINT64 imm7a);
+ static UINT64 GetImm13c(UINT64 instruction);
+ static UINT64 SetImm13c(UINT64 instruction, UINT64 imm13c);
+ static UINT64 GetSignBit(UINT64 instruction);
+ static UINT64 SetSignBit(UINT64 instruction, UINT64 signBit);
+ static UINT64 GetImm20a(UINT64 instruction);
+ static UINT64 SetImm20a(UINT64 instruction, UINT64 imm20a);
+ static UINT64 GetImm20b(UINT64 instruction);
+ static UINT64 SetImm20b(UINT64 instruction, UINT64 imm20b);
+
+ static UINT64 SignExtend(UINT64 Value, UINT64 Offset);
+
+ BOOL IsMovlGp() const;
+
+ VOID SetInst(BYTE Slot, BYTE nInst);
+ VOID SetInst0(BYTE nInst);
+ VOID SetInst1(BYTE nInst);
+ VOID SetInst2(BYTE nInst);
+ VOID SetData(BYTE Slot, UINT64 nData);
+ VOID SetData0(UINT64 nData);
+ VOID SetData1(UINT64 nData);
+ VOID SetData2(UINT64 nData);
+ BOOL SetNop(BYTE Slot);
+ BOOL SetNop0();
+ BOOL SetNop1();
+ BOOL SetNop2();
+
+ public:
+ BOOL IsBrl() const;
+ VOID SetBrl();
+ VOID SetBrl(UINT64 target);
+ UINT64 GetBrlTarget() const;
+ VOID SetBrlTarget(UINT64 target);
+ VOID SetBrlImm(UINT64 imm);
+ UINT64 GetBrlImm() const;
+
+ UINT64 GetMovlGp() const;
+ VOID SetMovlGp(UINT64 gp);
+
+ VOID SetStop();
+
+ UINT Copy(_Out_ DETOUR_IA64_BUNDLE *pDst, _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra = NULL) const;
+};
+#endif // DETOURS_IA64
+
+#ifdef DETOURS_ARM
+
+#define DETOURS_PFUNC_TO_PBYTE(p) ((PBYTE)(((ULONG_PTR)(p)) & ~(ULONG_PTR)1))
+#define DETOURS_PBYTE_TO_PFUNC(p) ((PBYTE)(((ULONG_PTR)(p)) | (ULONG_PTR)1))
+
+#endif // DETOURS_ARM
+
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#define DETOUR_OFFLINE_LIBRARY(x) \
+PVOID WINAPI DetourCopyInstruction##x(_In_opt_ PVOID pDst, \
+ _Inout_opt_ PVOID *ppDstPool, \
+ _In_ PVOID pSrc, \
+ _Out_opt_ PVOID *ppTarget, \
+ _Out_opt_ LONG *plExtra); \
+ \
+BOOL WINAPI DetourSetCodeModule##x(_In_ HMODULE hModule, \
+ _In_ BOOL fLimitReferencesToModule); \
+
+DETOUR_OFFLINE_LIBRARY(X86)
+DETOUR_OFFLINE_LIBRARY(X64)
+DETOUR_OFFLINE_LIBRARY(ARM)
+DETOUR_OFFLINE_LIBRARY(ARM64)
+DETOUR_OFFLINE_LIBRARY(IA64)
+
+#undef DETOUR_OFFLINE_LIBRARY
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Helpers for manipulating page protection.
+//
+
+_Success_(return != FALSE)
+BOOL WINAPI DetourVirtualProtectSameExecuteEx(_In_ HANDLE hProcess,
+ _In_ PVOID pAddress,
+ _In_ SIZE_T nSize,
+ _In_ DWORD dwNewProtect,
+ _Out_ PDWORD pdwOldProtect);
+
+_Success_(return != FALSE)
+BOOL WINAPI DetourVirtualProtectSameExecute(_In_ PVOID pAddress,
+ _In_ SIZE_T nSize,
+ _In_ DWORD dwNewProtect,
+ _Out_ PDWORD pdwOldProtect);
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+//////////////////////////////////////////////////////////////////////////////
+
+#define MM_ALLOCATION_GRANULARITY 0x10000
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // DETOURS_INTERNAL
+#endif // __cplusplus
+
+#endif // _DETOURS_H_
+//
+//////////////////////////////////////////////////////////////// End of File.
diff --git a/f4mp_originalcode/F4MPClient/common/include/main.h b/f4mp_originalcode/F4MPClient/common/include/main.h
new file mode 100644
index 0000000..7b9637e
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/include/main.h
@@ -0,0 +1 @@
+#pragma once
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/common/src/GamePtr.cpp b/f4mp_originalcode/F4MPClient/common/src/GamePtr.cpp
new file mode 100644
index 0000000..46bc9a3
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/common/src/GamePtr.cpp
@@ -0,0 +1,12 @@
+#include
+
+#pragma warning(disable: 4073)
+#pragma init_seg(lib)
+
+static Memory::GamePtr_Manager sRelocMgr;
+
+uintptr_t Memory::GamePtr_Manager::s_baseAddress = 0;
+
+Memory::GamePtr_Manager::GamePtr_Manager(){
+ Memory::GamePtr_Manager::s_baseAddress = reinterpret_cast(GetModuleHandle(NULL));
+}
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/async.h b/f4mp_originalcode/F4MPClient/include/spdlog/async.h
new file mode 100644
index 0000000..afaf263
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/async.h
@@ -0,0 +1,93 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+//
+// Async logging using global thread pool
+// All loggers created here share same global thread pool.
+// Each log message is pushed to a queue along with a shared pointer to the
+// logger.
+// If a logger deleted while having pending messages in the queue, it's actual
+// destruction will defer
+// until all its messages are processed by the thread pool.
+// This is because each message in the queue holds a shared_ptr to the
+// originating logger.
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+namespace spdlog {
+
+namespace details {
+static const size_t default_async_q_size = 8192;
+}
+
+// async logger factory - creates async loggers backed with thread pool.
+// if a global thread pool doesn't already exist, create it with default queue
+// size of 8192 items and single thread.
+template
+struct async_factory_impl
+{
+ template
+ static std::shared_ptr create(std::string logger_name, SinkArgs &&... args)
+ {
+ auto ®istry_inst = details::registry::instance();
+
+ // create global thread pool if not already exists..
+
+ auto &mutex = registry_inst.tp_mutex();
+ std::lock_guard tp_lock(mutex);
+ auto tp = registry_inst.get_tp();
+ if (tp == nullptr)
+ {
+ tp = std::make_shared(details::default_async_q_size, 1);
+ registry_inst.set_tp(tp);
+ }
+
+ auto sink = std::make_shared(std::forward(args)...);
+ auto new_logger = std::make_shared(std::move(logger_name), std::move(sink), std::move(tp), OverflowPolicy);
+ registry_inst.initialize_logger(new_logger);
+ return new_logger;
+ }
+};
+
+using async_factory = async_factory_impl;
+using async_factory_nonblock = async_factory_impl;
+
+template
+inline std::shared_ptr create_async(std::string logger_name, SinkArgs &&... sink_args)
+{
+ return async_factory::create(std::move(logger_name), std::forward(sink_args)...);
+}
+
+template
+inline std::shared_ptr create_async_nb(std::string logger_name, SinkArgs &&... sink_args)
+{
+ return async_factory_nonblock::create(std::move(logger_name), std::forward(sink_args)...);
+}
+
+// set global thread pool.
+inline void init_thread_pool(size_t q_size, size_t thread_count, std::function on_thread_start)
+{
+ auto tp = std::make_shared(q_size, thread_count, on_thread_start);
+ details::registry::instance().set_tp(std::move(tp));
+}
+
+// set global thread pool.
+inline void init_thread_pool(size_t q_size, size_t thread_count)
+{
+ init_thread_pool(q_size, thread_count, [] {});
+}
+
+// get the global thread pool.
+inline std::shared_ptr thread_pool()
+{
+ return details::registry::instance().get_tp();
+}
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/async_logger-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/async_logger-inl.h
new file mode 100644
index 0000000..f8c9694
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/async_logger-inl.h
@@ -0,0 +1,92 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+#include
+#include
+
+#include
+#include
+
+SPDLOG_INLINE spdlog::async_logger::async_logger(
+ std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp, async_overflow_policy overflow_policy)
+ : async_logger(std::move(logger_name), sinks_list.begin(), sinks_list.end(), std::move(tp), overflow_policy)
+{}
+
+SPDLOG_INLINE spdlog::async_logger::async_logger(
+ std::string logger_name, sink_ptr single_sink, std::weak_ptr tp, async_overflow_policy overflow_policy)
+ : async_logger(std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy)
+{}
+
+// send the log message to the thread pool
+SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg)
+{
+ if (auto pool_ptr = thread_pool_.lock())
+ {
+ pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
+ }
+ else
+ {
+ throw_spdlog_ex("async log: thread pool doesn't exist anymore");
+ }
+}
+
+// send flush request to the thread pool
+SPDLOG_INLINE void spdlog::async_logger::flush_()
+{
+ if (auto pool_ptr = thread_pool_.lock())
+ {
+ pool_ptr->post_flush(shared_from_this(), overflow_policy_);
+ }
+ else
+ {
+ throw_spdlog_ex("async flush: thread pool doesn't exist anymore");
+ }
+}
+
+//
+// backend functions - called from the thread pool to do the actual job
+//
+SPDLOG_INLINE void spdlog::async_logger::backend_sink_it_(const details::log_msg &msg)
+{
+ for (auto &sink : sinks_)
+ {
+ if (sink->should_log(msg.level))
+ {
+ SPDLOG_TRY
+ {
+ sink->log(msg);
+ }
+ SPDLOG_LOGGER_CATCH()
+ }
+ }
+
+ if (should_flush_(msg))
+ {
+ backend_flush_();
+ }
+}
+
+SPDLOG_INLINE void spdlog::async_logger::backend_flush_()
+{
+ for (auto &sink : sinks_)
+ {
+ SPDLOG_TRY
+ {
+ sink->flush();
+ }
+ SPDLOG_LOGGER_CATCH()
+ }
+}
+
+SPDLOG_INLINE std::shared_ptr spdlog::async_logger::clone(std::string new_name)
+{
+ auto cloned = std::make_shared(*this);
+ cloned->name_ = std::move(new_name);
+ return cloned;
+}
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/async_logger.h b/f4mp_originalcode/F4MPClient/include/spdlog/async_logger.h
new file mode 100644
index 0000000..6f29967
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/async_logger.h
@@ -0,0 +1,68 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+// Fast asynchronous logger.
+// Uses pre allocated queue.
+// Creates a single back thread to pop messages from the queue and log them.
+//
+// Upon each log write the logger:
+// 1. Checks if its log level is enough to log the message
+// 2. Push a new copy of the message to a queue (or block the caller until
+// space is available in the queue)
+// Upon destruction, logs all remaining messages in the queue before
+// destructing..
+
+#include
+
+namespace spdlog {
+
+// Async overflow policy - block by default.
+enum class async_overflow_policy
+{
+ block, // Block until message can be enqueued
+ overrun_oldest // Discard oldest message in the queue if full when trying to
+ // add new item.
+};
+
+namespace details {
+class thread_pool;
+}
+
+class SPDLOG_API async_logger final : public std::enable_shared_from_this, public logger
+{
+ friend class details::thread_pool;
+
+public:
+ template
+ async_logger(std::string logger_name, It begin, It end, std::weak_ptr tp,
+ async_overflow_policy overflow_policy = async_overflow_policy::block)
+ : logger(std::move(logger_name), begin, end)
+ , thread_pool_(std::move(tp))
+ , overflow_policy_(overflow_policy)
+ {}
+
+ async_logger(std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp,
+ async_overflow_policy overflow_policy = async_overflow_policy::block);
+
+ async_logger(std::string logger_name, sink_ptr single_sink, std::weak_ptr tp,
+ async_overflow_policy overflow_policy = async_overflow_policy::block);
+
+ std::shared_ptr clone(std::string new_name) override;
+
+protected:
+ void sink_it_(const details::log_msg &msg) override;
+ void flush_() override;
+ void backend_sink_it_(const details::log_msg &incoming_log_msg);
+ void backend_flush_();
+
+private:
+ std::weak_ptr thread_pool_;
+ async_overflow_policy overflow_policy_;
+};
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "async_logger-inl.h"
+#endif
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/cfg/argv.h b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/argv.h
new file mode 100644
index 0000000..82bc183
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/argv.h
@@ -0,0 +1,45 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+#include
+#include
+
+//
+// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="
+//
+// set all loggers to debug level:
+// example.exe "SPDLOG_LEVEL=debug"
+
+// set logger1 to trace level
+// example.exe "SPDLOG_LEVEL=logger1=trace"
+
+// turn off all logging except for logger1 and logger2:
+// example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info"
+
+namespace spdlog {
+namespace cfg {
+
+// search for SPDLOG_LEVEL= in the args and use it to init the levels
+void load_argv_levels(int argc, const char **argv)
+{
+ const std::string spdlog_level_prefix = "SPDLOG_LEVEL=";
+ for (int i = 1; i < argc; i++)
+ {
+ std::string arg = argv[i];
+ if (arg.find(spdlog_level_prefix) == 0)
+ {
+ auto levels_string = arg.substr(spdlog_level_prefix.size());
+ auto levels = helpers::extract_levels(levels_string);
+ details::registry::instance().update_levels(std::move(levels));
+ }
+ }
+}
+
+void load_argv_levels(int argc, char **argv)
+{
+ load_argv_levels(argc, const_cast(argv));
+}
+
+} // namespace cfg
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/cfg/env.h b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/env.h
new file mode 100644
index 0000000..115b676
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/env.h
@@ -0,0 +1,36 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+#include
+#include
+#include
+
+//
+// Init levels and patterns from env variables SPDLOG_LEVEL
+// Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger).
+// Note - fallback to "info" level on unrecognized levels
+//
+// Examples:
+//
+// set global level to debug:
+// export SPDLOG_LEVEL=debug
+//
+// turn off all logging except for logger1:
+// export SPDLOG_LEVEL="off,logger1=debug"
+//
+
+// turn off all logging except for logger1 and logger2:
+// export SPDLOG_LEVEL="off,logger1=debug,logger2=info"
+
+namespace spdlog {
+namespace cfg {
+void load_env_levels()
+{
+ auto env_val = details::os::getenv("SPDLOG_LEVEL");
+ auto levels = helpers::extract_levels(env_val);
+ details::registry::instance().update_levels(std::move(levels));
+}
+
+} // namespace cfg
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers-inl.h
new file mode 100644
index 0000000..b091507
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers-inl.h
@@ -0,0 +1,103 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+namespace spdlog {
+namespace cfg {
+namespace helpers {
+
+// inplace convert to lowercase
+inline std::string &to_lower_(std::string &str)
+{
+ std::transform(
+ str.begin(), str.end(), str.begin(), [](char ch) { return static_cast((ch >= 'A' && ch <= 'Z') ? ch + ('a' - 'A') : ch); });
+ return str;
+}
+
+// inplace trim spaces
+inline std::string &trim_(std::string &str)
+{
+ const char *spaces = " \n\r\t";
+ str.erase(str.find_last_not_of(spaces) + 1);
+ str.erase(0, str.find_first_not_of(spaces));
+ return str;
+}
+
+// return (name,value) trimmed pair from given "name=value" string.
+// return empty string on missing parts
+// "key=val" => ("key", "val")
+// " key = val " => ("key", "val")
+// "key=" => ("key", "")
+// "val" => ("", "val")
+
+inline std::pair extract_kv_(char sep, const std::string &str)
+{
+ auto n = str.find(sep);
+ std::string k, v;
+ if (n == std::string::npos)
+ {
+ v = str;
+ }
+ else
+ {
+ k = str.substr(0, n);
+ v = str.substr(n + 1);
+ }
+ return std::make_pair(trim_(k), trim_(v));
+}
+
+// return vector of key/value pairs from sequence of "K1=V1,K2=V2,.."
+// "a=AAA,b=BBB,c=CCC,.." => {("a","AAA"),("b","BBB"),("c", "CCC"),...}
+inline std::unordered_map extract_key_vals_(const std::string &str)
+{
+ std::string token;
+ std::istringstream token_stream(str);
+ std::unordered_map rv{};
+ while (std::getline(token_stream, token, ','))
+ {
+ if (token.empty())
+ {
+ continue;
+ }
+ auto kv = extract_kv_('=', token);
+ rv[kv.first] = kv.second;
+ }
+ return rv;
+}
+
+SPDLOG_INLINE log_levels extract_levels(const std::string &input)
+{
+ auto key_vals = extract_key_vals_(input);
+ log_levels rv;
+
+ for (auto &name_level : key_vals)
+ {
+ auto &logger_name = name_level.first;
+ auto level_name = to_lower_(name_level.second);
+ auto level = level::from_str(level_name);
+ // fallback to "info" if unrecognized level name
+ if (level == level::off && level_name != "off")
+ {
+ level = level::info;
+ }
+ rv.set(logger_name, level);
+ }
+ return rv;
+}
+
+} // namespace helpers
+} // namespace cfg
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers.h b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers.h
new file mode 100644
index 0000000..8d75082
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/helpers.h
@@ -0,0 +1,28 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+
+namespace spdlog {
+namespace cfg {
+namespace helpers {
+//
+// Init levels from given string
+//
+// Examples:
+//
+// set global level to debug: "debug"
+// turn off all logging except for logger1: "off,logger1=debug"
+// turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info"
+//
+SPDLOG_API log_levels extract_levels(const std::string &txt);
+} // namespace helpers
+
+} // namespace cfg
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "helpers-inl.h"
+#endif // SPDLOG_HEADER_ONLY
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/cfg/log_levels.h b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/log_levels.h
new file mode 100644
index 0000000..ba3b2f7
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/cfg/log_levels.h
@@ -0,0 +1,47 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+#include
+
+namespace spdlog {
+namespace cfg {
+class log_levels
+{
+ std::unordered_map levels_;
+ spdlog::level::level_enum default_level_ = level::info;
+
+public:
+ void set(const std::string &logger_name, level::level_enum lvl)
+ {
+ if (logger_name.empty())
+ {
+ default_level_ = lvl;
+ }
+ else
+ {
+ levels_[logger_name] = lvl;
+ }
+ }
+
+ void set_default(level::level_enum lvl)
+ {
+ default_level_ = lvl;
+ }
+
+ level::level_enum get(const std::string &logger_name)
+ {
+ auto it = levels_.find(logger_name);
+ return it != levels_.end() ? it->second : default_level_;
+ }
+
+ level::level_enum default_level()
+ {
+ return default_level_;
+ }
+};
+} // namespace cfg
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/common-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/common-inl.h
new file mode 100644
index 0000000..be0d8f8
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/common-inl.h
@@ -0,0 +1,76 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+namespace spdlog {
+namespace level {
+static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
+
+static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES;
+
+SPDLOG_INLINE string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
+{
+ return level_string_views[l];
+}
+
+SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
+{
+ return short_level_names[l];
+}
+
+SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT
+{
+ int level = 0;
+ for (const auto &level_str : level_string_views)
+ {
+ if (level_str == name)
+ {
+ return static_cast(level);
+ }
+ level++;
+ }
+ // check also for "warn" and "err" before giving up..
+ if (name == "warn")
+ {
+ return level::warn;
+ }
+ if (name == "err")
+ {
+ return level::err;
+ }
+ return level::off;
+}
+} // namespace level
+
+SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg)
+ : msg_(std::move(msg))
+{}
+
+SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno)
+{
+ memory_buf_t outbuf;
+ fmt::format_system_error(outbuf, last_errno, msg);
+ msg_ = fmt::to_string(outbuf);
+}
+
+SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT
+{
+ return msg_.c_str();
+}
+
+SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno)
+{
+ SPDLOG_THROW(spdlog_ex(msg, last_errno));
+}
+
+SPDLOG_INLINE void throw_spdlog_ex(std::string msg)
+{
+ SPDLOG_THROW(spdlog_ex(std::move(msg)));
+}
+
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/common.h b/f4mp_originalcode/F4MPClient/include/spdlog/common.h
new file mode 100644
index 0000000..923e906
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/common.h
@@ -0,0 +1,246 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef SPDLOG_COMPILED_LIB
+#undef SPDLOG_HEADER_ONLY
+#if defined(_WIN32) && defined(SPDLOG_SHARED_LIB)
+#ifdef spdlog_EXPORTS
+#define SPDLOG_API __declspec(dllexport)
+#else
+#define SPDLOG_API __declspec(dllimport)
+#endif
+#else // !defined(_WIN32) || !defined(SPDLOG_SHARED_LIB)
+#define SPDLOG_API
+#endif
+#define SPDLOG_INLINE
+#else // !defined(SPDLOG_COMPILED_LIB)
+#define SPDLOG_API
+#define SPDLOG_HEADER_ONLY
+#define SPDLOG_INLINE inline
+#endif // #ifdef SPDLOG_COMPILED_LIB
+
+#include
+
+// visual studio upto 2013 does not support noexcept nor constexpr
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+#define SPDLOG_NOEXCEPT _NOEXCEPT
+#define SPDLOG_CONSTEXPR
+#else
+#define SPDLOG_NOEXCEPT noexcept
+#define SPDLOG_CONSTEXPR constexpr
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define SPDLOG_DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define SPDLOG_DEPRECATED __declspec(deprecated)
+#else
+#define SPDLOG_DEPRECATED
+#endif
+
+// disable thread local on msvc 2013
+#ifndef SPDLOG_NO_TLS
+#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__cplusplus_winrt)
+#define SPDLOG_NO_TLS 1
+#endif
+#endif
+
+#ifndef SPDLOG_FUNCTION
+#define SPDLOG_FUNCTION static_cast(__FUNCTION__)
+#endif
+
+#ifdef SPDLOG_NO_EXCEPTIONS
+#define SPDLOG_TRY
+#define SPDLOG_THROW(ex) \
+ do \
+ { \
+ printf("spdlog fatal error: %s\n", ex.what()); \
+ std::abort(); \
+ } while (0)
+#define SPDLOG_CATCH_ALL()
+#else
+#define SPDLOG_TRY try
+#define SPDLOG_THROW(ex) throw(ex)
+#define SPDLOG_CATCH_ALL() catch (...)
+#endif
+
+namespace spdlog {
+
+class formatter;
+
+namespace sinks {
+class sink;
+}
+
+#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
+using filename_t = std::wstring;
+#define SPDLOG_FILENAME_T(s) L##s
+#else
+using filename_t = std::string;
+#define SPDLOG_FILENAME_T(s) s
+#endif
+
+using log_clock = std::chrono::system_clock;
+using sink_ptr = std::shared_ptr;
+using sinks_init_list = std::initializer_list;
+using err_handler = std::function;
+using string_view_t = fmt::basic_string_view;
+using wstring_view_t = fmt::basic_string_view;
+using memory_buf_t = fmt::basic_memory_buffer;
+
+#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
+#ifndef _WIN32
+#error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows
+#else
+template
+struct is_convertible_to_wstring_view : std::is_convertible
+{};
+#endif // _WIN32
+#else
+template
+struct is_convertible_to_wstring_view : std::false_type
+{};
+#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
+
+#if defined(SPDLOG_NO_ATOMIC_LEVELS)
+using level_t = details::null_atomic_int;
+#else
+using level_t = std::atomic;
+#endif
+
+#define SPDLOG_LEVEL_TRACE 0
+#define SPDLOG_LEVEL_DEBUG 1
+#define SPDLOG_LEVEL_INFO 2
+#define SPDLOG_LEVEL_WARN 3
+#define SPDLOG_LEVEL_ERROR 4
+#define SPDLOG_LEVEL_CRITICAL 5
+#define SPDLOG_LEVEL_OFF 6
+
+#if !defined(SPDLOG_ACTIVE_LEVEL)
+#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO
+#endif
+
+// Log level enum
+namespace level {
+enum level_enum
+{
+ trace = SPDLOG_LEVEL_TRACE,
+ debug = SPDLOG_LEVEL_DEBUG,
+ info = SPDLOG_LEVEL_INFO,
+ warn = SPDLOG_LEVEL_WARN,
+ err = SPDLOG_LEVEL_ERROR,
+ critical = SPDLOG_LEVEL_CRITICAL,
+ off = SPDLOG_LEVEL_OFF,
+ n_levels
+};
+
+#if !defined(SPDLOG_LEVEL_NAMES)
+#define SPDLOG_LEVEL_NAMES \
+ { \
+ "trace", "debug", "info", "warning", "error", "critical", "off" \
+ }
+#endif
+
+#if !defined(SPDLOG_SHORT_LEVEL_NAMES)
+
+#define SPDLOG_SHORT_LEVEL_NAMES \
+ { \
+ "T", "D", "I", "W", "E", "C", "O" \
+ }
+#endif
+
+SPDLOG_API string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT;
+SPDLOG_API const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT;
+SPDLOG_API spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT;
+
+using level_hasher = std::hash;
+} // namespace level
+
+//
+// Color mode used by sinks with color support.
+//
+enum class color_mode
+{
+ always,
+ automatic,
+ never
+};
+
+//
+// Pattern time - specific time getting to use for pattern_formatter.
+// local time by default
+//
+enum class pattern_time_type
+{
+ local, // log localtime
+ utc // log utc
+};
+
+//
+// Log exception
+//
+class SPDLOG_API spdlog_ex : public std::exception
+{
+public:
+ explicit spdlog_ex(std::string msg);
+ spdlog_ex(const std::string &msg, int last_errno);
+ const char *what() const SPDLOG_NOEXCEPT override;
+
+private:
+ std::string msg_;
+};
+
+SPDLOG_API void throw_spdlog_ex(const std::string &msg, int last_errno);
+SPDLOG_API void throw_spdlog_ex(std::string msg);
+
+struct source_loc
+{
+ SPDLOG_CONSTEXPR source_loc() = default;
+ SPDLOG_CONSTEXPR source_loc(const char *filename_in, int line_in, const char *funcname_in)
+ : filename{filename_in}
+ , line{line_in}
+ , funcname{funcname_in}
+ {}
+
+ SPDLOG_CONSTEXPR bool empty() const SPDLOG_NOEXCEPT
+ {
+ return line == 0;
+ }
+ const char *filename{nullptr};
+ int line{0};
+ const char *funcname{nullptr};
+};
+
+namespace details {
+// make_unique support for pre c++14
+
+#if __cplusplus >= 201402L // C++14 and beyond
+using std::make_unique;
+#else
+template
+std::unique_ptr make_unique(Args &&... args)
+{
+ static_assert(!std::is_array::value, "arrays not supported");
+ return std::unique_ptr(new T(std::forward(args)...));
+}
+#endif
+} // namespace details
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "common-inl.h"
+#endif
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer-inl.h
new file mode 100644
index 0000000..21553c2
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer-inl.h
@@ -0,0 +1,69 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+namespace spdlog {
+namespace details {
+SPDLOG_INLINE backtracer::backtracer(const backtracer &other)
+{
+ std::lock_guard lock(other.mutex_);
+ enabled_ = other.enabled();
+ messages_ = other.messages_;
+}
+
+SPDLOG_INLINE backtracer::backtracer(backtracer &&other) SPDLOG_NOEXCEPT
+{
+ std::lock_guard lock(other.mutex_);
+ enabled_ = other.enabled();
+ messages_ = std::move(other.messages_);
+}
+
+SPDLOG_INLINE backtracer &backtracer::operator=(backtracer other)
+{
+ std::lock_guard lock(mutex_);
+ enabled_ = other.enabled();
+ messages_ = std::move(other.messages_);
+ return *this;
+}
+
+SPDLOG_INLINE void backtracer::enable(size_t size)
+{
+ std::lock_guard lock{mutex_};
+ enabled_.store(true, std::memory_order_relaxed);
+ messages_ = circular_q{size};
+}
+
+SPDLOG_INLINE void backtracer::disable()
+{
+ std::lock_guard lock{mutex_};
+ enabled_.store(false, std::memory_order_relaxed);
+}
+
+SPDLOG_INLINE bool backtracer::enabled() const
+{
+ return enabled_.load(std::memory_order_relaxed);
+}
+
+SPDLOG_INLINE void backtracer::push_back(const log_msg &msg)
+{
+ std::lock_guard lock{mutex_};
+ messages_.push_back(log_msg_buffer{msg});
+}
+
+// pop all items in the q and apply the given fun on each of them.
+SPDLOG_INLINE void backtracer::foreach_pop(std::function fun)
+{
+ std::lock_guard lock{mutex_};
+ while (!messages_.empty())
+ {
+ auto &front_msg = messages_.front();
+ fun(front_msg);
+ messages_.pop_front();
+ }
+}
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer.h
new file mode 100644
index 0000000..b7476bc
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/backtracer.h
@@ -0,0 +1,45 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+
+#include
+#include
+#include
+
+// Store log messages in circular buffer.
+// Useful for storing debug data in case of error/warning happens.
+
+namespace spdlog {
+namespace details {
+class SPDLOG_API backtracer
+{
+ mutable std::mutex mutex_;
+ std::atomic enabled_{false};
+ circular_q messages_;
+
+public:
+ backtracer() = default;
+ backtracer(const backtracer &other);
+
+ backtracer(backtracer &&other) SPDLOG_NOEXCEPT;
+ backtracer &operator=(backtracer other);
+
+ void enable(size_t size);
+ void disable();
+ bool enabled() const;
+ void push_back(const log_msg &msg);
+
+ // pop all items in the q and apply the given fun on each of them.
+ void foreach_pop(std::function fun);
+};
+
+} // namespace details
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "backtracer-inl.h"
+#endif
\ No newline at end of file
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/circular_q.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/circular_q.h
new file mode 100644
index 0000000..1f2712e
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/circular_q.h
@@ -0,0 +1,141 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+// circular q view of std::vector.
+#pragma once
+
+#include
+#include
+
+namespace spdlog {
+namespace details {
+template
+class circular_q
+{
+ size_t max_items_ = 0;
+ typename std::vector::size_type head_ = 0;
+ typename std::vector::size_type tail_ = 0;
+ size_t overrun_counter_ = 0;
+ std::vector v_;
+
+public:
+ using value_type = T;
+
+ // empty ctor - create a disabled queue with no elements allocated at all
+ circular_q() = default;
+
+ explicit circular_q(size_t max_items)
+ : max_items_(max_items + 1) // one item is reserved as marker for full q
+ , v_(max_items_)
+ {}
+
+ circular_q(const circular_q &) = default;
+ circular_q &operator=(const circular_q &) = default;
+
+ // move cannot be default,
+ // since we need to reset head_, tail_, etc to zero in the moved object
+ circular_q(circular_q &&other) SPDLOG_NOEXCEPT
+ {
+ copy_moveable(std::move(other));
+ }
+
+ circular_q &operator=(circular_q &&other) SPDLOG_NOEXCEPT
+ {
+ copy_moveable(std::move(other));
+ return *this;
+ }
+
+ // push back, overrun (oldest) item if no room left
+ void push_back(T &&item)
+ {
+ if (max_items_ > 0)
+ {
+ v_[tail_] = std::move(item);
+ tail_ = (tail_ + 1) % max_items_;
+
+ if (tail_ == head_) // overrun last item if full
+ {
+ head_ = (head_ + 1) % max_items_;
+ ++overrun_counter_;
+ }
+ }
+ }
+
+ // Return reference to the front item.
+ // If there are no elements in the container, the behavior is undefined.
+ const T &front() const
+ {
+ return v_[head_];
+ }
+
+ T &front()
+ {
+ return v_[head_];
+ }
+
+ // Return number of elements actually stored
+ size_t size() const
+ {
+ if (tail_ >= head_)
+ {
+ return tail_ - head_;
+ }
+ else
+ {
+ return max_items_ - (head_ - tail_);
+ }
+ }
+
+ // Return const reference to item by index.
+ // If index is out of range 0…size()-1, the behavior is undefined.
+ const T &at(size_t i) const
+ {
+ assert(i < size());
+ return v_[(head_ + i) % max_items_];
+ }
+
+ // Pop item from front.
+ // If there are no elements in the container, the behavior is undefined.
+ void pop_front()
+ {
+ head_ = (head_ + 1) % max_items_;
+ }
+
+ bool empty() const
+ {
+ return tail_ == head_;
+ }
+
+ bool full() const
+ {
+ // head is ahead of the tail by 1
+ if (max_items_ > 0)
+ {
+ return ((tail_ + 1) % max_items_) == head_;
+ }
+ return false;
+ }
+
+ size_t overrun_counter() const
+ {
+ return overrun_counter_;
+ }
+
+private:
+ // copy from other&& and reset it to disabled state
+ void copy_moveable(circular_q &&other) SPDLOG_NOEXCEPT
+ {
+ max_items_ = other.max_items_;
+ head_ = other.head_;
+ tail_ = other.tail_;
+ overrun_counter_ = other.overrun_counter_;
+ v_ = std::move(other.v_);
+
+ // put &&other in disabled, but valid state
+ other.max_items_ = 0;
+ other.head_ = other.tail_ = 0;
+ other.overrun_counter_ = 0;
+ }
+};
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/console_globals.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/console_globals.h
new file mode 100644
index 0000000..665201d
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/console_globals.h
@@ -0,0 +1,32 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+
+namespace spdlog {
+namespace details {
+
+struct console_mutex
+{
+ using mutex_t = std::mutex;
+ static mutex_t &mutex()
+ {
+ static mutex_t s_mutex;
+ return s_mutex;
+ }
+};
+
+struct console_nullmutex
+{
+ using mutex_t = null_mutex;
+ static mutex_t &mutex()
+ {
+ static mutex_t s_mutex;
+ return s_mutex;
+ }
+};
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper-inl.h
new file mode 100644
index 0000000..7cb00f2
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper-inl.h
@@ -0,0 +1,132 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace spdlog {
+namespace details {
+
+SPDLOG_INLINE file_helper::~file_helper()
+{
+ close();
+}
+
+SPDLOG_INLINE void file_helper::open(const filename_t &fname, bool truncate)
+{
+ close();
+ filename_ = fname;
+ auto *mode = truncate ? SPDLOG_FILENAME_T("wb") : SPDLOG_FILENAME_T("ab");
+
+ for (int tries = 0; tries < open_tries_; ++tries)
+ {
+ // create containing folder if not exists already.
+ os::create_dir(os::dir_name(fname));
+ if (!os::fopen_s(&fd_, fname, mode))
+ {
+ return;
+ }
+
+ details::os::sleep_for_millis(open_interval_);
+ }
+
+ throw_spdlog_ex("Failed opening file " + os::filename_to_str(filename_) + " for writing", errno);
+}
+
+SPDLOG_INLINE void file_helper::reopen(bool truncate)
+{
+ if (filename_.empty())
+ {
+ throw_spdlog_ex("Failed re opening file - was not opened before");
+ }
+ this->open(filename_, truncate);
+}
+
+SPDLOG_INLINE void file_helper::flush()
+{
+ std::fflush(fd_);
+}
+
+SPDLOG_INLINE void file_helper::close()
+{
+ if (fd_ != nullptr)
+ {
+ std::fclose(fd_);
+ fd_ = nullptr;
+ }
+}
+
+SPDLOG_INLINE void file_helper::write(const memory_buf_t &buf)
+{
+ size_t msg_size = buf.size();
+ auto data = buf.data();
+ if (std::fwrite(data, 1, msg_size, fd_) != msg_size)
+ {
+ throw_spdlog_ex("Failed writing to file " + os::filename_to_str(filename_), errno);
+ }
+}
+
+SPDLOG_INLINE size_t file_helper::size() const
+{
+ if (fd_ == nullptr)
+ {
+ throw_spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(filename_));
+ }
+ return os::filesize(fd_);
+}
+
+SPDLOG_INLINE const filename_t &file_helper::filename() const
+{
+ return filename_;
+}
+
+//
+// return file path and its extension:
+//
+// "mylog.txt" => ("mylog", ".txt")
+// "mylog" => ("mylog", "")
+// "mylog." => ("mylog.", "")
+// "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt")
+//
+// the starting dot in filenames is ignored (hidden files):
+//
+// ".mylog" => (".mylog". "")
+// "my_folder/.mylog" => ("my_folder/.mylog", "")
+// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
+SPDLOG_INLINE std::tuple file_helper::split_by_extension(const filename_t &fname)
+{
+ auto ext_index = fname.rfind('.');
+
+ // no valid extension found - return whole path and empty string as
+ // extension
+ if (ext_index == filename_t::npos || ext_index == 0 || ext_index == fname.size() - 1)
+ {
+ return std::make_tuple(fname, filename_t());
+ }
+
+ // treat cases like "/etc/rc.d/somelogfile or "/abc/.hiddenfile"
+ auto folder_index = fname.rfind(details::os::folder_sep);
+ if (folder_index != filename_t::npos && folder_index >= ext_index - 1)
+ {
+ return std::make_tuple(fname, filename_t());
+ }
+
+ // finally - return a valid base and extension tuple
+ return std::make_tuple(fname.substr(0, ext_index), fname.substr(ext_index));
+}
+
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper.h
new file mode 100644
index 0000000..5395d9c
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/file_helper.h
@@ -0,0 +1,59 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+
+namespace spdlog {
+namespace details {
+
+// Helper class for file sinks.
+// When failing to open a file, retry several times(5) with a delay interval(10 ms).
+// Throw spdlog_ex exception on errors.
+
+class SPDLOG_API file_helper
+{
+public:
+ explicit file_helper() = default;
+
+ file_helper(const file_helper &) = delete;
+ file_helper &operator=(const file_helper &) = delete;
+ ~file_helper();
+
+ void open(const filename_t &fname, bool truncate = false);
+ void reopen(bool truncate);
+ void flush();
+ void close();
+ void write(const memory_buf_t &buf);
+ size_t size() const;
+ const filename_t &filename() const;
+
+ //
+ // return file path and its extension:
+ //
+ // "mylog.txt" => ("mylog", ".txt")
+ // "mylog" => ("mylog", "")
+ // "mylog." => ("mylog.", "")
+ // "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt")
+ //
+ // the starting dot in filenames is ignored (hidden files):
+ //
+ // ".mylog" => (".mylog". "")
+ // "my_folder/.mylog" => ("my_folder/.mylog", "")
+ // "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
+ static std::tuple split_by_extension(const filename_t &fname);
+
+private:
+ const int open_tries_ = 5;
+ const int open_interval_ = 10;
+ std::FILE *fd_{nullptr};
+ filename_t filename_;
+};
+} // namespace details
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "file_helper-inl.h"
+#endif
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/fmt_helper.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/fmt_helper.h
new file mode 100644
index 0000000..4f36385
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/fmt_helper.h
@@ -0,0 +1,116 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+#pragma once
+
+#include
+#include
+#include
+#include
+
+// Some fmt helpers to efficiently format and pad ints and strings
+namespace spdlog {
+namespace details {
+namespace fmt_helper {
+
+inline spdlog::string_view_t to_string_view(const memory_buf_t &buf) SPDLOG_NOEXCEPT
+{
+ return spdlog::string_view_t{buf.data(), buf.size()};
+}
+
+inline void append_string_view(spdlog::string_view_t view, memory_buf_t &dest)
+{
+ auto *buf_ptr = view.data();
+ dest.append(buf_ptr, buf_ptr + view.size());
+}
+
+template
+inline void append_int(T n, memory_buf_t &dest)
+{
+ fmt::format_int i(n);
+ dest.append(i.data(), i.data() + i.size());
+}
+
+template
+inline unsigned int count_digits(T n)
+{
+ using count_type = typename std::conditional<(sizeof(T) > sizeof(uint32_t)), uint64_t, uint32_t>::type;
+ return static_cast(fmt::
+// fmt 7.0.0 renamed the internal namespace to detail.
+// See: https://github.com/fmtlib/fmt/issues/1538
+#if FMT_VERSION < 70000
+internal
+#else
+detail
+#endif
+::count_digits(static_cast(n)));
+}
+
+inline void pad2(int n, memory_buf_t &dest)
+{
+ if (n >= 0 && n < 100) // 0-99
+ {
+ dest.push_back(static_cast('0' + n / 10));
+ dest.push_back(static_cast('0' + n % 10));
+ }
+ else // unlikely, but just in case, let fmt deal with it
+ {
+ fmt::format_to(dest, "{:02}", n);
+ }
+}
+
+template
+inline void pad_uint(T n, unsigned int width, memory_buf_t &dest)
+{
+ static_assert(std::is_unsigned::value, "pad_uint must get unsigned T");
+ for (auto digits = count_digits(n); digits < width; digits++)
+ {
+ dest.push_back('0');
+ }
+ append_int(n, dest);
+}
+
+template
+inline void pad3(T n, memory_buf_t &dest)
+{
+ static_assert(std::is_unsigned::value, "pad3 must get unsigned T");
+ if (n < 1000)
+ {
+ dest.push_back(static_cast(n / 100 + '0'));
+ n = n % 100;
+ dest.push_back(static_cast((n / 10) + '0'));
+ dest.push_back(static_cast((n % 10) + '0'));
+ }
+ else
+ {
+ append_int(n, dest);
+ }
+}
+
+template
+inline void pad6(T n, memory_buf_t &dest)
+{
+ pad_uint(n, 6, dest);
+}
+
+template
+inline void pad9(T n, memory_buf_t &dest)
+{
+ pad_uint(n, 9, dest);
+}
+
+// return fraction of a second of the given time_point.
+// e.g.
+// fraction(tp) -> will return the millis part of the second
+template
+inline ToDuration time_fraction(log_clock::time_point tp)
+{
+ using std::chrono::duration_cast;
+ using std::chrono::seconds;
+ auto duration = tp.time_since_epoch();
+ auto secs = duration_cast(duration);
+ return duration_cast(duration) - duration_cast(secs);
+}
+
+} // namespace fmt_helper
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg-inl.h
new file mode 100644
index 0000000..af11e0d
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg-inl.h
@@ -0,0 +1,37 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+#include
+
+namespace spdlog {
+namespace details {
+
+SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time, spdlog::source_loc loc, string_view_t a_logger_name,
+ spdlog::level::level_enum lvl, spdlog::string_view_t msg)
+ : logger_name(a_logger_name)
+ , level(lvl)
+ , time(log_time)
+#ifndef SPDLOG_NO_THREAD_ID
+ , thread_id(os::thread_id())
+#endif
+ , source(loc)
+ , payload(msg)
+{}
+
+SPDLOG_INLINE log_msg::log_msg(
+ spdlog::source_loc loc, string_view_t a_logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg)
+ : log_msg(os::now(), loc, a_logger_name, lvl, msg)
+{}
+
+SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg)
+ : log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg)
+{}
+
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg.h
new file mode 100644
index 0000000..834ca4d
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg.h
@@ -0,0 +1,36 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+
+namespace spdlog {
+namespace details {
+struct SPDLOG_API log_msg
+{
+ log_msg() = default;
+ log_msg(log_clock::time_point log_time, source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg);
+ log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg);
+ log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg);
+ log_msg(const log_msg &other) = default;
+
+ string_view_t logger_name;
+ level::level_enum level{level::off};
+ log_clock::time_point time;
+ size_t thread_id{0};
+
+ // wrapping the formatted text with color (updated by pattern_formatter).
+ mutable size_t color_range_start{0};
+ mutable size_t color_range_end{0};
+
+ source_loc source;
+ string_view_t payload;
+};
+} // namespace details
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "log_msg-inl.h"
+#endif
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer-inl.h
new file mode 100644
index 0000000..51f4d5b
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer-inl.h
@@ -0,0 +1,58 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+namespace spdlog {
+namespace details {
+
+SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg)
+ : log_msg{orig_msg}
+{
+ buffer.append(logger_name.begin(), logger_name.end());
+ buffer.append(payload.begin(), payload.end());
+ update_string_views();
+}
+
+SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other)
+ : log_msg{other}
+{
+ buffer.append(logger_name.begin(), logger_name.end());
+ buffer.append(payload.begin(), payload.end());
+ update_string_views();
+}
+
+SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT : log_msg{other}, buffer{std::move(other.buffer)}
+{
+ update_string_views();
+}
+
+SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other)
+{
+ log_msg::operator=(other);
+ buffer.clear();
+ buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size());
+ update_string_views();
+ return *this;
+}
+
+SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT
+{
+ log_msg::operator=(other);
+ buffer = std::move(other.buffer);
+ update_string_views();
+ return *this;
+}
+
+SPDLOG_INLINE void log_msg_buffer::update_string_views()
+{
+ logger_name = string_view_t{buffer.data(), logger_name.size()};
+ payload = string_view_t{buffer.data() + logger_name.size(), payload.size()};
+}
+
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer.h
new file mode 100644
index 0000000..4410110
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/log_msg_buffer.h
@@ -0,0 +1,33 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+
+namespace spdlog {
+namespace details {
+
+// Extend log_msg with internal buffer to store its payload.
+// This is needed since log_msg holds string_views that points to stack data.
+
+class SPDLOG_API log_msg_buffer : public log_msg
+{
+ memory_buf_t buffer;
+ void update_string_views();
+
+public:
+ log_msg_buffer() = default;
+ explicit log_msg_buffer(const log_msg &orig_msg);
+ log_msg_buffer(const log_msg_buffer &other);
+ log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT;
+ log_msg_buffer &operator=(const log_msg_buffer &other);
+ log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT;
+};
+
+} // namespace details
+} // namespace spdlog
+
+#ifdef SPDLOG_HEADER_ONLY
+#include "log_msg_buffer-inl.h"
+#endif
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/mpmc_blocking_q.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/mpmc_blocking_q.h
new file mode 100644
index 0000000..7f8a253
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/mpmc_blocking_q.h
@@ -0,0 +1,120 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+// multi producer-multi consumer blocking queue.
+// enqueue(..) - will block until room found to put the new message.
+// enqueue_nowait(..) - will return immediately with false if no room left in
+// the queue.
+// dequeue_for(..) - will block until the queue is not empty or timeout have
+// passed.
+
+#include
+
+#include
+#include
+
+namespace spdlog {
+namespace details {
+
+template
+class mpmc_blocking_queue
+{
+public:
+ using item_type = T;
+ explicit mpmc_blocking_queue(size_t max_items)
+ : q_(max_items)
+ {}
+
+#ifndef __MINGW32__
+ // try to enqueue and block if no room left
+ void enqueue(T &&item)
+ {
+ {
+ std::unique_lock lock(queue_mutex_);
+ pop_cv_.wait(lock, [this] { return !this->q_.full(); });
+ q_.push_back(std::move(item));
+ }
+ push_cv_.notify_one();
+ }
+
+ // enqueue immediately. overrun oldest message in the queue if no room left.
+ void enqueue_nowait(T &&item)
+ {
+ {
+ std::unique_lock lock(queue_mutex_);
+ q_.push_back(std::move(item));
+ }
+ push_cv_.notify_one();
+ }
+
+ // try to dequeue item. if no item found. wait upto timeout and try again
+ // Return true, if succeeded dequeue item, false otherwise
+ bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration)
+ {
+ {
+ std::unique_lock lock(queue_mutex_);
+ if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); }))
+ {
+ return false;
+ }
+ popped_item = std::move(q_.front());
+ q_.pop_front();
+ }
+ pop_cv_.notify_one();
+ return true;
+ }
+
+#else
+ // apparently mingw deadlocks if the mutex is released before cv.notify_one(),
+ // so release the mutex at the very end each function.
+
+ // try to enqueue and block if no room left
+ void enqueue(T &&item)
+ {
+ std::unique_lock lock(queue_mutex_);
+ pop_cv_.wait(lock, [this] { return !this->q_.full(); });
+ q_.push_back(std::move(item));
+ push_cv_.notify_one();
+ }
+
+ // enqueue immediately. overrun oldest message in the queue if no room left.
+ void enqueue_nowait(T &&item)
+ {
+ std::unique_lock lock(queue_mutex_);
+ q_.push_back(std::move(item));
+ push_cv_.notify_one();
+ }
+
+ // try to dequeue item. if no item found. wait upto timeout and try again
+ // Return true, if succeeded dequeue item, false otherwise
+ bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration)
+ {
+ std::unique_lock lock(queue_mutex_);
+ if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); }))
+ {
+ return false;
+ }
+ popped_item = std::move(q_.front());
+ q_.pop_front();
+ pop_cv_.notify_one();
+ return true;
+ }
+
+#endif
+
+ size_t overrun_counter()
+ {
+ std::unique_lock lock(queue_mutex_);
+ return q_.overrun_counter();
+ }
+
+private:
+ std::mutex queue_mutex_;
+ std::condition_variable push_cv_;
+ std::condition_variable pop_cv_;
+ spdlog::details::circular_q q_;
+};
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/null_mutex.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/null_mutex.h
new file mode 100644
index 0000000..83533d4
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/null_mutex.h
@@ -0,0 +1,49 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#include
+#include
+// null, no cost dummy "mutex" and dummy "atomic" int
+
+namespace spdlog {
+namespace details {
+struct null_mutex
+{
+ void lock() const {}
+ void unlock() const {}
+ bool try_lock() const
+ {
+ return true;
+ }
+};
+
+struct null_atomic_int
+{
+ int value;
+ null_atomic_int() = default;
+
+ explicit null_atomic_int(int new_value)
+ : value(new_value)
+ {}
+
+ int load(std::memory_order = std::memory_order_relaxed) const
+ {
+ return value;
+ }
+
+ void store(int new_value, std::memory_order = std::memory_order_relaxed)
+ {
+ value = new_value;
+ }
+
+ int exchange(int new_value, std::memory_order = std::memory_order_relaxed)
+ {
+ std::swap(new_value, value);
+ return new_value; // return value before the call
+ }
+};
+
+} // namespace details
+} // namespace spdlog
diff --git a/f4mp_originalcode/F4MPClient/include/spdlog/details/os-inl.h b/f4mp_originalcode/F4MPClient/include/spdlog/details/os-inl.h
new file mode 100644
index 0000000..87c8c5a
--- /dev/null
+++ b/f4mp_originalcode/F4MPClient/include/spdlog/details/os-inl.h
@@ -0,0 +1,554 @@
+// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
+// Distributed under the MIT License (http://opensource.org/licenses/MIT)
+
+#pragma once
+
+#ifndef SPDLOG_HEADER_ONLY
+#include
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include